|
|
@@ -1,10 +1,12 @@
|
|
|
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"`
|
|
|
}
|
|
|
@@ -13,27 +15,31 @@ func (id *IDJsonBody) GetID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type IDPathParam struct {
|
|
|
- ID string `uri:"id" binding:"required" assign:"toField:ID"`
|
|
|
+// IDQueryParam 查询参数中包含ID字段的定义结构
|
|
|
+type IDQueryParam struct {
|
|
|
+ ID string `form:"id" binding:"required" assign:"toField:ID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDPathParam) GetID() string {
|
|
|
+func (id *IDQueryParam) GetID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type IDQueryParam struct {
|
|
|
- ID string `form:"id" binding:"required" assign:"toField:ID"`
|
|
|
+// IDPathParam 路径参数中包含ID字段的定义结构
|
|
|
+type IDPathParam struct {
|
|
|
+ ID string `uri:"id" binding:"required" assign:"toField:ID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDQueryParam) GetID() string {
|
|
|
+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"`
|
|
|
}
|
|
|
@@ -42,28 +48,32 @@ func (id *IDJsonBody) GetTenantID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type TenantIDPathParam struct {
|
|
|
- TenantID string `uri:"tenantId" binding:"required" assign:"toField:TenantID"`
|
|
|
+// TenantIDQueryParam 查询参数中包含租户ID字段的定义结构
|
|
|
+type TenantIDQueryParam struct {
|
|
|
+ TenantID string `form:"tenantId" binding:"required" assign:"toField:TenantID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDPathParam) GetTenantID() string {
|
|
|
+func (id *IDQueryParam) GetTenantID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type TenantIDQueryParam struct {
|
|
|
- TenantID string `form:"tenantId" binding:"required" assign:"toField:TenantID"`
|
|
|
+// TenantIDPathParam 路径参数中包含租户ID字段的定义结构
|
|
|
+type TenantIDPathParam struct {
|
|
|
+ TenantID string `uri:"tenantId" binding:"required" assign:"toField:TenantID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDQueryParam) GetTenantID() string {
|
|
|
+func (id *IDPathParam) GetTenantID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
+// QueryRequestParams 包含查询请求需要字段的查询参数接口
|
|
|
type QueryRequestParams interface {
|
|
|
Params
|
|
|
GetPageNo() int
|
|
|
GetPageSize() int
|
|
|
}
|
|
|
|
|
|
+// BaseQueryParams 包含查询请求需要字段的查询参数基础实现
|
|
|
type BaseQueryParams struct {
|
|
|
PageNo int `form:"pageNo" assign:"-"`
|
|
|
PageSize int `form:"pageSize" assign:"-"`
|
|
|
@@ -77,24 +87,29 @@ 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 JsonBody中包含删除用户ID字段的定义结构
|
|
|
type DeleteUserIDQueryParams struct {
|
|
|
DeleteUserID string `form:"deleteUserId" binding:"required" assign:"toField:LastUpdateUserID"`
|
|
|
}
|