Documentation
¶
Index ¶
- Constants
- type PageData
- type Response
- type ResponsePage
- func ErrorPage(status int, msg string) ResponsePage[any]
- func ErrorPageT[T any](status int, msg string) ResponsePage[T]
- func ResponsePageToT[T any](result ResponsePage[any]) ResponsePage[T]
- func SuccessPage(data any, page *models.ResultPage) ResponsePage[any]
- func ToResponsePage(r models.Result[any]) ResponsePage[any]
Constants ¶
View Source
const ( ERROR = 500 SUCCESS = 1 UnLogin = 999 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type ResponsePage ¶
type ResponsePage[T any] struct { Code int `json:"code"` Msg string `json:"msg"` SrvTime time.Time `json:"srvTime"` Data *PageData[T] `json:"data"` }
func ErrorPageT ¶
func ErrorPageT[T any](status int, msg string) ResponsePage[T]
func ResponsePageToT ¶
func ResponsePageToT[T any](result ResponsePage[any]) ResponsePage[T]
func SuccessPage ¶
func SuccessPage(data any, page *models.ResultPage) ResponsePage[any]
func ToResponsePage ¶
func ToResponsePage(r models.Result[any]) ResponsePage[any]
func (*ResponsePage[T]) ToAny ¶
func (r *ResponsePage[T]) ToAny() ResponsePage[any]
Click to show internal directories.
Click to hide internal directories.