Documentation ¶
Index ¶
- Constants
- func Fail(ctx *gin.Context)
- func FailWithDetailed(data interface{}, message string, ctx *gin.Context)
- func FailWithMessage(message string, ctx *gin.Context)
- func NoAuth(message string, ctx *gin.Context)
- func Ok(ctx *gin.Context)
- func OkWithData(data interface{}, ctx *gin.Context)
- func OkWithDetailed(data interface{}, message string, ctx *gin.Context)
- func OkWithMessage(message string, ctx *gin.Context)
- func Result(code int, data interface{}, msg string, ctx *gin.Context)
- type ApiResponse
- func ApiBadRequestResp(msgs ...any) *ApiResponse
- func ApiForbiddenResp(msgs ...any) *ApiResponse
- func ApiInternalServerErrorResp(msgs ...any) *ApiResponse
- func ApiNotFoundResp(msgs ...any) *ApiResponse
- func ApiNotImplementedResp(msgs ...any) *ApiResponse
- func ApiSuccessResp(msgs ...any) *ApiResponse
- type BasePageInfo
- type Empty
- type Failure
- type IdJson
- type IdUriRequest
- type IdsReq
- type IdsReqInt
- type IdsReqStr
- type JsonWithId
- type JsonWithIdInt
- type JsonWithIdStr
- type PageInfo
- type UpdateStatusRequest
Constants ¶
View Source
const ( ERROR = 7 SUCCESS = 0 )
Variables ¶
This section is empty.
Functions ¶
func FailWithDetailed ¶
func FailWithMessage ¶
func OkWithData ¶
func OkWithDetailed ¶
func OkWithMessage ¶
Types ¶
type ApiResponse ¶
type ApiResponse struct { Code int `json:"code"` Data interface{} `json:"data"` Message any `json:"message"` }
func ApiBadRequestResp ¶
func ApiBadRequestResp(msgs ...any) *ApiResponse
func ApiForbiddenResp ¶
func ApiForbiddenResp(msgs ...any) *ApiResponse
func ApiInternalServerErrorResp ¶
func ApiInternalServerErrorResp(msgs ...any) *ApiResponse
func ApiNotFoundResp ¶
func ApiNotFoundResp(msgs ...any) *ApiResponse
func ApiNotImplementedResp ¶
func ApiNotImplementedResp(msgs ...any) *ApiResponse
func ApiSuccessResp ¶
func ApiSuccessResp(msgs ...any) *ApiResponse
type BasePageInfo ¶
type IdUriRequest ¶
type IdUriRequest struct {
Id string `uri:"id"` // 主键ID
}
type JsonWithId ¶
type JsonWithId[T any] struct { Id T `json:"id"` // 主键ID }
func (*JsonWithId[T]) GetId ¶
func (j *JsonWithId[T]) GetId() T
type JsonWithIdInt ¶
type JsonWithIdInt = JsonWithId[int]
type JsonWithIdStr ¶
type JsonWithIdStr = JsonWithId[string]
type PageInfo ¶
type PageInfo struct { BasePageInfo Keyword string `json:"keyword"` // 关键字 }
PageInfo Paging common input parameter structure
type UpdateStatusRequest ¶
Click to show internal directories.
Click to hide internal directories.