Documentation
¶
Index ¶
- Constants
- func AddRouteGroups(engine *gin.Engine, prefix string, routes []RouteGroup)
- func ClearAllSession(ctx *gin.Context)
- func GetSession(ctx *gin.Context, k string) interface{}
- func Logger() gin.HandlerFunc
- func RemoveSession(ctx *gin.Context, k string)
- func ResultCodeWithData(ctx *gin.Context, err error, data interface{})
- func SetSession(ctx *gin.Context, k string, o interface{})
- func UseSession(router *gin.Engine)
- type ApiResponse
- type DataList
- type Pager
- type Route
- type RouteGroup
Constants ¶
View Source
const ( Success = 0 Fail = 400 )
Variables ¶
This section is empty.
Functions ¶
func AddRouteGroups ¶
func AddRouteGroups(engine *gin.Engine, prefix string, routes []RouteGroup)
将分组后的路由集合根据分组注册
func ClearAllSession ¶
func GetSession ¶
func RemoveSession ¶
func ResultCodeWithData ¶
func SetSession ¶
func UseSession ¶
Types ¶
type ApiResponse ¶
type DataList ¶
type DataList struct { List interface{} `json:"list"` //列表 SubList interface{} `json:"sub_list,omitempty"` PageNum int `json:"page_num"` //当前页码 PageSize int `json:"page_size"` //单页条数 PageCount int `json:"page_count"` //总页数 Total int64 `json:"total"` //总数 Cols interface{} `json:"cols"` //检索字段 Note interface{} `json:"note,omitempty"` //注解 }
type Pager ¶
type Pager struct { Page int `form:"page" json:"page"` //当前页 PageSize int `form:"pageSize" json:"pageSize"` //每页条数 Total int64 `form:"total" json:"total"` //总条数 PageCount int `form:"pageCount" json:"pageCount"` //总页数 NumStart int `form:"numStart" json:"numStart"` //开始序数 }
分页对象
Click to show internal directories.
Click to hide internal directories.