| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- package request
- type WithID interface {
- Params
- GetID() string
- }
- type IDJsonBody struct {
- ID string `json:"id" binding:"required" assign:"toField:ID"`
- }
- func (id *IDJsonBody) GetID() string {
- return id.ID
- }
- type IDPath struct {
- ID string `uri:"id" binding:"required" assign:"toField:ID"`
- }
- func (id *IDPath) GetID() string {
- return id.ID
- }
- type IDQuery struct {
- ID string `form:"id" binding:"required" assign:"toField:ID"`
- }
- func (id *IDQuery) GetID() string {
- return id.ID
- }
- type TenantID interface {
- Params
- GetTenantID() string
- }
- type TenantIDJsonBody struct {
- TenantID string `json:"tenant_id" binding:"required" assign:"toField:TenantID"`
- }
- func (id *IDJsonBody) GetTenantID() string {
- return id.ID
- }
- type TenantIDPath struct {
- TenantID string `uri:"tenant_id" binding:"required" assign:"toField:TenantID"`
- }
- func (id *IDPath) GetTenantID() string {
- return id.ID
- }
- type TenantIDQuery struct {
- TenantID string `form:"tenant_id" binding:"required" assign:"toField:TenantID"`
- }
- func (id *IDQuery) GetTenantID() string {
- return id.ID
- }
- type Query interface {
- Params
- GetPageNo() int
- GetPageSize() int
- }
- type BaseQuery struct {
- PageNo int `form:"pageNo" assign:"-"`
- PageSize int `form:"pageSize" assign:"-"`
- }
- func (q *BaseQuery) GetPageNo() int {
- return q.PageNo
- }
- func (q *BaseQuery) GetPageSize() int {
- return q.PageSize
- }
- type QueryWithID interface {
- WithID
- Query
- }
- type BaseQueryWithID struct {
- IDQuery
- BaseQuery
- }
|