|
|
@@ -6,7 +6,7 @@ type WithID interface {
|
|
|
}
|
|
|
|
|
|
type IDJsonBody struct {
|
|
|
- ID string `json:"id" binding:"required"`
|
|
|
+ ID string `json:"id" binding:"required" assign:"toField:ID"`
|
|
|
}
|
|
|
|
|
|
func (id *IDJsonBody) GetID() string {
|
|
|
@@ -14,7 +14,7 @@ func (id *IDJsonBody) GetID() string {
|
|
|
}
|
|
|
|
|
|
type IDPath struct {
|
|
|
- ID string `uri:"id" binding:"required"`
|
|
|
+ ID string `uri:"id" binding:"required" assign:"toField:ID"`
|
|
|
}
|
|
|
|
|
|
func (id *IDPath) GetID() string {
|
|
|
@@ -22,7 +22,7 @@ func (id *IDPath) GetID() string {
|
|
|
}
|
|
|
|
|
|
type IDQuery struct {
|
|
|
- ID string `form:"id" binding:"required"`
|
|
|
+ ID string `form:"id" binding:"required" assign:"toField:ID"`
|
|
|
}
|
|
|
|
|
|
func (id *IDQuery) GetID() string {
|
|
|
@@ -35,7 +35,7 @@ type TenantID interface {
|
|
|
}
|
|
|
|
|
|
type TenantIDJsonBody struct {
|
|
|
- TenantID string `json:"tenant_id" binding:"required"`
|
|
|
+ TenantID string `json:"tenant_id" binding:"required" assign:"toField:TenantID"`
|
|
|
}
|
|
|
|
|
|
func (id *IDJsonBody) GetTenantID() string {
|
|
|
@@ -43,7 +43,7 @@ func (id *IDJsonBody) GetTenantID() string {
|
|
|
}
|
|
|
|
|
|
type TenantIDPath struct {
|
|
|
- TenantID string `uri:"tenant_id" binding:"required"`
|
|
|
+ TenantID string `uri:"tenant_id" binding:"required" assign:"toField:TenantID"`
|
|
|
}
|
|
|
|
|
|
func (id *IDPath) GetTenantID() string {
|
|
|
@@ -51,7 +51,7 @@ func (id *IDPath) GetTenantID() string {
|
|
|
}
|
|
|
|
|
|
type TenantIDQuery struct {
|
|
|
- TenantID string `form:"tenant_id" binding:"required"`
|
|
|
+ TenantID string `form:"tenant_id" binding:"required" assign:"toField:TenantID"`
|
|
|
}
|
|
|
|
|
|
func (id *IDQuery) GetTenantID() string {
|
|
|
@@ -65,8 +65,8 @@ type Query interface {
|
|
|
}
|
|
|
|
|
|
type BaseQuery struct {
|
|
|
- PageNo int `form:"pageNo"`
|
|
|
- PageSize int `form:"pageSize"`
|
|
|
+ PageNo int `form:"pageNo" assign:"-"`
|
|
|
+ PageSize int `form:"pageSize" assign:"-"`
|
|
|
}
|
|
|
|
|
|
func (q *BaseQuery) GetPageNo() int {
|