Documentation
¶
Index ¶
Constants ¶
View Source
const ( SuccessMessage = "操作成功" FailMessage = "操作失败" )
View Source
const ( GET = "GET" POST = "POST" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandleFunc ¶
type HandleFunc func(http.ResponseWriter, *http.Request)
type R ¶
type R[T any] struct { Code int `json:"code"` // Code 状态码 Data T `json:"data"` // Data 载荷 Msg string `json:"msg"` // Msg 状态消息 Success bool `json:"success"` // Success 状态 }
R 统一响应结构
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) GetHandle ¶
func (r *Route) GetHandle(path string, h HandleFunc)
func (*Route) Handle ¶
func (r *Route) Handle(method, path string, h HandleFunc)
func (*Route) PostHandle ¶
func (r *Route) PostHandle(path string, h HandleFunc)
Click to show internal directories.
Click to hide internal directories.