正在显示
11 个修改的文件
包含
298 行增加
和
10 行删除
@@ -63,6 +63,15 @@ service Core { | @@ -63,6 +63,15 @@ service Core { | ||
63 | @doc "小程序获取文章的编辑记录" | 63 | @doc "小程序获取文章的编辑记录" |
64 | @handler MiniArticleBackupSearch | 64 | @handler MiniArticleBackupSearch |
65 | post /article_backup/search (MiniArticleBackupSearchRequest) returns (MiniArticleBackupSearchResponse) | 65 | post /article_backup/search (MiniArticleBackupSearchRequest) returns (MiniArticleBackupSearchResponse) |
66 | + | ||
67 | + | ||
68 | + @doc "小程序设置文章的定性标签" | ||
69 | + @handler MiniArticleSetTag | ||
70 | + post /article/set_tag (MiniArticleSetTagRequest) returns (MiniArticleSetTagResponse) | ||
71 | + | ||
72 | + @doc "小程序所有的定性标签" | ||
73 | + @handler MiniAllArticleTag | ||
74 | + get /article_tag/list/all (MiniAllArticleTagRequest) returns (MiniAllArticleTagResponse) | ||
66 | } | 75 | } |
67 | 76 | ||
68 | // 管理后台接口 | 77 | // 管理后台接口 |
@@ -278,6 +278,39 @@ type ( | @@ -278,6 +278,39 @@ type ( | ||
278 | } | 278 | } |
279 | ) | 279 | ) |
280 | 280 | ||
281 | +//小程序端设置文章的定性标签 | ||
282 | +type ( | ||
283 | + MiniArticleSetTagRequest{ | ||
284 | + CompanyId int64 `json:",optional"` // 公司id | ||
285 | + UserId int64 `json:",optional"` // 公司id | ||
286 | + ArticleId int64 `json:"articleId"` // 文章id | ||
287 | + TagId int64 `json:"tagId"` // 标签id | ||
288 | + } | ||
289 | + MiniArticleSetTagResponse{ | ||
290 | + Id int64 `json:"id"` | ||
291 | + } | ||
292 | +) | ||
293 | + | ||
294 | + | ||
295 | +//小程序端获取所有的定性标签 | ||
296 | +type ( | ||
297 | + MiniAllArticleTagRequest{ | ||
298 | + CompanyId int64 `json:",optional"` // 公司id | ||
299 | + UserId int64 `json:",optional"` // 公司id | ||
300 | + ArticleId int64 `json:"articleId"` // 文章id | ||
301 | + TagId int64 `json:"tagId"` // 标签id | ||
302 | + } | ||
303 | + MiniAllArticleTagResponse{ | ||
304 | + TagGroup []string `json:"tagGroup"` | ||
305 | + Tags []ArticleTagItem `json:"tags"` | ||
306 | + } | ||
307 | + | ||
308 | + ArticleTagItem { | ||
309 | + Id int64 `json:"id"` | ||
310 | + Group string `json:"group"` | ||
311 | + Name string `json:"name"` | ||
312 | + } | ||
313 | +) | ||
281 | 314 | ||
282 | 315 | ||
283 | 316 |
@@ -39,6 +39,10 @@ service Core { | @@ -39,6 +39,10 @@ service Core { | ||
39 | @doc "小程序展示删除文章评论" | 39 | @doc "小程序展示删除文章评论" |
40 | @handler MiniDeleteArticleComment | 40 | @handler MiniDeleteArticleComment |
41 | delete /article_comment/:id (MiniDeleteArticleCommentRequest) returns (MiniDeleteArticleCommentResponse) | 41 | delete /article_comment/:id (MiniDeleteArticleCommentRequest) returns (MiniDeleteArticleCommentResponse) |
42 | + | ||
43 | + @doc "小程序展示评论时@人可选列表" | ||
44 | + @handler MiniArticleCommentAtWho | ||
45 | + post /article_comment/at_who/list (MiniArticleCommentAtWhoRequest) returns (MiniArticleCommentAtWhoResponse) | ||
42 | } | 46 | } |
43 | 47 | ||
44 | // | 48 | // |
@@ -161,6 +165,7 @@ type ( | @@ -161,6 +165,7 @@ type ( | ||
161 | } | 165 | } |
162 | ) | 166 | ) |
163 | 167 | ||
168 | +// 热门前5的评论列表 | ||
164 | type ( | 169 | type ( |
165 | MiniTop5ArticleCommentRequest { | 170 | MiniTop5ArticleCommentRequest { |
166 | CompanyId int64 `json:",optional"` | 171 | CompanyId int64 `json:",optional"` |
@@ -171,4 +176,17 @@ type ( | @@ -171,4 +176,17 @@ type ( | ||
171 | MiniTop5ArticleCommentResponse { | 176 | MiniTop5ArticleCommentResponse { |
172 | List []ArticleCommentItem `json:"list"` | 177 | List []ArticleCommentItem `json:"list"` |
173 | } | 178 | } |
179 | +) | ||
180 | + | ||
181 | +// 填写评论时选择@人 | ||
182 | +type ( | ||
183 | + MiniArticleCommentAtWhoRequest { | ||
184 | + CompanyId int64 `json:",optional"` | ||
185 | + UserId int64 `json:",optional"` | ||
186 | + ArticleId int64 `json:"articleId"` | ||
187 | + } | ||
188 | + | ||
189 | + MiniArticleCommentAtWhoResponse { | ||
190 | + List []CommentAtWho `json:"list"` | ||
191 | + } | ||
174 | ) | 192 | ) |
1 | +package article | ||
2 | + | ||
3 | +import ( | ||
4 | + "net/http" | ||
5 | + | ||
6 | + "github.com/zeromicro/go-zero/rest/httpx" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/article" | ||
8 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
9 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
10 | +) | ||
11 | + | ||
12 | +func MiniAllArticleTagHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
14 | + var req types.MiniAllArticleTagRequest | ||
15 | + if err := httpx.Parse(r, &req); err != nil { | ||
16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + l := article.NewMiniAllArticleTagLogic(r.Context(), svcCtx) | ||
21 | + resp, err := l.MiniAllArticleTag(&req) | ||
22 | + if err != nil { | ||
23 | + httpx.ErrorCtx(r.Context(), w, err) | ||
24 | + } else { | ||
25 | + httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | + } | ||
27 | + } | ||
28 | +} |
1 | +package article | ||
2 | + | ||
3 | +import ( | ||
4 | + "net/http" | ||
5 | + | ||
6 | + "github.com/zeromicro/go-zero/rest/httpx" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/article" | ||
8 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
9 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
10 | +) | ||
11 | + | ||
12 | +func MiniArticleSetTagHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
14 | + var req types.MiniArticleSetTagRequest | ||
15 | + if err := httpx.Parse(r, &req); err != nil { | ||
16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + l := article.NewMiniArticleSetTagLogic(r.Context(), svcCtx) | ||
21 | + resp, err := l.MiniArticleSetTag(&req) | ||
22 | + if err != nil { | ||
23 | + httpx.ErrorCtx(r.Context(), w, err) | ||
24 | + } else { | ||
25 | + httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | + } | ||
27 | + } | ||
28 | +} |
1 | +package comment | ||
2 | + | ||
3 | +import ( | ||
4 | + "net/http" | ||
5 | + | ||
6 | + "github.com/zeromicro/go-zero/rest/httpx" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/comment" | ||
8 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
9 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
10 | +) | ||
11 | + | ||
12 | +func MiniArticleCommentAtWhoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
14 | + var req types.MiniArticleCommentAtWhoRequest | ||
15 | + if err := httpx.Parse(r, &req); err != nil { | ||
16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + l := comment.NewMiniArticleCommentAtWhoLogic(r.Context(), svcCtx) | ||
21 | + resp, err := l.MiniArticleCommentAtWho(&req) | ||
22 | + if err != nil { | ||
23 | + httpx.ErrorCtx(r.Context(), w, err) | ||
24 | + } else { | ||
25 | + httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | + } | ||
27 | + } | ||
28 | +} |
@@ -50,6 +50,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -50,6 +50,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
50 | Path: "/article_comment/:id", | 50 | Path: "/article_comment/:id", |
51 | Handler: comment.MiniDeleteArticleCommentHandler(serverCtx), | 51 | Handler: comment.MiniDeleteArticleCommentHandler(serverCtx), |
52 | }, | 52 | }, |
53 | + { | ||
54 | + Method: http.MethodPost, | ||
55 | + Path: "/article_comment/at_who/list", | ||
56 | + Handler: comment.MiniArticleCommentAtWhoHandler(serverCtx), | ||
57 | + }, | ||
53 | }, | 58 | }, |
54 | rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), | 59 | rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), |
55 | rest.WithPrefix("/v1/mini"), | 60 | rest.WithPrefix("/v1/mini"), |
@@ -336,6 +341,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -336,6 +341,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
336 | Path: "/article_backup/search", | 341 | Path: "/article_backup/search", |
337 | Handler: article.MiniArticleBackupSearchHandler(serverCtx), | 342 | Handler: article.MiniArticleBackupSearchHandler(serverCtx), |
338 | }, | 343 | }, |
344 | + { | ||
345 | + Method: http.MethodPost, | ||
346 | + Path: "/article/set_tag", | ||
347 | + Handler: article.MiniArticleSetTagHandler(serverCtx), | ||
348 | + }, | ||
349 | + { | ||
350 | + Method: http.MethodGet, | ||
351 | + Path: "/article_tag/list/all", | ||
352 | + Handler: article.MiniAllArticleTagHandler(serverCtx), | ||
353 | + }, | ||
339 | }, | 354 | }, |
340 | rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), | 355 | rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), |
341 | rest.WithPrefix("/v1/mini"), | 356 | rest.WithPrefix("/v1/mini"), |
1 | +package article | ||
2 | + | ||
3 | +import ( | ||
4 | + "context" | ||
5 | + | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
8 | + | ||
9 | + "github.com/zeromicro/go-zero/core/logx" | ||
10 | +) | ||
11 | + | ||
12 | +type MiniAllArticleTagLogic struct { | ||
13 | + logx.Logger | ||
14 | + ctx context.Context | ||
15 | + svcCtx *svc.ServiceContext | ||
16 | +} | ||
17 | + | ||
18 | +func NewMiniAllArticleTagLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniAllArticleTagLogic { | ||
19 | + return &MiniAllArticleTagLogic{ | ||
20 | + Logger: logx.WithContext(ctx), | ||
21 | + ctx: ctx, | ||
22 | + svcCtx: svcCtx, | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +func (l *MiniAllArticleTagLogic) MiniAllArticleTag(req *types.MiniAllArticleTagRequest) (resp *types.MiniAllArticleTagResponse, err error) { | ||
27 | + // todo: add your logic here and delete this line | ||
28 | + | ||
29 | + return | ||
30 | +} |
1 | +package article | ||
2 | + | ||
3 | +import ( | ||
4 | + "context" | ||
5 | + | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
8 | + | ||
9 | + "github.com/zeromicro/go-zero/core/logx" | ||
10 | +) | ||
11 | + | ||
12 | +type MiniArticleSetTagLogic struct { | ||
13 | + logx.Logger | ||
14 | + ctx context.Context | ||
15 | + svcCtx *svc.ServiceContext | ||
16 | +} | ||
17 | + | ||
18 | +func NewMiniArticleSetTagLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniArticleSetTagLogic { | ||
19 | + return &MiniArticleSetTagLogic{ | ||
20 | + Logger: logx.WithContext(ctx), | ||
21 | + ctx: ctx, | ||
22 | + svcCtx: svcCtx, | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +func (l *MiniArticleSetTagLogic) MiniArticleSetTag(req *types.MiniArticleSetTagRequest) (resp *types.MiniArticleSetTagResponse, err error) { | ||
27 | + // todo: add your logic here and delete this line | ||
28 | + | ||
29 | + return | ||
30 | +} |
1 | +package comment | ||
2 | + | ||
3 | +import ( | ||
4 | + "context" | ||
5 | + | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
8 | + | ||
9 | + "github.com/zeromicro/go-zero/core/logx" | ||
10 | +) | ||
11 | + | ||
12 | +type MiniArticleCommentAtWhoLogic struct { | ||
13 | + logx.Logger | ||
14 | + ctx context.Context | ||
15 | + svcCtx *svc.ServiceContext | ||
16 | +} | ||
17 | + | ||
18 | +func NewMiniArticleCommentAtWhoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniArticleCommentAtWhoLogic { | ||
19 | + return &MiniArticleCommentAtWhoLogic{ | ||
20 | + Logger: logx.WithContext(ctx), | ||
21 | + ctx: ctx, | ||
22 | + svcCtx: svcCtx, | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniArticleCommentAtWhoRequest) (resp *types.MiniArticleCommentAtWhoResponse, err error) { | ||
27 | + // todo: add your logic here and delete this line | ||
28 | + | ||
29 | + return | ||
30 | +} |
@@ -118,6 +118,16 @@ type MiniTop5ArticleCommentResponse struct { | @@ -118,6 +118,16 @@ type MiniTop5ArticleCommentResponse struct { | ||
118 | List []ArticleCommentItem `json:"list"` | 118 | List []ArticleCommentItem `json:"list"` |
119 | } | 119 | } |
120 | 120 | ||
121 | +type MiniArticleCommentAtWhoRequest struct { | ||
122 | + CompanyId int64 `json:",optional"` | ||
123 | + UserId int64 `json:",optional"` | ||
124 | + ArticleId int64 `json:"articleId"` | ||
125 | +} | ||
126 | + | ||
127 | +type MiniArticleCommentAtWhoResponse struct { | ||
128 | + List []CommentAtWho `json:"list"` | ||
129 | +} | ||
130 | + | ||
121 | type MessageSystemRequest struct { | 131 | type MessageSystemRequest struct { |
122 | Page int `json:"page"` | 132 | Page int `json:"page"` |
123 | Size int `json:"size"` | 133 | Size int `json:"size"` |
@@ -580,16 +590,16 @@ type MiniArticleGetRequest struct { | @@ -580,16 +590,16 @@ type MiniArticleGetRequest struct { | ||
580 | } | 590 | } |
581 | 591 | ||
582 | type MiniArticleGetResponse struct { | 592 | type MiniArticleGetResponse struct { |
583 | - Id int64 `json:"id"` // id | ||
584 | - Title string `json:"title"` // 标题 | ||
585 | - AuthorId int64 `json:"authorId"` // 发布人id | ||
586 | - Author ArticleAuthor `json:"author"` // 发布人 | ||
587 | - CreatedAt int64 `json:"createdAt"` // 文章的发布时间 | ||
588 | - Section []ArticleSection `json:"section"` // 文章的文本内容 | ||
589 | - Images []string `json:"images"` // 图片 | ||
590 | - WhoRead []int64 `json:"whoRead"` // 谁可查看 | ||
591 | - WhoReview []int64 `json:"whoReview"` // 谁可评论 | ||
592 | - Location Location `json:"location"` // 定位坐标 | 593 | + Id int64 `json:"id"` //id |
594 | + Title string `json:"title"` //标题 | ||
595 | + AuthorId int64 `json:"authorId"` //发布人id | ||
596 | + Author ArticleAuthor `json:"author"` //发布人 | ||
597 | + CreatedAt int64 `json:"createdAt"` //文章的发布时间 | ||
598 | + Section []ArticleSection `json:"section"` //文章的文本内容 | ||
599 | + Images []string `json:"images"` //图片 | ||
600 | + WhoRead []int64 `json:"whoRead"` //谁可查看 | ||
601 | + WhoReview []int64 `json:"whoReview"` //谁可评论 | ||
602 | + Location Location `json:"location"` //定位坐标 | ||
593 | CountLove int `json:"countLove"` // 点赞数量 | 603 | CountLove int `json:"countLove"` // 点赞数量 |
594 | CountComment int `json:"countComment"` // 评论数量 | 604 | CountComment int `json:"countComment"` // 评论数量 |
595 | CountRead int `json:"countRead"` // 浏览数量 | 605 | CountRead int `json:"countRead"` // 浏览数量 |
@@ -792,6 +802,35 @@ type MiniArticleMarkItem struct { | @@ -792,6 +802,35 @@ type MiniArticleMarkItem struct { | ||
792 | UpdatedAt int64 `json:"updatedAt"` | 802 | UpdatedAt int64 `json:"updatedAt"` |
793 | } | 803 | } |
794 | 804 | ||
805 | +type MiniArticleSetTagRequest struct { | ||
806 | + CompanyId int64 `json:",optional"` // 公司id | ||
807 | + UserId int64 `json:",optional"` // 公司id | ||
808 | + ArticleId int64 `json:"articleId"` // 文章id | ||
809 | + TagId int64 `json:"tagId"` // 标签id | ||
810 | +} | ||
811 | + | ||
812 | +type MiniArticleSetTagResponse struct { | ||
813 | + Id int64 `json:"id"` | ||
814 | +} | ||
815 | + | ||
816 | +type MiniAllArticleTagRequest struct { | ||
817 | + CompanyId int64 `json:",optional"` // 公司id | ||
818 | + UserId int64 `json:",optional"` // 公司id | ||
819 | + ArticleId int64 `json:"articleId"` // 文章id | ||
820 | + TagId int64 `json:"tagId"` // 标签id | ||
821 | +} | ||
822 | + | ||
823 | +type MiniAllArticleTagResponse struct { | ||
824 | + TagGroup []string `json:"tagGroup"` | ||
825 | + Tags []ArticleTagItem `json:"tags"` | ||
826 | +} | ||
827 | + | ||
828 | +type ArticleTagItem struct { | ||
829 | + Id int64 `json:"id"` | ||
830 | + Group string `json:"group"` | ||
831 | + Name string `json:"name"` | ||
832 | +} | ||
833 | + | ||
795 | type SystemArticleGetRequest struct { | 834 | type SystemArticleGetRequest struct { |
796 | Id int64 `path:"id"` //id | 835 | Id int64 `path:"id"` //id |
797 | CompanyId int64 `path:",optional"` | 836 | CompanyId int64 `path:",optional"` |
-
请 注册 或 登录 后发表评论