mirror of
https://github.com/hanzoai/beego.git
synced 2026-11-17 13:19:25 +00:00
Faithful fork of upstream beego v1.12.12 with two changes only: - module path github.com/beego/beego -> github.com/hanzoai/beego (all internal imports repointed) - orm sqlite3 test driver mattn/go-sqlite3 -> hanzoai/csqlite (drop-in); drops the bogus 'mattn/go-sqlite3 v2.0.3+incompatible' pin that poisoned every consumer's module graph via beego v1's go.mod. go build ./... green; go list -deps mattn = 0; grep mattn go.mod = 0. Behavior identical to upstream v1.12.12 (no logic changes). Lets ai repoint its beego-v1 web layer by import path only, preserving exact runtime behavior.
28 lines
481 B
Go
28 lines
481 B
Go
package context
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"net/http"
|
|
)
|
|
|
|
const (
|
|
//BadRequest indicates http error 400
|
|
BadRequest StatusCode = http.StatusBadRequest
|
|
|
|
//NotFound indicates http error 404
|
|
NotFound StatusCode = http.StatusNotFound
|
|
)
|
|
|
|
// StatusCode sets the http response status code
|
|
type StatusCode int
|
|
|
|
func (s StatusCode) Error() string {
|
|
return strconv.Itoa(int(s))
|
|
}
|
|
|
|
// Render sets the http status code
|
|
func (s StatusCode) Render(ctx *Context) {
|
|
ctx.Output.SetStatus(int(s))
|
|
}
|