request

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: May 25, 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 added in v0.1.3

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

func (*BaseQueryParams) GetPageNo added in v0.1.3

func (q *BaseQueryParams) GetPageNo() int

func (*BaseQueryParams) GetPageSize added in v0.1.3

func (q *BaseQueryParams) GetPageSize() int

type BaseQueryWithIDParams added in v0.1.3

type BaseQueryWithIDParams struct {
	IDQueryParam
	BaseQueryParams
}

type CreateUserIDJsonBody added in v0.1.3

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

type DeleteUserIDQueryParams added in v0.1.5

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 added in v0.1.3

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

func (*IDPathParam) GetID added in v0.1.3

func (id *IDPathParam) GetID() string

func (*IDPathParam) GetTenantID added in v0.1.3

func (id *IDPathParam) GetTenantID() string

type IDQueryParam added in v0.1.3

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

func (*IDQueryParam) GetID added in v0.1.3

func (id *IDQueryParam) GetID() string

func (*IDQueryParam) GetTenantID added in v0.1.3

func (id *IDQueryParam) GetTenantID() string

type IDRequestParam added in v0.1.3

type IDRequestParam interface {
	Params
	GetID() string
}

type Params

type Params interface{}

type QueryRequestParams added in v0.1.3

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

type QueryWithIDRequestParams added in v0.1.3

type QueryWithIDRequestParams interface {
	IDRequestParam
	QueryRequestParams
}

type TenantIDJsonBody

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

type TenantIDPathParam added in v0.1.3

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

type TenantIDQueryParam added in v0.1.3

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

type TenantIDRequestParam added in v0.1.3

type TenantIDRequestParam interface {
	Params
	GetTenantID() string
}

type UpdateUserIDJsonBody added in v0.1.5

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