Documentation ¶
Index ¶
- func Cors(ctx *gin.Context)
- func CreateQryHandler(h QryHandler) gin.HandlerFunc
- func CreateUpHandler(h UpdateHandler) gin.HandlerFunc
- func Logger(c *gin.Context)
- func PostGetParams(ctx *gin.Context) (where map[string]any, current int, pageSize int, sqlAppend string, err error)
- func PostParams(ctx *gin.Context) (data map[string]any, err error)
- func PostParamsList(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]string, current int, pageSize int, sqlAppend string, ...)
- func ResponseLog(ctx *gin.Context)
- type QryHandler
- type Response
- type UpdateHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateQryHandler ¶
func CreateQryHandler(h QryHandler) gin.HandlerFunc
CreateQryHandler 查询
用法: r.GET("/users", CreateQryHandler(HandlerForUserList))
@param h @return gin.HandlerFunc handler 函数
func CreateUpHandler ¶
func CreateUpHandler(h UpdateHandler) gin.HandlerFunc
func PostGetParams ¶ added in v2.0.3
func PostGetParams(ctx *gin.Context) (where map[string]any, current int, pageSize int, sqlAppend string, err error)
PostGetParams Post 方式获取 get 数据
@param ctx @return where @return current @return pageSize @return sqlAppend @return err
func PostParams ¶
PostParams 取gin的post参数(json)
@param ctx 示例:{"TmplID": "01001", "DepartID": "华北5"} @return data @return err
func PostParamsList ¶ added in v2.0.2
PostParamsList (多)取gin的post参数(json)
@param ctx @return data []map[string]any @return err
func PutParams ¶
PutParams 取gin的put参数(json)
@param ctx 示例:{"where": {"Grade": 5, "Age": {">=", 3}}, "set": {"Age": 18}} @return where 查询参数(以 struct 更新时, 内容为空) @return set 设置参数(以 struct 更新时, 内容struct) @return err
Types ¶
type QryHandler ¶
QryHandler
@param ctx @return data @return total 不传会使用 data 的长度, 如果是分页一定要传 @return errRtn
type Response ¶
type Response struct { Success bool `json:"success"` Total int `json:"total"` // 查询的结果集 Data any `json:"data"` }
Response 响应体
type UpdateHandler ¶
Click to show internal directories.
Click to hide internal directories.