Skip to content

Commit 670329d

Browse files
committed
fix:get all floors in a hole
1 parent cc33deb commit 670329d

File tree

6 files changed

+37
-1
lines changed

6 files changed

+37
-1
lines changed

apis/floor/apis.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ func ListFloorsInAHole(c *fiber.Ctx) error {
4040
return err
4141
}
4242

43+
// if size and offset both are 0, get all floors
44+
if c.Query("size") == "0" && c.Query("offset") == "0" {
45+
query.Size = -1 // get all floors
46+
}
47+
4348
// get floors
4449
var floors Floors
4550
// use ranking field to locate faster

docs/docs.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3925,6 +3925,17 @@ const docTemplate = `{
39253925
"x-enum-comments": {
39263926
"MessageTypeModify": "including fold and delete"
39273927
},
3928+
"x-enum-descriptions": [
3929+
"",
3930+
"",
3931+
"",
3932+
"including fold and delete",
3933+
"",
3934+
"",
3935+
"",
3936+
"",
3937+
""
3938+
],
39283939
"x-enum-varnames": [
39293940
"MessageTypeFavorite",
39303941
"MessageTypeReply",

docs/swagger.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3918,6 +3918,17 @@
39183918
"x-enum-comments": {
39193919
"MessageTypeModify": "including fold and delete"
39203920
},
3921+
"x-enum-descriptions": [
3922+
"",
3923+
"",
3924+
"",
3925+
"including fold and delete",
3926+
"",
3927+
"",
3928+
"",
3929+
"",
3930+
""
3931+
],
39213932
"x-enum-varnames": [
39223933
"MessageTypeFavorite",
39233934
"MessageTypeReply",

docs/swagger.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,16 @@ definitions:
579579
type: string
580580
x-enum-comments:
581581
MessageTypeModify: including fold and delete
582+
x-enum-descriptions:
583+
- ""
584+
- ""
585+
- ""
586+
- including fold and delete
587+
- ""
588+
- ""
589+
- ""
590+
- ""
591+
- ""
582592
x-enum-varnames:
583593
- MessageTypeFavorite
584594
- MessageTypeReply

models/floor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ func (floors Floors) MakeQuerySet(holeID *int, offset, size *int, c *fiber.Ctx)
149149
if holeID != nil {
150150
querySet = querySet.Where("hole_id = ?", holeID)
151151
}
152-
153152
if offset != nil {
154153
querySet = querySet.Offset(*offset)
155154
}

treehole

53.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)