正在显示
14 个修改的文件
包含
490 行增加
和
17 行删除
@@ -38,12 +38,27 @@ service Core { | @@ -38,12 +38,27 @@ service Core { | ||
38 | 38 | ||
39 | @doc "小程序创建文章进草稿箱" | 39 | @doc "小程序创建文章进草稿箱" |
40 | @handler MiniCreateArticleDraft | 40 | @handler MiniCreateArticleDraft |
41 | - post /article_draft (MiniArticleSearchMeRequest) returns (MiniArticleSearchMeResponse) | 41 | + post /article_draft (MiniArticleDraftCreateRequest) returns (MiniArticleDraftCreateResponse) |
42 | + | ||
43 | + @doc "小程序更新文章草稿" | ||
44 | + @handler MiniUpdateArticleDraft | ||
45 | + put /article_draft (MiniArticleDraftUpdateRequest) returns (MiniArticleDraftUpdateResponse) | ||
46 | + | ||
47 | + @doc "小程序获取我的草稿箱列表" | ||
48 | + @handler MiniSearchArticleDraftMe | ||
49 | + post /article_draft/search/me (MiniArticleDraftSearchMeRequest) returns (MiniArticleDraftSearchMeResponse) | ||
50 | + | ||
51 | + @doc "小程序获取我的草稿内容" | ||
52 | + @handler MiniGetArticleDraftMe | ||
53 | + get /article_draft/me/:id (MiniArticleDraftGetMeRequest) returns (MiniArticleDraftGetMeResponse) | ||
54 | + | ||
55 | + @doc "小程序获取我的草稿内容" | ||
56 | + @handler MiniDeleteArticleDraftMe | ||
57 | + delete /article_draft/me/:id (MiniArticleDraftDeleteMeRequest) returns (MiniArticleDraftDeleteMeResponse) | ||
42 | 58 | ||
43 | @doc "小程序获取文章的编辑记录" | 59 | @doc "小程序获取文章的编辑记录" |
44 | @handler MiniArticleBackupSearch | 60 | @handler MiniArticleBackupSearch |
45 | post /article_backup/search (MiniArticleBackupSearchRequest) returns (MiniArticleBackupSearchResponse) | 61 | post /article_backup/search (MiniArticleBackupSearchRequest) returns (MiniArticleBackupSearchResponse) |
46 | - | ||
47 | } | 62 | } |
48 | 63 | ||
49 | // 管理后台接口 | 64 | // 管理后台接口 |
@@ -160,16 +160,106 @@ type ( | @@ -160,16 +160,106 @@ type ( | ||
160 | } | 160 | } |
161 | ) | 161 | ) |
162 | 162 | ||
163 | -//保存文章到草稿箱 | 163 | +//创建文章到草稿箱 |
164 | type ( | 164 | type ( |
165 | MiniArticleDraftCreateRequest { | 165 | MiniArticleDraftCreateRequest { |
166 | + CompanyId int64 `json:",optional"` | ||
167 | + AuthorId int64 `json:",optional"` // 发布人 | ||
168 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
169 | + Content []string `json:"content"` // 填写的内容 | ||
170 | + Title string `json:"title"` // 标题 | ||
171 | + Images []string `json:"images"` // 图片 | ||
172 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
173 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
174 | + Location Location `json:"location"` // 坐标 | ||
175 | + } | ||
176 | + | ||
177 | + MiniArticleDraftCreateResponse { | ||
178 | + Id int64 `json:"id"` | ||
179 | + } | ||
180 | +) | ||
181 | + | ||
182 | +//更新文章草稿 | ||
183 | +type ( | ||
184 | + MiniArticleDraftUpdateRequest { | ||
185 | + Id int64 `json:"id"` | ||
186 | + CompanyId int64 `json:",optional"` | ||
187 | + AuthorId int64 `json:",optional"` // 发布人 | ||
188 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
189 | + Content []string `json:"content"` // 填写的内容 | ||
190 | + Title string `json:"title"` // 标题 | ||
191 | + Images []string `json:"images"` // 图片 | ||
192 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
193 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
194 | + Location Location `json:"location"` // 坐标 | ||
195 | + } | ||
196 | + | ||
197 | + MiniArticleDraftUpdateResponse { | ||
198 | + Id int64 `json:"id"` | ||
199 | + } | ||
200 | +) | ||
201 | + | ||
202 | +//获取我的草稿列表 | ||
203 | +type ( | ||
204 | + MiniArticleDraftSearchMeRequest { | ||
205 | + CompanyId int64 `json:",optional"` // 公司id | ||
206 | + AuthorId int64 `json:",optional"` // 发布人 | ||
207 | + Page int `json:"page"` | ||
208 | + Size int `json:"size"` | ||
209 | + } | ||
210 | + | ||
211 | + MiniArticleDraftSearchMeResponse { | ||
212 | + Total int64 `json:"total"` | ||
213 | + List []MiniArticleDraftItem `json:"list"` | ||
214 | + } | ||
215 | + MiniArticleDraftItem { | ||
216 | + Id int64 `json:"id"` | ||
166 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | 217 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 |
167 | Content []string `json:"content"` // 填写的内容 | 218 | Content []string `json:"content"` // 填写的内容 |
168 | - Title string `json:"title"` //标题 | ||
169 | - Images []string `json:"images"` //图片 | 219 | + Title string `json:"title"` // 标题 |
220 | + Images []string `json:"images"` // 图片 | ||
221 | + } | ||
222 | +) | ||
223 | + | ||
224 | +//获取我的草稿内容 | ||
225 | +type ( | ||
226 | + MiniArticleDraftGetMeRequest { | ||
227 | + CompanyId int64 `json:",optional"` // 公司id | ||
228 | + AuthorId int64 `json:",optional"` // 发布人 | ||
229 | + Page int `json:"page"` | ||
230 | + Size int `json:"size"` | ||
231 | + } | ||
232 | + | ||
233 | + MiniArticleDraftGetMeResponse { | ||
234 | + Id int64 `json:"id"` // | ||
235 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
236 | + Content []string `json:"content"` // 填写的内容 | ||
237 | + Title string `json:"title"` // 标题 | ||
238 | + Images []string `json:"images"` // 图片 | ||
239 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
240 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
241 | + Location Location `json:"location"` // 坐标 | ||
242 | + } | ||
243 | +) | ||
244 | + | ||
245 | +//删除我的草稿内容 | ||
246 | +type ( | ||
247 | + MiniArticleDraftDeleteMeRequest { | ||
248 | + CompanyId int64 `path:",optional"` // 公司id | ||
249 | + AuthorId int64 `path:",optional"` // 发布人 | ||
250 | + Id int64 `path:"id"` | ||
170 | } | 251 | } |
171 | 252 | ||
172 | - MiniArticleDraftCreateResponse struct{} | 253 | + MiniArticleDraftDeleteMeResponse { |
254 | + Id int64 `json:"id"` // | ||
255 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
256 | + Content []string `json:"content"` // 填写的内容 | ||
257 | + Title string `json:"title"` // 标题 | ||
258 | + Images []string `json:"images"` // 图片 | ||
259 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
260 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
261 | + Location Location `json:"location"` // 坐标 | ||
262 | + } | ||
173 | ) | 263 | ) |
174 | 264 | ||
175 | //管理后台获取文章详情 | 265 | //管理后台获取文章详情 |
@@ -7,22 +7,23 @@ import ( | @@ -7,22 +7,23 @@ import ( | ||
7 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/article" | 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" | 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" | 9 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" |
10 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata" | ||
11 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | ||
10 | ) | 12 | ) |
11 | 13 | ||
12 | func MiniCreateArticleDraftHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | 14 | func MiniCreateArticleDraftHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { |
13 | return func(w http.ResponseWriter, r *http.Request) { | 15 | return func(w http.ResponseWriter, r *http.Request) { |
14 | - var req types.MiniArticleSearchMeRequest | 16 | + var req types.MiniArticleDraftCreateRequest |
15 | if err := httpx.Parse(r, &req); err != nil { | 17 | if err := httpx.Parse(r, &req); err != nil { |
16 | httpx.ErrorCtx(r.Context(), w, err) | 18 | httpx.ErrorCtx(r.Context(), w, err) |
17 | return | 19 | return |
18 | } | 20 | } |
19 | 21 | ||
20 | l := article.NewMiniCreateArticleDraftLogic(r.Context(), svcCtx) | 22 | l := article.NewMiniCreateArticleDraftLogic(r.Context(), svcCtx) |
23 | + token := contextdata.GetUserTokenFromCtx(r.Context()) | ||
24 | + req.AuthorId = token.UserId | ||
25 | + req.CompanyId = token.CompanyId | ||
21 | resp, err := l.MiniCreateArticleDraft(&req) | 26 | resp, err := l.MiniCreateArticleDraft(&req) |
22 | - if err != nil { | ||
23 | - httpx.ErrorCtx(r.Context(), w, err) | ||
24 | - } else { | ||
25 | - httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | - } | 27 | + result.HttpResult(r, w, resp, err) |
27 | } | 28 | } |
28 | } | 29 | } |
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 MiniDeleteArticleDraftMeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
14 | + var req types.MiniArticleDraftDeleteMeRequest | ||
15 | + if err := httpx.Parse(r, &req); err != nil { | ||
16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + l := article.NewMiniDeleteArticleDraftMeLogic(r.Context(), svcCtx) | ||
21 | + resp, err := l.MiniDeleteArticleDraftMe(&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 MiniGetArticleDraftMeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
14 | + var req types.MiniArticleDraftGetMeRequest | ||
15 | + if err := httpx.Parse(r, &req); err != nil { | ||
16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + l := article.NewMiniGetArticleDraftMeLogic(r.Context(), svcCtx) | ||
21 | + resp, err := l.MiniGetArticleDraftMe(&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 MiniSearchArticleDraftMeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
14 | + var req types.MiniArticleDraftSearchMeRequest | ||
15 | + if err := httpx.Parse(r, &req); err != nil { | ||
16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + l := article.NewMiniSearchArticleDraftMeLogic(r.Context(), svcCtx) | ||
21 | + resp, err := l.MiniSearchArticleDraftMe(&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 MiniUpdateArticleDraftHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
14 | + var req types.MiniArticleDraftUpdateRequest | ||
15 | + if err := httpx.Parse(r, &req); err != nil { | ||
16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
17 | + return | ||
18 | + } | ||
19 | + | ||
20 | + l := article.NewMiniUpdateArticleDraftLogic(r.Context(), svcCtx) | ||
21 | + resp, err := l.MiniUpdateArticleDraft(&req) | ||
22 | + if err != nil { | ||
23 | + httpx.ErrorCtx(r.Context(), w, err) | ||
24 | + } else { | ||
25 | + httpx.OkJsonCtx(r.Context(), w, resp) | ||
26 | + } | ||
27 | + } | ||
28 | +} |
@@ -224,6 +224,26 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -224,6 +224,26 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
224 | Handler: article.MiniCreateArticleDraftHandler(serverCtx), | 224 | Handler: article.MiniCreateArticleDraftHandler(serverCtx), |
225 | }, | 225 | }, |
226 | { | 226 | { |
227 | + Method: http.MethodPut, | ||
228 | + Path: "/article_draft", | ||
229 | + Handler: article.MiniUpdateArticleDraftHandler(serverCtx), | ||
230 | + }, | ||
231 | + { | ||
232 | + Method: http.MethodPost, | ||
233 | + Path: "/article_draft/search/me", | ||
234 | + Handler: article.MiniSearchArticleDraftMeHandler(serverCtx), | ||
235 | + }, | ||
236 | + { | ||
237 | + Method: http.MethodGet, | ||
238 | + Path: "/article_draft/me/:id", | ||
239 | + Handler: article.MiniGetArticleDraftMeHandler(serverCtx), | ||
240 | + }, | ||
241 | + { | ||
242 | + Method: http.MethodDelete, | ||
243 | + Path: "/article_draft/me/:id", | ||
244 | + Handler: article.MiniDeleteArticleDraftMeHandler(serverCtx), | ||
245 | + }, | ||
246 | + { | ||
227 | Method: http.MethodPost, | 247 | Method: http.MethodPost, |
228 | Path: "/article_backup/search", | 248 | Path: "/article_backup/search", |
229 | Handler: article.MiniArticleBackupSearchHandler(serverCtx), | 249 | Handler: article.MiniArticleBackupSearchHandler(serverCtx), |
@@ -5,6 +5,8 @@ import ( | @@ -5,6 +5,8 @@ import ( | ||
5 | 5 | ||
6 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | 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" | 7 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" |
8 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain" | ||
9 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr" | ||
8 | 10 | ||
9 | "github.com/zeromicro/go-zero/core/logx" | 11 | "github.com/zeromicro/go-zero/core/logx" |
10 | ) | 12 | ) |
@@ -23,8 +25,43 @@ func NewMiniCreateArticleDraftLogic(ctx context.Context, svcCtx *svc.ServiceCont | @@ -23,8 +25,43 @@ func NewMiniCreateArticleDraftLogic(ctx context.Context, svcCtx *svc.ServiceCont | ||
23 | } | 25 | } |
24 | } | 26 | } |
25 | 27 | ||
26 | -func (l *MiniCreateArticleDraftLogic) MiniCreateArticleDraft(req *types.MiniArticleSearchMeRequest) (resp *types.MiniArticleSearchMeResponse, err error) { | ||
27 | - // todo: add your logic here and delete this line | 28 | +// 保存文章进草稿箱 |
29 | +func (l *MiniCreateArticleDraftLogic) MiniCreateArticleDraft(req *types.MiniArticleDraftCreateRequest) (resp *types.MiniArticleDraftCreateResponse, err error) { | ||
30 | + var conn = l.svcCtx.DefaultDBConn() | ||
28 | 31 | ||
32 | + newDraft := domain.ArticleDraft{ | ||
33 | + Id: 0, | ||
34 | + CompanyId: req.CompanyId, | ||
35 | + CreatedAt: 0, | ||
36 | + UpdatedAt: 0, | ||
37 | + DeletedAt: 0, | ||
38 | + Version: 0, | ||
39 | + Template: req.Template, | ||
40 | + Content: req.Content, | ||
41 | + AuthorId: req.AuthorId, | ||
42 | + Title: req.Title, | ||
43 | + Images: []domain.Image{}, | ||
44 | + WhoRead: req.WhoRead, | ||
45 | + WhoReview: req.WhoReview, | ||
46 | + Location: domain.Location{ | ||
47 | + Longitude: req.Location.Longitude, | ||
48 | + Latitude: req.Location.Latitude, | ||
49 | + Descript: req.Location.Descript, | ||
50 | + }, | ||
51 | + } | ||
52 | + for _, val := range req.Images { | ||
53 | + newDraft.Images = append(newDraft.Images, domain.Image{ | ||
54 | + Url: val, | ||
55 | + }) | ||
56 | + } | ||
57 | + | ||
58 | + _, err = l.svcCtx.ArticleDraftRepository.Insert(l.ctx, conn, &newDraft) | ||
59 | + if err != nil { | ||
60 | + return nil, xerr.NewErrMsgErr("保存草稿失败", err) | ||
61 | + } | ||
62 | + | ||
63 | + resp = &types.MiniArticleDraftCreateResponse{ | ||
64 | + Id: newDraft.Id, | ||
65 | + } | ||
29 | return | 66 | return |
30 | } | 67 | } |
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 MiniDeleteArticleDraftMeLogic struct { | ||
13 | + logx.Logger | ||
14 | + ctx context.Context | ||
15 | + svcCtx *svc.ServiceContext | ||
16 | +} | ||
17 | + | ||
18 | +func NewMiniDeleteArticleDraftMeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniDeleteArticleDraftMeLogic { | ||
19 | + return &MiniDeleteArticleDraftMeLogic{ | ||
20 | + Logger: logx.WithContext(ctx), | ||
21 | + ctx: ctx, | ||
22 | + svcCtx: svcCtx, | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +func (l *MiniDeleteArticleDraftMeLogic) MiniDeleteArticleDraftMe(req *types.MiniArticleDraftDeleteMeRequest) (resp *types.MiniArticleDraftDeleteMeResponse, 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 MiniGetArticleDraftMeLogic struct { | ||
13 | + logx.Logger | ||
14 | + ctx context.Context | ||
15 | + svcCtx *svc.ServiceContext | ||
16 | +} | ||
17 | + | ||
18 | +func NewMiniGetArticleDraftMeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniGetArticleDraftMeLogic { | ||
19 | + return &MiniGetArticleDraftMeLogic{ | ||
20 | + Logger: logx.WithContext(ctx), | ||
21 | + ctx: ctx, | ||
22 | + svcCtx: svcCtx, | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +func (l *MiniGetArticleDraftMeLogic) MiniGetArticleDraftMe(req *types.MiniArticleDraftGetMeRequest) (resp *types.MiniArticleDraftGetMeResponse, 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 MiniSearchArticleDraftMeLogic struct { | ||
13 | + logx.Logger | ||
14 | + ctx context.Context | ||
15 | + svcCtx *svc.ServiceContext | ||
16 | +} | ||
17 | + | ||
18 | +func NewMiniSearchArticleDraftMeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniSearchArticleDraftMeLogic { | ||
19 | + return &MiniSearchArticleDraftMeLogic{ | ||
20 | + Logger: logx.WithContext(ctx), | ||
21 | + ctx: ctx, | ||
22 | + svcCtx: svcCtx, | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +func (l *MiniSearchArticleDraftMeLogic) MiniSearchArticleDraftMe(req *types.MiniArticleDraftSearchMeRequest) (resp *types.MiniArticleDraftSearchMeResponse, 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 MiniUpdateArticleDraftLogic struct { | ||
13 | + logx.Logger | ||
14 | + ctx context.Context | ||
15 | + svcCtx *svc.ServiceContext | ||
16 | +} | ||
17 | + | ||
18 | +func NewMiniUpdateArticleDraftLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniUpdateArticleDraftLogic { | ||
19 | + return &MiniUpdateArticleDraftLogic{ | ||
20 | + Logger: logx.WithContext(ctx), | ||
21 | + ctx: ctx, | ||
22 | + svcCtx: svcCtx, | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +func (l *MiniUpdateArticleDraftLogic) MiniUpdateArticleDraft(req *types.MiniArticleDraftUpdateRequest) (resp *types.MiniArticleDraftUpdateResponse, err error) { | ||
27 | + // todo: add your logic here and delete this line | ||
28 | + | ||
29 | + return | ||
30 | +} |
@@ -147,13 +147,91 @@ type MiniArticleMarkUserReadResponse struct { | @@ -147,13 +147,91 @@ type MiniArticleMarkUserReadResponse struct { | ||
147 | } | 147 | } |
148 | 148 | ||
149 | type MiniArticleDraftCreateRequest struct { | 149 | type MiniArticleDraftCreateRequest struct { |
150 | + CompanyId int64 `json:",optional"` | ||
151 | + AuthorId int64 `json:",optional"` // 发布人 | ||
152 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
153 | + Content []string `json:"content"` // 填写的内容 | ||
154 | + Title string `json:"title"` // 标题 | ||
155 | + Images []string `json:"images"` // 图片 | ||
156 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
157 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
158 | + Location Location `json:"location"` // 坐标 | ||
159 | +} | ||
160 | + | ||
161 | +type MiniArticleDraftCreateResponse struct { | ||
162 | + Id int64 `json:"id"` | ||
163 | +} | ||
164 | + | ||
165 | +type MiniArticleDraftUpdateRequest struct { | ||
166 | + Id int64 `json:"id"` | ||
167 | + CompanyId int64 `json:",optional"` | ||
168 | + AuthorId int64 `json:",optional"` // 发布人 | ||
169 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
170 | + Content []string `json:"content"` // 填写的内容 | ||
171 | + Title string `json:"title"` // 标题 | ||
172 | + Images []string `json:"images"` // 图片 | ||
173 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
174 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
175 | + Location Location `json:"location"` // 坐标 | ||
176 | +} | ||
177 | + | ||
178 | +type MiniArticleDraftUpdateResponse struct { | ||
179 | + Id int64 `json:"id"` | ||
180 | +} | ||
181 | + | ||
182 | +type MiniArticleDraftSearchMeRequest struct { | ||
183 | + CompanyId int64 `json:",optional"` // 公司id | ||
184 | + AuthorId int64 `json:",optional"` // 发布人 | ||
185 | + Page int `json:"page"` | ||
186 | + Size int `json:"size"` | ||
187 | +} | ||
188 | + | ||
189 | +type MiniArticleDraftSearchMeResponse struct { | ||
190 | + Total int64 `json:"total"` | ||
191 | + List []MiniArticleDraftItem `json:"list"` | ||
192 | +} | ||
193 | + | ||
194 | +type MiniArticleDraftItem struct { | ||
195 | + Id int64 `json:"id"` | ||
150 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | 196 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 |
151 | Content []string `json:"content"` // 填写的内容 | 197 | Content []string `json:"content"` // 填写的内容 |
152 | - Title string `json:"title"` //标题 | ||
153 | - Images []string `json:"images"` //图片 | 198 | + Title string `json:"title"` // 标题 |
199 | + Images []string `json:"images"` // 图片 | ||
154 | } | 200 | } |
155 | 201 | ||
156 | -type MiniArticleDraftCreateResponse struct { | 202 | +type MiniArticleDraftGetMeRequest struct { |
203 | + CompanyId int64 `json:",optional"` // 公司id | ||
204 | + AuthorId int64 `json:",optional"` // 发布人 | ||
205 | + Page int `json:"page"` | ||
206 | + Size int `json:"size"` | ||
207 | +} | ||
208 | + | ||
209 | +type MiniArticleDraftGetMeResponse struct { | ||
210 | + Id int64 `json:"id"` // | ||
211 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
212 | + Content []string `json:"content"` // 填写的内容 | ||
213 | + Title string `json:"title"` // 标题 | ||
214 | + Images []string `json:"images"` // 图片 | ||
215 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
216 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
217 | + Location Location `json:"location"` // 坐标 | ||
218 | +} | ||
219 | + | ||
220 | +type MiniArticleDraftDeleteMeRequest struct { | ||
221 | + CompanyId int64 `path:",optional"` // 公司id | ||
222 | + AuthorId int64 `path:",optional"` // 发布人 | ||
223 | + Id int64 `path:"id"` | ||
224 | +} | ||
225 | + | ||
226 | +type MiniArticleDraftDeleteMeResponse struct { | ||
227 | + Id int64 `json:"id"` // | ||
228 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
229 | + Content []string `json:"content"` // 填写的内容 | ||
230 | + Title string `json:"title"` // 标题 | ||
231 | + Images []string `json:"images"` // 图片 | ||
232 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
233 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
234 | + Location Location `json:"location"` // 坐标 | ||
157 | } | 235 | } |
158 | 236 | ||
159 | type SystemArticleGetRequest struct { | 237 | type SystemArticleGetRequest struct { |
-
请 注册 或 登录 后发表评论