Documentation ¶
Index ¶
- type BaseController
- func (b *BaseController) ApiError(ret int, msg string)
- func (b *BaseController) ApiErrorData(ret int, msg string, data interface{})
- func (b *BaseController) ApiFail(code int, msg string)
- func (b *BaseController) ApiFailData(code int, msg string, data interface{})
- func (b *BaseController) ApiSuccess(msg string)
- func (b *BaseController) ApiSuccessData(msg string, data interface{})
- func (b *BaseController) GetMap(key string) map[string]string
- func (b *BaseController) Rules(ruleMap map[string]formatter.Rule) map[string]interface{}
- func (b *BaseController) ServeJSON(encoding ...bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseController ¶
type BaseController struct { beego.Controller // contains filtered or unexported fields }
func (*BaseController) ApiErrorData ¶
func (b *BaseController) ApiErrorData(ret int, msg string, data interface{})
*
- 异常返回,带数据
func (*BaseController) ApiFailData ¶
func (b *BaseController) ApiFailData(code int, msg string, data interface{})
*
- 业务失败返回,带数据
func (*BaseController) ApiSuccessData ¶
func (b *BaseController) ApiSuccessData(msg string, data interface{})
*
- 业务成功返回,带数据
func (*BaseController) Rules ¶
func (b *BaseController) Rules(ruleMap map[string]formatter.Rule) map[string]interface{}
func (*BaseController) ServeJSON ¶
func (b *BaseController) ServeJSON(encoding ...bool)
重写ServeJSON,兼容jsonp
Click to show internal directories.
Click to hide internal directories.