Skip to content

Commit 2cdade8

Browse files
author
Geor Kasapidi
authored
Merge pull request #46 from FantLab/FLGO-45
FLGO-45 Fix json fields
2 parents d860bdd + b8d74a3 commit 2cdade8

File tree

11 files changed

+195
-153
lines changed

11 files changed

+195
-153
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Reamde
22
На данный момент репозиторий содержит код API для Фантлаба, написанный на Go. В состоянии активной разработки.
33

4-
# Порядок работы
4+
## Порядок работы
55
- Завести issue с описанием задачи/бага
66
- Создать у себя ветку FLGO-{#issue}
77
- Написать код
@@ -11,10 +11,9 @@
1111
- ...
1212
- PROFIT
1313

14-
# Protobuf
14+
## Protobuf
1515

16-
```
17-
cd protobuf
18-
19-
protoc --go_out=generated schema/*.proto
16+
```console
17+
$ cd protobuf/
18+
$ protoc --go_out=generated schema/*.proto
2019
```

modules/authapi/api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package authapi
22

33
import (
4+
"net/http"
5+
46
"fantlab/protobuf/generated/fantlab/pb"
57
"fantlab/shared"
68
"fantlab/utils"
7-
"net/http"
89

910
"github.com/gin-gonic/gin"
1011
"github.com/segmentio/ksuid"

modules/blogsapi/datacontroller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ func getCommunities(dbCommunities []dbCommunity) *pb.Blog_CommunitiesResponse {
1515
Title: dbCommunity.Name,
1616
CommunityDescription: dbCommunity.Description,
1717
Stats: &pb.Blog_Community_Stats{
18-
ArticlesCount: dbCommunity.TopicsCount,
19-
SubscribersCount: dbCommunity.SubscriberCount,
18+
ArticleCount: dbCommunity.TopicsCount,
19+
SubscriberCount: dbCommunity.SubscriberCount,
2020
},
2121
LastArticle: &pb.Blog_LastArticle{
2222
Id: dbCommunity.LastTopicId,
@@ -56,8 +56,8 @@ func getBlogs(dbBlogs []dbBlog) *pb.Blog_BlogsResponse {
5656
},
5757
IsClosed: dbBlog.IsClose,
5858
Stats: &pb.Blog_Blog_Stats{
59-
ArticlesCount: dbBlog.TopicsCount,
60-
SubscribersCount: dbBlog.SubscriberCount,
59+
ArticleCount: dbBlog.TopicsCount,
60+
SubscriberCount: dbBlog.SubscriberCount,
6161
},
6262
LastArticle: &pb.Blog_LastArticle{
6363
Id: dbBlog.LastTopicId,

protobuf/generated/fantlab/pb/auth_models.pb.go

Lines changed: 88 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf/generated/fantlab/pb/blog_models.pb.go

Lines changed: 55 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)