Documentation ¶
Index ¶
- Constants
- Variables
- func AuthCros() gin.HandlerFunc
- func Bind(c *gin.Context, req interface{}) error
- func GenToken(name string) (string, error)
- func HTTPResponse(c *Context, httpCode *int, err *error, data *interface{})
- func IsNil(obj interface{}) bool
- type Context
- type HTTPServer
- type HttpConf
- type ListData
- type Operator
- type PageOption
- type ResultReply
- type TotalOption
Constants ¶
View Source
const TokenExpireDuration = time.Hour * 2
TokenExpireDuration expireDuration
Variables ¶
View Source
var MySecret = []byte("#1024Helper")
MySecret ...
Functions ¶
func HTTPResponse ¶
HTTPResponse 统一返回格式
Types ¶
type Context ¶
type Context struct { context.Context Operator *Operator // contains filtered or unexported fields }
Context context define
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer ...
type ListData ¶
type ListData struct { TotalOption List interface{} `json:"list"` }
ListData ...
func NewListData ¶
func NewListData(opt PageOption, total int64, list interface{}) *ListData
NewListData fill data
type PageOption ¶
type PageOption struct { PageIndex int `form:"pageIndex"` PageSize int `form:"pageSize"` Sort string `form:"sort"` //asc or desc }
PageOption ...
type ResultReply ¶
type ResultReply struct { Result bool `json:"result"` Msg interface{} `json:"msg"` }
ResultReply ...
Click to show internal directories.
Click to hide internal directories.