Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Api ¶
type Api struct {
Description string // api描述
Path string // api路径
IgnoreRootPath bool // api路径是否忽略根路径
IgnoreGlobalStrategies bool // 是否跳过全局策略
Method api_session.ApiMethod // api方法
Strategies []_type.StrategyData // api前置处理策略,不包含全局策略
Params interface{} // api参数
Return interface{} // api返回值
Controller ApiHandlerType // api业务处理器
ParamType string // 参数类型。默认 application/json,可选 multipart/form-data,空表示都支持
ReturnHookFunc ReturnHookFuncType // 返回前的处理函数
}
func (*Api) GetDescription ¶
func (*Api) GetParamType ¶
type ApiHandlerType ¶
type ApiHandlerType func(apiSession _type2.IApiSession) interface{}
type ApiResult ¶
type ApiResult struct {
Msg string `json:"msg"`
InternalMsg string `json:"internal_msg"`
Code uint64 `json:"code"`
Data interface{} `json:"data"`
}
func DefaultReturnDataFunc ¶
type ReturnHookFuncType ¶
type ReturnHookFuncType func(apiContext _type2.IApiSession, apiResult *ApiResult) (interface{}, *go_error.ErrorInfo)
Click to show internal directories.
Click to hide internal directories.