request

package
v0.10.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignRequestParamsToDomainObject

func AssignRequestParamsToDomainObject(params Params, domainObject domain.Object) error

func BindFormBody

func BindFormBody(c *api.Context, params Params) error

func BindJsonBody

func BindJsonBody(c *api.Context, params Params) error

func BindMultipartForm

func BindMultipartForm(c *api.Context, params Params) error

func BindPathParams

func BindPathParams(c *api.Context, params Params) error

func BindQueryParams

func BindQueryParams(c *api.Context, params Params) error

func BindXMLBody

func BindXMLBody(c *api.Context, params Params) error

func Field

func Field[T any](params Params, fieldName string) (T, error)

func ToConcrete

func ToConcrete[T Params](params Params) (T, error)

Types

type BaseQueryParams

type BaseQueryParams struct {
	PageNo   int `form:"pageNo" assign:"-"`
	PageSize int `form:"pageSize" assign:"-"`
}

func (*BaseQueryParams) GetPageNo

func (q *BaseQueryParams) GetPageNo() int

func (*BaseQueryParams) GetPageSize

func (q *BaseQueryParams) GetPageSize() int

type BaseQueryWithIDParams

type BaseQueryWithIDParams struct {
	IDQueryParam
	BaseQueryParams
}

type BindRequestParamsFunc

type BindRequestParamsFunc func(c *api.Context, params Params) error

type CreateUserIDJsonBody

type CreateUserIDJsonBody struct {
	CreateUserID string `json:"createUserId" binding:"required" assign:"toField:CreateUserID"`
}

type DeleteUserIDQueryParams

type DeleteUserIDQueryParams struct {
	DeleteUserID string `form:"deleteUserId" binding:"required" assign:"toField:LastUpdateUserID"`
}

type IDJsonBody

type IDJsonBody struct {
	ID string `json:"id" binding:"required" assign:"toField:ID"`
}

func (*IDJsonBody) GetID

func (id *IDJsonBody) GetID() string

func (*IDJsonBody) GetTenantID

func (id *IDJsonBody) GetTenantID() string

type IDPathParam

type IDPathParam struct {
	ID string `uri:"id" binding:"required" assign:"toField:ID"`
}

func (*IDPathParam) GetID

func (id *IDPathParam) GetID() string

func (*IDPathParam) GetTenantID

func (id *IDPathParam) GetTenantID() string

type IDQueryParam

type IDQueryParam struct {
	ID string `form:"id" binding:"required" assign:"toField:ID"`
}

func (*IDQueryParam) GetID

func (id *IDQueryParam) GetID() string

func (*IDQueryParam) GetTenantID

func (id *IDQueryParam) GetTenantID() string

type IDRequestParam

type IDRequestParam interface {
	Params
	GetID() string
}

type Params

type Params interface{}

type QueryRequestParams

type QueryRequestParams interface {
	Params
	GetPageNo() int
	GetPageSize() int
}

type QueryWithIDRequestParams

type QueryWithIDRequestParams interface {
	IDRequestParam
	QueryRequestParams
}

type TenantIDJsonBody

type TenantIDJsonBody struct {
	TenantID string `json:"tenantId" binding:"required" assign:"toField:TenantID"`
}

type TenantIDPathParam

type TenantIDPathParam struct {
	TenantID string `uri:"tenantId" binding:"required" assign:"toField:TenantID"`
}

type TenantIDQueryParam

type TenantIDQueryParam struct {
	TenantID string `form:"tenantId" binding:"required" assign:"toField:TenantID"`
}

type TenantIDRequestParam

type TenantIDRequestParam interface {
	Params
	GetTenantID() string
}

type UpdateUserIDJsonBody

type UpdateUserIDJsonBody struct {
	UpdateUserID string `json:"updateUserId" binding:"required" assign:"toField:LastUpdateUserID"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL