正在显示
1 个修改的文件
包含
55 行增加
和
16 行删除
@@ -8,6 +8,30 @@ info( | @@ -8,6 +8,30 @@ info( | ||
8 | version: "v1" | 8 | version: "v1" |
9 | ) | 9 | ) |
10 | 10 | ||
11 | +// 小程序接口 | ||
12 | +@server( | ||
13 | + prefix: v1/mini | ||
14 | + group: article | ||
15 | + jwt: MiniAuth | ||
16 | +) | ||
17 | +service Core { | ||
18 | + @doc "小程序创建发布内容" | ||
19 | + @handler MiniCreateArticle | ||
20 | + post /article (MiniArticleCreateRequest) returns (MiniArticleCreateResponse) | ||
21 | + @doc "小程序获取我发布的文章" | ||
22 | + @handler MiniArticleSearchMe | ||
23 | + post /article/search/me (MiniArticleSearchMeRequest) returns (MiniArticleSearchMeResponse) | ||
24 | + @doc "小程序获取文章内容详情" | ||
25 | + @handler MiniGetArticle | ||
26 | + get /article/:id (MiniArticleGetRequest) returns (MiniArticleGetResponse) | ||
27 | + @doc "小程序获取文章的点赞人员列表" | ||
28 | + @handler MiniUserLikeArticle | ||
29 | + post /article/user_like/list (MiniUserLikeArticleRequest) returns (MiniUserLikeArticleResponse) | ||
30 | + @doc "小程序人员操作点赞文章/评论" | ||
31 | + @handler MiniSetUserLike | ||
32 | + post /article/user_like/set (MiniSetUserLikeRequset) returns (MiniSetUserLikeResponse) | ||
33 | +} | ||
34 | + | ||
11 | // 坐标地点描述 | 35 | // 坐标地点描述 |
12 | type Location { | 36 | type Location { |
13 | Longitude float64 `json:"longitude,optional"` //经度 | 37 | Longitude float64 `json:"longitude,optional"` //经度 |
@@ -96,20 +120,35 @@ type ( | @@ -96,20 +120,35 @@ type ( | ||
96 | } | 120 | } |
97 | ) | 121 | ) |
98 | 122 | ||
99 | -// 小程序接口 | ||
100 | -@server( | ||
101 | - prefix: v1/mini | ||
102 | - group: article | ||
103 | - jwt: MiniAuth | 123 | +//获取列表,文章有哪些人进行了点赞 |
124 | +type ( | ||
125 | + MiniUserLikeArticleRequest { | ||
126 | + ArticleId int64 `json:"articleId"` // 文章id | ||
127 | + CompanyId int64 `json:"-"` //公司id | ||
128 | + Page int `json:"page"` //分页,第几页 | ||
129 | + Size int `json:"size"` //分页,每页几条 | ||
130 | + } | ||
131 | + MiniUserLikeArticleResponse { | ||
132 | + Total int `json:"total"` //总数 | ||
133 | + List []WhichUserLikeArticle `json:"list"` //列表 | ||
134 | + } | ||
135 | + WhichUserLikeArticle { | ||
136 | + ArticleId int64 `json:"articleId"` // 文章id | ||
137 | + UserId int64 `json:"userId"` // 人员id | ||
138 | + Name string `json:"name"` // 人员名称 | ||
139 | + Avatar string `json:"avatar"` // 人员头像 | ||
140 | + CreatedAt int64 `json:"createdAt"` // 点赞记录的时间 | ||
141 | + } | ||
142 | +) | ||
143 | + | ||
144 | +// 人员点赞文章/评论 | ||
145 | +type ( | ||
146 | + MiniSetUserLikeRequset { | ||
147 | + ArticleId int64 `json:"articleId"` //文章id | ||
148 | + CommentId int64 `json:"commentId"` //评论id | ||
149 | + Flag int `json:"flag"` //点赞标志 1、点赞 2 、取消点赞 | ||
150 | + } | ||
151 | + MiniSetUserLikeResponse { | ||
152 | + Id int64 `json:"id"` | ||
153 | + } | ||
104 | ) | 154 | ) |
105 | -service Core { | ||
106 | - @doc "小程序创建发布内容" | ||
107 | - @handler MiniCreateArticle | ||
108 | - post /article (MiniArticleCreateRequest) returns (MiniArticleCreateResponse) | ||
109 | - @doc "小程序获取我发布的文章" | ||
110 | - @handler MiniArticleSearchMe | ||
111 | - post /article/search/me (MiniArticleSearchMeRequest) returns (MiniArticleSearchMeResponse) | ||
112 | - @doc "小程序获取文章内容详情" | ||
113 | - @handler MiniGetArticle | ||
114 | - get /article/:id (MiniArticleGetRequest) returns (MiniArticleGetResponse) | ||
115 | -} |
-
请 注册 或 登录 后发表评论