File tree Expand file tree Collapse file tree 5 files changed +42
-2
lines changed
Expand file tree Collapse file tree 5 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,12 @@ func ListHoles(c *fiber.Ctx) error {
175175 if err != nil {
176176 return err
177177 }
178+ if query .Size == 0 {
179+ query .Size = query .Size0
180+ }
181+ if query .Offset .IsZero () {
182+ query .Offset = query .Offset0
183+ }
178184
179185 var holes Holes
180186 err = DB .Transaction (func (tx * gorm.DB ) error {
Original file line number Diff line number Diff line change @@ -23,8 +23,10 @@ func (q *QueryTime) SetDefaults() {
2323}
2424
2525type ListOldModel struct {
26- Offset common.CustomTime `json:"start_time" query:"start_time" swaggertype:"string"`
27- Size int `json:"length" query:"length" default:"10" validate:"max=10" `
26+ Offset0 common.CustomTime `json:"start_time" query:"start_time" swaggertype:"string"`
27+ Offset common.CustomTime `json:"offset" query:"offset" swaggertype:"string"`
28+ Size0 int `json:"length" query:"length" default:"10" validate:"max=10"`
29+ Size int `json:"size" query:"size" default:"10" validate:"max=10" `
2830 Tag string `json:"tag" query:"tag"`
2931 Tags []string `json:"tags" query:"tags"`
3032 DivisionID int `json:"division_id" query:"division_id"`
Original file line number Diff line number Diff line change @@ -1122,11 +1122,23 @@ const docTemplate = `{
11221122 "name": "length",
11231123 "in": "query"
11241124 },
1125+ {
1126+ "type": "string",
1127+ "name": "offset",
1128+ "in": "query"
1129+ },
11251130 {
11261131 "type": "string",
11271132 "name": "order",
11281133 "in": "query"
11291134 },
1135+ {
1136+ "maximum": 10,
1137+ "type": "integer",
1138+ "default": 10,
1139+ "name": "size",
1140+ "in": "query"
1141+ },
11301142 {
11311143 "type": "string",
11321144 "name": "start_time",
Original file line number Diff line number Diff line change 11151115 "name" : " length" ,
11161116 "in" : " query"
11171117 },
1118+ {
1119+ "type" : " string" ,
1120+ "name" : " offset" ,
1121+ "in" : " query"
1122+ },
11181123 {
11191124 "type" : " string" ,
11201125 "name" : " order" ,
11211126 "in" : " query"
11221127 },
1128+ {
1129+ "maximum" : 10 ,
1130+ "type" : " integer" ,
1131+ "default" : 10 ,
1132+ "name" : " size" ,
1133+ "in" : " query"
1134+ },
11231135 {
11241136 "type" : " string" ,
11251137 "name" : " start_time" ,
Original file line number Diff line number Diff line change @@ -1589,9 +1589,17 @@ paths:
15891589 maximum : 10
15901590 name : length
15911591 type : integer
1592+ - in : query
1593+ name : offset
1594+ type : string
15921595 - in : query
15931596 name : order
15941597 type : string
1598+ - default : 10
1599+ in : query
1600+ maximum : 10
1601+ name : size
1602+ type : integer
15951603 - in : query
15961604 name : start_time
15971605 type : string
You can’t perform that action at this time.
0 commit comments