Documentation
¶
Index ¶
- func HandleError(ctx *gin.Context, err error)
- func HandleRequestWithBody[T, R any](ctx *gin.Context, handler func(context.Context, *T) (R, error), ...)
- func SwaggerFileHandler(c *gin.Context)
- func WithRecovery(ctx *gin.Context, handler func())
- type BaseController
- func (bc *BaseController[T, CreateR, UpdateR, Resp]) Create(req CreateRequest[T, CreateR])
- func (bc *BaseController[T, CreateR, UpdateR, Resp]) Delete(reqCtx DeleteRequest[T])
- func (bc *BaseController[T, CreateR, UpdateR, Resp]) GetByParams(req GetRequest[T])
- func (bc *BaseController[T, CreateR, UpdateR, Resp]) GetConditionMap() filter.ConditionsMap
- func (bc *BaseController[T, CreateR, UpdateR, Resp]) GetQueryFields(ctx *gin.Context, conditions ...filter.ConditionsMap)
- func (bc *BaseController[T, CreateR, UpdateR, Resp]) List(req GetListRequest[T])
- func (bc *BaseController[T, CreateR, UpdateR, Resp]) Update(req UpdateRequest[T, UpdateR])
- type CacheFunc
- type CacheListFunc
- type CreateRequest
- type DeleteRequest
- type GetFunc
- type GetListFunc
- type GetListRequest
- type GetRequest
- type RequestContext
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleError ¶
func HandleRequestWithBody ¶
func SwaggerFileHandler ¶ added in v0.3.5
func WithRecovery ¶
Types ¶
type BaseController ¶
type BaseController[T entities.Entity, CreateR request.Request[T], UpdateR request.Request[T], Resp any] struct { Service *services.BaseService[T, CreateR] // contains filtered or unexported fields }
func NewBaseController ¶
func NewBaseController[T entities.Entity, CreateR request.Request[T], UpdateR request.Request[T], Resp any]( service *services.BaseService[T, CreateR], ) *BaseController[T, CreateR, UpdateR, Resp]
func (*BaseController[T, CreateR, UpdateR, Resp]) Create ¶
func (bc *BaseController[T, CreateR, UpdateR, Resp]) Create(req CreateRequest[T, CreateR])
func (*BaseController[T, CreateR, UpdateR, Resp]) Delete ¶
func (bc *BaseController[T, CreateR, UpdateR, Resp]) Delete(reqCtx DeleteRequest[T])
func (*BaseController[T, CreateR, UpdateR, Resp]) GetByParams ¶
func (bc *BaseController[T, CreateR, UpdateR, Resp]) GetByParams(req GetRequest[T])
func (*BaseController[T, CreateR, UpdateR, Resp]) GetConditionMap ¶
func (bc *BaseController[T, CreateR, UpdateR, Resp]) GetConditionMap() filter.ConditionsMap
Оптимизированный метод получения conditionMap
func (*BaseController[T, CreateR, UpdateR, Resp]) GetQueryFields ¶
func (bc *BaseController[T, CreateR, UpdateR, Resp]) GetQueryFields( ctx *gin.Context, conditions ...filter.ConditionsMap, )
func (*BaseController[T, CreateR, UpdateR, Resp]) List ¶
func (bc *BaseController[T, CreateR, UpdateR, Resp]) List(req GetListRequest[T])
func (*BaseController[T, CreateR, UpdateR, Resp]) Update ¶
func (bc *BaseController[T, CreateR, UpdateR, Resp]) Update(req UpdateRequest[T, UpdateR])
type CacheListFunc ¶ added in v0.3.5
type CreateRequest ¶ added in v0.3.5
type DeleteRequest ¶ added in v0.4.3
type DeleteRequest[T entities.Entity] struct { RequestContext ServiceFunc interface{} }
type GetListFunc ¶ added in v0.3.5
type GetListRequest ¶ added in v0.3.5
type GetListRequest[T entities.Entity] struct { RequestContext CacheFunc CacheListFunc[T] GetFunc GetListFunc[T] }
type GetRequest ¶ added in v0.3.5
type GetRequest[T entities.Entity] struct { RequestContext CacheFunc CacheFunc[T] GetFunc GetFunc[T] }
type RequestContext ¶ added in v0.3.5
type UpdateRequest ¶ added in v0.3.5
Click to show internal directories.
Click to hide internal directories.