Skip to content

Commit

Permalink
Merge pull request #46 from FantLab/FLGO-45
Browse files Browse the repository at this point in the history
FLGO-45 Fix json fields
  • Loading branch information
geor-kasapidi authored Jul 1, 2019
2 parents d860bdd + b8d74a3 commit 2cdade8
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 153 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Reamde
На данный момент репозиторий содержит код API для Фантлаба, написанный на Go. В состоянии активной разработки.

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

# Protobuf
## Protobuf

```
cd protobuf
protoc --go_out=generated schema/*.proto
```console
$ cd protobuf/
$ protoc --go_out=generated schema/*.proto
```
3 changes: 2 additions & 1 deletion modules/authapi/api.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package authapi

import (
"net/http"

"fantlab/protobuf/generated/fantlab/pb"
"fantlab/shared"
"fantlab/utils"
"net/http"

"github.com/gin-gonic/gin"
"github.com/segmentio/ksuid"
Expand Down
8 changes: 4 additions & 4 deletions modules/blogsapi/datacontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ func getCommunities(dbCommunities []dbCommunity) *pb.Blog_CommunitiesResponse {
Title: dbCommunity.Name,
CommunityDescription: dbCommunity.Description,
Stats: &pb.Blog_Community_Stats{
ArticlesCount: dbCommunity.TopicsCount,
SubscribersCount: dbCommunity.SubscriberCount,
ArticleCount: dbCommunity.TopicsCount,
SubscriberCount: dbCommunity.SubscriberCount,
},
LastArticle: &pb.Blog_LastArticle{
Id: dbCommunity.LastTopicId,
Expand Down Expand Up @@ -56,8 +56,8 @@ func getBlogs(dbBlogs []dbBlog) *pb.Blog_BlogsResponse {
},
IsClosed: dbBlog.IsClose,
Stats: &pb.Blog_Blog_Stats{
ArticlesCount: dbBlog.TopicsCount,
SubscribersCount: dbBlog.SubscriberCount,
ArticleCount: dbBlog.TopicsCount,
SubscriberCount: dbBlog.SubscriberCount,
},
LastArticle: &pb.Blog_LastArticle{
Id: dbBlog.LastTopicId,
Expand Down
88 changes: 88 additions & 0 deletions protobuf/generated/fantlab/pb/auth_models.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 55 additions & 55 deletions protobuf/generated/fantlab/pb/blog_models.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2cdade8

Please sign in to comment.