Documentation ¶
Index ¶
- Constants
- func BadRequest(c *gin.Context, err error)
- func Created(c *gin.Context, data interface{})
- func Error(c *gin.Context, code int, err error)
- func Forbidden(c *gin.Context, err error)
- func NewPageDataFromContext[T any](c *gin.Context, list []T, namefunc func(item T) string, ...) response.Page[T]
- func NoContent(c *gin.Context, data interface{})
- func NotOK(c *gin.Context, err error)
- func OK(c *gin.Context, data interface{})
- func Page[T any](total int64, list []T, page, size int64) *response.Page[T]
- func Response(c *gin.Context, code int, data interface{}, err error)
- func Unauthorized(c *gin.Context, err error)
- type ClusterIsolatedSwitch
- type IsolatedSwitch
- type PageQueryCond
- type QArgs
- type URLQuery
- func (q *URLQuery) Count(db *gorm.DB, cond *PageQueryCond) (total int64, err error)
- func (q *URLQuery) MustPreload(mustpreloads []string) *URLQuery
- func (q *URLQuery) PageList(db *gorm.DB, cond *PageQueryCond, dest interface{}) (total int64, page, size int64, err error)
- func (q *URLQuery) PageQuery(db *gorm.DB, cond *PageQueryCond) *gorm.DB
Constants ¶
View Source
const ( MessageOK = "ok" MessageNotFound = "not found" MessageForbidden = "forbidden" )
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶ added in v1.23.8
func NewPageDataFromContext ¶
func Unauthorized ¶
Types ¶
type ClusterIsolatedSwitch ¶
type ClusterIsolatedSwitch struct { Isolate bool `json:"isolate"` ClusterID uint `json:"cluster_id" binding:"required"` }
网络隔离用到的数据结构
type IsolatedSwitch ¶
type IsolatedSwitch struct {
Isolate bool `json:"isolate"`
}
type PageQueryCond ¶
type URLQuery ¶
type URLQuery struct { Page string `form:"page"` Size string `form:"size"` Order string `form:"order"` Search string `form:"search"` Preload string `form:"preload"` // contains filtered or unexported fields }
func NewURLQuery ¶
func (*URLQuery) MustPreload ¶
Click to show internal directories.
Click to hide internal directories.