123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- package request
- // IDRequestParam 包含ID字段的请求参数接口
- type IDRequestParam interface {
- Params
- GetID() string
- }
- // IDJsonBody JsonBody中包含ID字段的定义结构
- type IDJsonBody struct {
- ID string `json:"id" binding:"required" assign:"toField:ID"`
- }
- func (id *IDJsonBody) GetID() string {
- return id.ID
- }
- // IDQueryParam 查询参数中包含ID字段的定义结构
- type IDQueryParam struct {
- ID string `form:"id" binding:"required" assign:"toField:ID"`
- }
- func (id *IDQueryParam) GetID() string {
- return id.ID
- }
- // IDPathParam 路径参数中包含ID字段的定义结构
- type IDPathParam struct {
- ID string `uri:"id" binding:"required" assign:"toField:ID"`
- }
- func (id *IDPathParam) GetID() string {
- return id.ID
- }
- // TenantIDRequestParam 包含租户ID字段的请求参数接口
- type TenantIDRequestParam interface {
- Params
- GetTenantID() string
- }
- // TenantIDJsonBody JsonBody中包含租户ID字段的定义结构
- type TenantIDJsonBody struct {
- TenantID string `json:"tenantId" binding:"required" assign:"toField:TenantID"`
- }
- func (id *TenantIDJsonBody) GetTenantID() string {
- return id.TenantID
- }
- // TenantIDQueryParam 查询参数中包含租户ID字段的定义结构
- type TenantIDQueryParam struct {
- TenantID string `form:"tenantId" binding:"required" assign:"toField:TenantID"`
- }
- func (id *TenantIDQueryParam) GetTenantID() string {
- return id.TenantID
- }
- // TenantIDPathParam 路径参数中包含租户ID字段的定义结构
- type TenantIDPathParam struct {
- TenantID string `uri:"tenantId" binding:"required" assign:"toField:TenantID"`
- }
- func (id *TenantIDPathParam) GetTenantID() string {
- return id.TenantID
- }
- // QueryRequestParams 包含查询请求需要字段的查询参数接口
- type QueryRequestParams interface {
- Params
- GetPageNo() int
- GetPageSize() int
- }
- // BaseQueryParams 包含查询请求需要字段的查询参数基础实现
- type BaseQueryParams struct {
- PageNo int `form:"pageNo" assign:"-"`
- PageSize int `form:"pageSize" assign:"-"`
- }
- func (q *BaseQueryParams) GetPageNo() int {
- return q.PageNo
- }
- func (q *BaseQueryParams) GetPageSize() int {
- return q.PageSize
- }
- // QueryWithIDRequestParams 包含查通过ID查询需要字段的查询参数接口
- type QueryWithIDRequestParams interface {
- IDRequestParam
- QueryRequestParams
- }
- // BaseQueryWithIDParams 包含查通过ID查询需要字段的查询参数基础实现
- type BaseQueryWithIDParams struct {
- IDQueryParam
- BaseQueryParams
- }
- // CreateUserIDJsonBody JsonBody中包含创建用户ID字段的定义结构
- type CreateUserIDJsonBody struct {
- CreateUserID string `json:"createUserId" binding:"required" assign:"toField:CreateUserID"`
- }
- // UpdateUserIDJsonBody JsonBody中包含最近更新用户ID字段的定义结构
- type UpdateUserIDJsonBody struct {
- UpdateUserID string `json:"updateUserId" binding:"required" assign:"toField:LastUpdateUserID"`
- }
- // DeleteUserIDQueryParams 查询参数中包含删除用户ID字段的定义结构
- type DeleteUserIDQueryParams struct {
- DeleteUserID string `form:"deleteUserId" binding:"required" assign:"toField:DeleteUserID"`
- }
- // OperatorUserNameJsonBody JsonBody中包含操作者用户名的定义结构
- type OperatorUserNameJsonBody struct {
- OperatorUserName string `json:"operatorUserName" binding:"required" assign:"toField:OperatorUserName"`
- }
- // OperatorUserNameQueryParams 查询参数中包含操作者用户名的定义结构
- type OperatorUserNameQueryParams struct {
- OperatorUserName string `form:"operatorUserName" binding:"required" assign:"toField:OperatorUserName"`
- }
|