Documentation ¶
Overview ¶
自定义响应 辅助方法层
Index ¶
- Constants
- func ErrorToErrorCode(err error) *MyError
- type AttrCalcuSymbolData
- type AttributeRes
- type EventFailDescRes
- type FailDataRes
- type MetaEventListRes
- type ReportCountRes
- type Response
- func (this *Response) DealErr(err error) (errorTrace []string)
- func (this *Response) Error(ctx *fiber.Ctx, err error) error
- func (this *Response) FastError(write io.Writer, err error) error
- func (this *Response) JsonDealErr(err error) string
- func (this *Response) Output(write io.Writer, data map[string]interface{}) error
- func (this *Response) ReturnValOrNull(value, empty interface{}) interface{}
- func (this *Response) SliceReturnValOrNull(value []string, empty interface{}) interface{}
- func (this *Response) Success(ctx *fiber.Ctx, msg string, data interface{}) error
Constants ¶
View Source
const ( SUCCESS = 0 ERROR = 500 )
View Source
const ( SearchSuccess = "查询成功" DeleteSuccess = "删除成功" OperateSuccess = "操作成功" LogoutSuccess = "注销成功" ChangeLayoutSuccess = "修改布局成功" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AttrCalcuSymbolData ¶
type AttrCalcuSymbolData struct { AttributeName string `db:"attribute_name" json:"attribute_name"` //属性名 ShowName string `db:"show_name" json:"show_name"` //显示名 DataType int `db:"data_type" json:"data_type"` //数据类型 AttributeType int8 `db:"attribute_type" json:"attribute_type"` //默认为1 (1为预置属性,2为自定义属性) DataTypeFormat string `db:"-" json:"data_type_format"` //数据类型 }
type AttributeRes ¶
type AttributeRes struct { AttributeName string `db:"attribute_name" json:"attribute_name"` //属性名 ShowName string `db:"show_name" json:"show_name"` //显示名 DataType int `db:"data_type" json:"data_type"` //数据类型 AttributeType int8 `db:"attribute_type" json:"attribute_type"` //默认为1 (1为预置属性,2为自定义属性) DataTypeFormat string `db:"-" json:"data_type_format"` //数据类型 AttributeSource int `json:"attribute_source" db:"attribute_source"` Status int `json:"status"` }
type EventFailDescRes ¶
type FailDataRes ¶
type FailDataRes struct { IntervalDate string `json:"interval_date" db:"interval_date"` Year string `json:"year" db:"year"` StartMinute string `json:"start_minute" db:"start_minute"` EndMinute string `json:"end_minute" db:"end_minute"` Count int `json:"count" db:"count"` ErrorReason string `json:"error_reason" db:"error_reason"` ErrorHandling string `json:"error_handling" db:"error_handling"` ReportType string `json:"report_type" db:"report_type"` }
type MetaEventListRes ¶
type ReportCountRes ¶
type Response ¶
type Response struct { Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }
自定义响应方法
func (*Response) JsonDealErr ¶
func (*Response) ReturnValOrNull ¶
func (this *Response) ReturnValOrNull(value, empty interface{}) interface{}
func (*Response) SliceReturnValOrNull ¶
Click to show internal directories.
Click to hide internal directories.