request

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 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 Field

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

func FormBody

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

func JsonBody

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

func MultipartForm

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

func PathParams

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

func QueryParams

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

func ToConcrete

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

func XMLBody

func XMLBody(c *api.Context, params Params) 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 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