Documentation ¶
Index ¶
- func Cors(ctx *gin.Context)
- func CreateHandler(h Handler) gin.HandlerFunc
- func GetPostParams(ctx *gin.Context) (data []map[string]any)
- func GetPutParams(ctx *gin.Context) (where map[string]any, set map[string]any)
- func Logger(c *gin.Context)
- func PostParams(ctx *gin.Context) (data map[string]any, err error)
- func PutParams(ctx *gin.Context) (where map[string]any, set map[string]any, err error)
- func QryParams(ctx *gin.Context) (where map[string]any, pageNo int, pageSize int, sqlAppend string, err error)
- func ResponseLog(ctx *gin.Context)
- type Handler
- type PageInfo
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶
func CreateHandler(h Handler) gin.HandlerFunc
CreateHandler handler 工厂
用法: r.GET("/users", CreateHandler(HandlerForUserList))
@param Handler handler 业务处理函数 @return gin.HandlerFunc handler 函数
func GetPostParams ¶
GetPostParams 取gin的post参数(json)
@param ctx 示例:[]{{"TmplID": "01001", "DepartID": "华北5"}} @return data
func GetPutParams ¶
GetPutParams 取gin的put参数(json)
@param ctx 示例:{"where": {"Grade": 5, "Age": {">=", 3}}, "set": {"Age": 18}} @return where 查询参数 @return set 设置参数
func PostParams ¶ added in v0.0.7
PostParams 取gin的post参数(json)
@param ctx 示例:{"TmplID": "01001", "DepartID": "华北5"} @return data
func PutParams ¶ added in v0.0.7
PutParams 取gin的put参数(json)
@param ctx 示例:{"where": {"Grade": 5, "Age": {">=", 3}}, "set": {"Age": 18}} @return where 查询参数(以 struct 更新时, 内容为空) @return set 设置参数(以 struct 更新时, 内容struct)
func QryParams ¶ added in v0.0.7
func QryParams(ctx *gin.Context) (where map[string]any, pageNo int, pageSize int, sqlAppend string, err error)
QryParams
@param ctx @return where @return pageNo @return pageSize @return sqlAppend @return err
Types ¶
type PageInfo ¶
type PageInfo struct { PageNo int `json:"pageNo,omitempty"` PageSize int `json:"pageSize,omitempty"` TotalCount int `json:"totalCount,omitempty"` }
PageInfo 分页数据
func GetQryParams ¶
GetQryParams 取gin的请求参数(query, web不支持body)
@param ctx 示例: ?pageInfo={"pageNo":1,"pageSize":10}&qry={"TmplID":"01001","DepartID":"华北5"}&append=active='1' @return p *PageInfo 分页 @return where 查询参数 @return sqlAppend 追加(order group....)
Click to show internal directories.
Click to hide internal directories.