Documentation ¶
Index ¶
- func AddAttrib(r *http.Request, name string, value string)
- func AllParams(r *http.Request, entity interface{}) (map[string][]string, map[string]string, map[string][]string)
- func Filter(data map[string]string, entity interface{}) (bool, string, interface{})
- func GetAttrib(r *http.Request, name string) string
- func GetBody(r *http.Request, entity interface{}) (bool, string, interface{})
- func GetEntity(r *http.Request, entity interface{}) (bool, string, interface{})
- func GetHeader(r *http.Request) map[string]string
- func GetHearParam(r *http.Request, name string, def interface{}) interface{}
- func GetParam(r *http.Request, name string, def interface{}) interface{}
- func GetParamToId(r *http.Request, idName string) interface{}
- func GetParamToVersion(r *http.Request, hasVersion bool, versionName string) int
- func GetParams(r *http.Request, entity interface{}) (bool, string, interface{})
- func GetParamsAll(r *http.Request, addHeader bool) map[string]interface{}
- func SetResponse(w http.ResponseWriter, bl bool, msg string, data interface{})
- func SetupCORS(w http.ResponseWriter)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllParams ¶
func AllParams(r *http.Request, entity interface{}) (map[string][]string, map[string]string, map[string][]string)
*
- 取所有参数,并转换成对应实体属性类型(map[string]interface{})
- @param ctx gin请求上下文
- @param entity 实体对象
- @return map[string]interface{}
func Filter ¶
过滤map中不存在结构体中的属性,并转换成对应类型(map[string]interface{})
func GetParams ¶
取所有参数,并转换成对应实体属性类型(map[string]interface{})
func GetParamsAll ¶
取所有参数(map[string]interface{})
func SetResponse ¶
func SetResponse(w http.ResponseWriter, bl bool, msg string, data interface{})
*
- 设置统一返回信息
- w Http响应对象
- (bl bool, msg string, data) 统一信息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.