GeezerVison is showing github.com — feat(private-api): add `total_members` and `description` get topic's … · gitLibs/server@a882c60
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: internal/web/handler/comments.go +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -56,11 +56,13 @@ func (h Handler) GetGroupTopic(c *fiber.Ctx) error { |
56 | 56 | return res.JSON(c, ResPrivateTopicDetailWithGroup{ |
57 | 57 | PrivateTopicDetail: data, |
58 | 58 | Group: res.PrivateGroup{ |
59 | | - ID: group.ID, |
60 | | - Name: group.Name, |
61 | | - CreatedAt: group.CreatedAt, |
62 | | - Title: group.Title, |
63 | | - Icon: groupIconPrefix + group.Icon, |
| 59 | + ID: group.ID, |
| 60 | + Name: group.Name, |
| 61 | + CreatedAt: group.CreatedAt, |
| 62 | + Title: group.Title, |
| 63 | + Icon: groupIconPrefix + group.Icon, |
| 64 | + TotalMembers: group.MemberCount, |
| 65 | + Description: group.Description, |
64 | 66 | }, |
65 | 67 | }) |
66 | 68 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: internal/web/res/group_private.go +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,11 +21,13 @@ import ( |
21 | 21 | ) |
22 | 22 |
|
23 | 23 | type PrivateGroup struct { |
24 | | - ID model.GroupID `json:"id"` |
25 | | - Name string `json:"name"` |
26 | | - CreatedAt time.Time `json:"created_at"` |
27 | | - Title string `json:"title"` |
28 | | - Icon string `json:"icon" format:"url"` |
| 24 | + ID model.GroupID `json:"id"` |
| 25 | + Name string `json:"name"` |
| 26 | + CreatedAt time.Time `json:"created_at"` |
| 27 | + Title string `json:"title"` |
| 28 | + Icon string `json:"icon" format:"url"` |
| 29 | + TotalMembers int64 `json:"total_members"` |
| 30 | + Description string `json:"description"` |
29 | 31 | } |
30 | 32 |
|
31 | 33 | type PrivateGroupProfile struct { |
|
Collapse file
Copy file name to clipboardExpand all lines: openapi/private.yaml +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -595,6 +595,8 @@ components: |
595 | 595 | - created_at |
596 | 596 | - title |
597 | 597 | - icon |
| 598 | + - total_members |
| 599 | + - description |
598 | 600 | properties: |
599 | 601 | id: |
600 | 602 | type: integer |
@@ -608,6 +610,10 @@ components: |
608 | 610 | icon: |
609 | 611 | type: string |
610 | 612 | format: url |
| 613 | + total_members: |
| 614 | + type: integer |
| 615 | + description: |
| 616 | + type: string |
611 | 617 | PrivateTopicDetail: |
612 | 618 | $ref: "./components/private/private_topic_detail.yaml" |
613 | 619 | Topic: |
|