|
|
@@ -1,6 +1,6 @@
|
|
|
package request
|
|
|
|
|
|
-type WithID interface {
|
|
|
+type IDRequestParam interface {
|
|
|
Params
|
|
|
GetID() string
|
|
|
}
|
|
|
@@ -13,23 +13,23 @@ func (id *IDJsonBody) GetID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type IDPath struct {
|
|
|
+type IDPathParam struct {
|
|
|
ID string `uri:"id" binding:"required" assign:"toField:ID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDPath) GetID() string {
|
|
|
+func (id *IDPathParam) GetID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type IDQuery struct {
|
|
|
+type IDQueryParam struct {
|
|
|
ID string `form:"id" binding:"required" assign:"toField:ID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDQuery) GetID() string {
|
|
|
+func (id *IDQueryParam) GetID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type TenantID interface {
|
|
|
+type TenantIDRequestParam interface {
|
|
|
Params
|
|
|
GetTenantID() string
|
|
|
}
|
|
|
@@ -42,47 +42,59 @@ func (id *IDJsonBody) GetTenantID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type TenantIDPath struct {
|
|
|
+type TenantIDPathParam struct {
|
|
|
TenantID string `uri:"tenant_id" binding:"required" assign:"toField:TenantID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDPath) GetTenantID() string {
|
|
|
+func (id *IDPathParam) GetTenantID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type TenantIDQuery struct {
|
|
|
+type TenantIDQueryParam struct {
|
|
|
TenantID string `form:"tenant_id" binding:"required" assign:"toField:TenantID"`
|
|
|
}
|
|
|
|
|
|
-func (id *IDQuery) GetTenantID() string {
|
|
|
+func (id *IDQueryParam) GetTenantID() string {
|
|
|
return id.ID
|
|
|
}
|
|
|
|
|
|
-type Query interface {
|
|
|
+type QueryRequestParams interface {
|
|
|
Params
|
|
|
GetPageNo() int
|
|
|
GetPageSize() int
|
|
|
}
|
|
|
|
|
|
-type BaseQuery struct {
|
|
|
+type BaseQueryParams struct {
|
|
|
PageNo int `form:"pageNo" assign:"-"`
|
|
|
PageSize int `form:"pageSize" assign:"-"`
|
|
|
}
|
|
|
|
|
|
-func (q *BaseQuery) GetPageNo() int {
|
|
|
+func (q *BaseQueryParams) GetPageNo() int {
|
|
|
return q.PageNo
|
|
|
}
|
|
|
|
|
|
-func (q *BaseQuery) GetPageSize() int {
|
|
|
+func (q *BaseQueryParams) GetPageSize() int {
|
|
|
return q.PageSize
|
|
|
}
|
|
|
|
|
|
-type QueryWithID interface {
|
|
|
- WithID
|
|
|
- Query
|
|
|
+type QueryWithIDRequestParams interface {
|
|
|
+ IDRequestParam
|
|
|
+ QueryRequestParams
|
|
|
}
|
|
|
|
|
|
-type BaseQueryWithID struct {
|
|
|
- IDQuery
|
|
|
- BaseQuery
|
|
|
+type BaseQueryWithIDParams struct {
|
|
|
+ IDQueryParam
|
|
|
+ BaseQueryParams
|
|
|
+}
|
|
|
+
|
|
|
+type CreateUserIDJsonBody struct {
|
|
|
+ CreateUserID string `json:"createUserId" binding:"required" assign:"toField:CreateUserID"`
|
|
|
+}
|
|
|
+
|
|
|
+type LastUpdateUserIDJsonBody struct {
|
|
|
+ LastUpdateUserID string `json:"lastUpdateUserId" binding:"required" assign:"toField:LastUpdateUserID"`
|
|
|
+}
|
|
|
+
|
|
|
+type LastUpdateUserIDPathParams struct {
|
|
|
+ LastUpdateUserID string `uri:"lastUpdateUserId" binding:"required" assign:"toField:LastUpdateUserID"`
|
|
|
}
|