Documentation
¶
Index ¶
- type ErrCode
- type IResponse
- type Response
- func (r *Response) Fail(ctx *gin.Context)
- func (r *Response) New() IResponse
- func (r *Response) Success(ctx *gin.Context)
- func (r *Response) WithCode(code ErrCode) IResponse
- func (r *Response) WithData(data interface{}) IResponse
- func (r *Response) WithData2(data interface{}) IResponse
- func (r *Response) WithMessage(message string) IResponse
- func (r *Response) WithPage(page int) IResponse
- func (r *Response) WithPageSize(pageSize int) IResponse
- func (r *Response) WithSuccess(success bool) IResponse
- func (r *Response) WithTotal(total int64) IResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IResponse ¶
type IResponse interface { New() IResponse WithCode(code ErrCode) IResponse WithSuccess(success bool) IResponse WithMessage(message string) IResponse WithData(data interface{}) IResponse WithData2(data interface{}) IResponse WithTotal(total int64) IResponse WithPage(page int) IResponse WithPageSize(pageSize int) IResponse Success(ctx *gin.Context) Fail(ctx *gin.Context) // contains filtered or unexported methods }
type Response ¶
type Response struct { Code ErrCode `json:"code"` IsSuccess bool `json:"success"` Message string `json:"message"` IV string `json:"iv,omitempty"` Encrypted bool `json:"encrypted,omitempty"` EncryptedType string `json:"encrypted_type,omitempty"` Data interface{} `json:"data,omitempty"` Data2 interface{} `json:"data2,omitempty"` Time int64 `json:"time,omitempty"` Total int64 `json:"total,omitempty"` Page int `json:"page,omitempty"` PageSize int `json:"page_size,omitempty"` }
func (*Response) WithMessage ¶
func (*Response) WithPageSize ¶
func (*Response) WithSuccess ¶
Click to show internal directories.
Click to hide internal directories.