Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SUCCESS = NewRetCode(0, "Success") UnknownError = NewRetCode(10000, "Unknown error") WrongParams = NewRetCode(10002, "Wrong params") BindDataFailed = NewRetCode(10003, "Bind data failed") Forbidden = NewRetCode(10004, "Forbidden") )
Functions ¶
This section is empty.
Types ¶
type PageRequest ¶
func (*PageRequest) Validate ¶
func (w *PageRequest) Validate() (err error)
type PageResponse ¶
type PageResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Error string `json:"error"`
Data interface{} `json:"data"`
CurrentPage uint `json:"current"`
PageSize uint `json:"pageSize"`
Total uint64 `json:"total"`
}
func NewDataPageResponse ¶
func NewDataPageResponse(data interface{}, currentPage, pageSize uint, total uint64) *PageResponse
func NewErrorPageResponse ¶
func NewErrorPageResponse(err error, retCode *RetCode, currentPage, pageSize uint, total uint64) *PageResponse
func NewPageResponse ¶
func NewPageResponse(currentPage, pageSize uint, total uint64) *PageResponse
type Response ¶
type Response struct {
Code int `json:"code"`
Message string `json:"message"`
Error string `json:"error"`
Data interface{} `json:"data"`
}
func NewDataResponse ¶
func NewDataResponse(data interface{}) *Response
func NewErrorResponse ¶
func NewResponse ¶
func NewResponse() *Response
Click to show internal directories.
Click to hide internal directories.