作者 yangfu
正在显示 41 个修改的文件 包含 475 行增加303 行删除
@@ -49,6 +49,7 @@ type ( @@ -49,6 +49,7 @@ type (
49 Category string `json:"category"` // 标签分类 49 Category string `json:"category"` // 标签分类
50 Remark string `json:"remark,optional"` // 备注 50 Remark string `json:"remark,optional"` // 备注
51 Other string `json:"other,optional"` 51 Other string `json:"other,optional"`
  52 + SortBy int `json:"sortBy,optional"` //排序
52 } 53 }
53 54
54 TagCreateResponse { 55 TagCreateResponse {
@@ -66,6 +67,7 @@ type ( @@ -66,6 +67,7 @@ type (
66 Category string `json:"category"` // 标签分类 67 Category string `json:"category"` // 标签分类
67 Remark string `json:"remark,optional"` // 备注 68 Remark string `json:"remark,optional"` // 备注
68 Other string `json:"other,optional"` 69 Other string `json:"other,optional"`
  70 + SortBy int `json:"sortBy,optional"` // 排序
69 } 71 }
70 72
71 TagEditResponse { 73 TagEditResponse {
@@ -86,6 +88,7 @@ type ( @@ -86,6 +88,7 @@ type (
86 Category string `json:"category"` // 标签分类 88 Category string `json:"category"` // 标签分类
87 Remark string `json:"remark"` // 备注 89 Remark string `json:"remark"` // 备注
88 Other string `json:"other"` 90 Other string `json:"other"`
  91 + SortBy int `json:"sortBy,optional"` // 排序
89 } 92 }
90 ) 93 )
91 94
@@ -110,6 +113,7 @@ type ( @@ -110,6 +113,7 @@ type (
110 Category string `json:"category"` // 标签分类 113 Category string `json:"category"` // 标签分类
111 Remark string `json:"remark"` // 备注 114 Remark string `json:"remark"` // 备注
112 CreatedAt int64 `json:"createdAt"` 115 CreatedAt int64 `json:"createdAt"`
  116 + SortBy int `json:"sortBy,optional"` // 排序
113 } 117 }
114 ) 118 )
115 119
@@ -19,13 +19,14 @@ type ArticleAuthor { @@ -19,13 +19,14 @@ type ArticleAuthor {
19 //小程序端创建发布文章 19 //小程序端创建发布文章
20 type ( 20 type (
21 MiniArticleCreateRequest { 21 MiniArticleCreateRequest {
22 - Title string `json:"title"` //标题  
23 - Section []string `json:"section"` //文章的文本内容  
24 - AuthorId int64 `json:"authorId,optional"` //发布人id  
25 - Images []string `json:"images,optional"` //图片  
26 - WhoRead []int64 `json:"whoRead,optional"` //谁可查看  
27 - WhoReview []int64 `json:"whoReview,optional"` //谁可评论  
28 - Location Location `json:"location,optional"` //定位坐标 22 + Title string `json:"title"` //标题
  23 + Section []string `json:"section"` //文章的文本内容
  24 + AuthorId int64 `json:"authorId,optional"` //发布人id
  25 + Images []string `json:"images,optional"` //图片
  26 + WhoRead []int64 `json:"whoRead,optional"` //谁可查看
  27 + WhoReview []int64 `json:"whoReview,optional"` //谁可评论
  28 + Location Location `json:"location,optional"` //定位坐标
  29 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
29 } 30 }
30 MiniArticleCreateResponse { 31 MiniArticleCreateResponse {
31 Id int64 `json:"id"` 32 Id int64 `json:"id"`
@@ -40,24 +41,25 @@ type ( @@ -40,24 +41,25 @@ type (
40 UserId int `path:",optional"` //当前用户 41 UserId int `path:",optional"` //当前用户
41 } 42 }
42 MiniArticleGetResponse { 43 MiniArticleGetResponse {
43 - Id int64 `json:"id"` //id  
44 - Title string `json:"title"` //标题  
45 - AuthorId int64 `json:"authorId"` //发布人id  
46 - Author ArticleAuthor `json:"author"` //发布人  
47 - CreatedAt int64 `json:"createdAt"` //文章的发布时间  
48 - Section []ArticleSection `json:"section"` //文章的文本内容  
49 - Images []string `json:"images"` //图片  
50 - WhoRead []int64 `json:"whoRead"` //谁可查看  
51 - WhoReview []int64 `json:"whoReview"` //谁可评论  
52 - Location Location `json:"location"` //定位坐标  
53 - CountLove int `json:"countLove"` // 点赞数量  
54 - CountComment int `json:"countComment"` // 评论数量  
55 - CountRead int `json:"countRead"` // 浏览数量  
56 - Show int `json:"show"` // 评论的展示状态(1显示、2不显示)  
57 - Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)  
58 - MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)  
59 - MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)  
60 - Tags []string `json:"tags"` // 文章的标签 44 + Id int64 `json:"id"` //id
  45 + Title string `json:"title"` //标题
  46 + AuthorId int64 `json:"authorId"` //发布人id
  47 + Author ArticleAuthor `json:"author"` //发布人
  48 + CreatedAt int64 `json:"createdAt"` //文章的发布时间
  49 + Section []ArticleSection `json:"section"` //文章的文本内容
  50 + Images []string `json:"images"` //图片
  51 + WhoRead []int64 `json:"whoRead"` //谁可查看
  52 + WhoReview []int64 `json:"whoReview"` //谁可评论
  53 + Location Location `json:"location"` //定位坐标
  54 + CountLove int `json:"countLove"` // 点赞数量
  55 + CountComment int `json:"countComment"` // 评论数量
  56 + CountRead int `json:"countRead"` // 浏览数量
  57 + Show int `json:"show"` // 评论的展示状态(1显示、2不显示)
  58 + Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)
  59 + MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)
  60 + MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)
  61 + Tags []string `json:"tags"` // 文章的标签
  62 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
61 } 63 }
62 ArticleSection { 64 ArticleSection {
63 Id int64 `json:"id"` //段落id 65 Id int64 `json:"id"` //段落id
@@ -189,6 +191,7 @@ type ( @@ -189,6 +191,7 @@ type (
189 WhoRead []int64 `json:"whoRead"` // 谁可以看 191 WhoRead []int64 `json:"whoRead"` // 谁可以看
190 WhoReview []int64 `json:"whoReview"` // 评论人 192 WhoReview []int64 `json:"whoReview"` // 评论人
191 Location Location `json:"location"` // 坐标 193 Location Location `json:"location"` // 坐标
  194 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
192 } 195 }
193 196
194 MiniArticleDraftCreateResponse { 197 MiniArticleDraftCreateResponse {
@@ -209,6 +212,7 @@ type ( @@ -209,6 +212,7 @@ type (
209 WhoRead []int64 `json:"whoRead"` // 谁可以看 212 WhoRead []int64 `json:"whoRead"` // 谁可以看
210 WhoReview []int64 `json:"whoReview"` // 评论人 213 WhoReview []int64 `json:"whoReview"` // 评论人
211 Location Location `json:"location"` // 坐标 214 Location Location `json:"location"` // 坐标
  215 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
212 } 216 }
213 217
214 MiniArticleDraftUpdateResponse { 218 MiniArticleDraftUpdateResponse {
@@ -230,12 +234,13 @@ type ( @@ -230,12 +234,13 @@ type (
230 List []MiniArticleDraftItem `json:"list"` 234 List []MiniArticleDraftItem `json:"list"`
231 } 235 }
232 MiniArticleDraftItem { 236 MiniArticleDraftItem {
233 - Id int64 `json:"id"`  
234 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
235 - Section []string `json:"section"` // 填写的内容  
236 - Title string `json:"title"` // 标题  
237 - Images []string `json:"images"` // 图片  
238 - CreatedAt int64 `json:"createdAt"` 237 + Id int64 `json:"id"`
  238 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  239 + Section []string `json:"section"` // 填写的内容
  240 + Title string `json:"title"` // 标题
  241 + Images []string `json:"images"` // 图片
  242 + CreatedAt int64 `json:"createdAt"`//
  243 + MatchUrl map[string]string `json:"matchUrl"` //匹配内容中的url文本
239 } 244 }
240 ) 245 )
241 246
@@ -248,14 +253,15 @@ type ( @@ -248,14 +253,15 @@ type (
248 } 253 }
249 254
250 MiniArticleDraftGetMeResponse { 255 MiniArticleDraftGetMeResponse {
251 - Id int64 `json:"id"` //  
252 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
253 - Section []string `json:"section"` // 填写的内容  
254 - Title string `json:"title"` // 标题  
255 - Images []string `json:"images"` // 图片  
256 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
257 - WhoReview []int64 `json:"whoReview"` // 评论人  
258 - Location Location `json:"location"` // 坐标 256 + Id int64 `json:"id"` //
  257 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  258 + Section []string `json:"section"` // 填写的内容
  259 + Title string `json:"title"` // 标题
  260 + Images []string `json:"images"` // 图片
  261 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  262 + WhoReview []int64 `json:"whoReview"` // 评论人
  263 + Location Location `json:"location"` // 坐标
  264 + MatchUrl map[string]string `json:"matchUrl"` //
259 } 265 }
260 ) 266 )
261 267
@@ -317,7 +323,7 @@ type ( @@ -317,7 +323,7 @@ type (
317 TagGroup []ArticleTagGroup `json:"tagGroup"` 323 TagGroup []ArticleTagGroup `json:"tagGroup"`
318 } 324 }
319 ArticleTagGroup { 325 ArticleTagGroup {
320 - Category string `json:"category"` 326 + Category string `json:"category"`
321 Tags []ArticleTagItem `json:"tags"` 327 Tags []ArticleTagItem `json:"tags"`
322 } 328 }
323 ArticleTagItem { 329 ArticleTagItem {
@@ -325,6 +331,7 @@ type ( @@ -325,6 +331,7 @@ type (
325 Category string `json:"category"` 331 Category string `json:"category"`
326 Name string `json:"name"` 332 Name string `json:"name"`
327 Image string `json:"image"` 333 Image string `json:"image"`
  334 + SortBy int `json:"sortBy"`
328 } 335 }
329 ) 336 )
330 337
@@ -489,13 +496,14 @@ type ( @@ -489,13 +496,14 @@ type (
489 Tags []ArticleTagCount `json:"tags"` 496 Tags []ArticleTagCount `json:"tags"`
490 } 497 }
491 ArticleTagCount { 498 ArticleTagCount {
492 - TagCategory string `json:"tagCategory"` // 标签分组 499 + TagCategory string `json:"tagCategory"` // 标签分组
493 TagId int64 `json:"tagId"` // 标签id 500 TagId int64 `json:"tagId"` // 标签id
494 TagImage string `json:"tagImage"` // 对应的图标 501 TagImage string `json:"tagImage"` // 对应的图标
495 TagName string `json:"tagName"` // 标签名称 502 TagName string `json:"tagName"` // 标签名称
496 TagRemark string `json:"tagRemark"` // 标签备注 503 TagRemark string `json:"tagRemark"` // 标签备注
497 TotalArticle int `json:"totalArticle"` // 总的文章数量 504 TotalArticle int `json:"totalArticle"` // 总的文章数量
498 ReadArticle int `json:"readArticle"` // 已读的标签数量 505 ReadArticle int `json:"readArticle"` // 已读的标签数量
  506 + SortBy int `json:"sortBy"` // 排序
499 } 507 }
500 ) 508 )
501 509
@@ -86,13 +86,14 @@ type CommentAuthor { @@ -86,13 +86,14 @@ type CommentAuthor {
86 // 小程序填写文章的评论 86 // 小程序填写文章的评论
87 type ( 87 type (
88 MiniCreateArticleCommentRequest { 88 MiniCreateArticleCommentRequest {
89 - ArtitcleId int64 `json:"articleId"` // 文章id  
90 - SectionId int64 `json:"sectionId"` // 段落id  
91 - FromUserId int64 `json:",optional"` // 填写文章的人,服务端自动获取  
92 - CompanyId int64 `json:",optional"` // 服务端自动获取  
93 - Pid int64 `json:"pid"` // 回复那个评论的id  
94 - Content string `json:"content"` // 评论的内容  
95 - AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人 89 + ArtitcleId int64 `json:"articleId"` // 文章id
  90 + SectionId int64 `json:"sectionId"` // 段落id
  91 + FromUserId int64 `json:",optional"` // 填写文章的人,服务端自动获取
  92 + CompanyId int64 `json:",optional"` // 服务端自动获取
  93 + Pid int64 `json:"pid,optional"` // 回复那个评论的id
  94 + Content string `json:"content"` // 评论的内容
  95 + AtWho []CommentAtWho `json:"atWho,optional"` // 填写评论时@的人
  96 + MatchUrl map[string]string `json:"matchUrl,optional"` // 评论内容中的url文本
96 } 97 }
97 98
98 CommentAtWho { 99 CommentAtWho {
@@ -101,21 +102,22 @@ type ( @@ -101,21 +102,22 @@ type (
101 FirstLetter string `json:"firstLetter,optional"` 102 FirstLetter string `json:"firstLetter,optional"`
102 } 103 }
103 MiniCreateArticleCommentResponse { 104 MiniCreateArticleCommentResponse {
104 - Id int64 `json:"id"`  
105 - Pid int64 `json:"pid"`  
106 - TopId int64 `json:"topId"`  
107 - ArtitcleId int64 `json:"articleId"` // 文章id  
108 - SectionId int64 `json:"sectionId"` // 段落id  
109 - FromUserId int64 `json:"fromUserId"` // 填写评论的人  
110 - FromUser CommentAuthor `json:"fromUser"` // 填写评论的人  
111 - ToUserId int64 `json:"toUserId"` // 回复哪个人  
112 - ToUser CommentAuthor `json:"toUser"` // 回复哪个人  
113 - SectionContent string `json:"sectionContent"` // 引用的文章内容文本  
114 - CountReply int `json:"countReply"` // 回复数量  
115 - CountUserLove int `json:"countUserLove"` // 用户点赞数量  
116 - CountAdminLove int `json:"countAdminLove"` // 运营点赞数量  
117 - AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人  
118 - CreatedAt int64 `json:"createdAt"` // 105 + Id int64 `json:"id"`
  106 + Pid int64 `json:"pid"`
  107 + TopId int64 `json:"topId"`
  108 + ArtitcleId int64 `json:"articleId"` // 文章id
  109 + SectionId int64 `json:"sectionId"` // 段落id
  110 + FromUserId int64 `json:"fromUserId"` // 填写评论的人
  111 + FromUser CommentAuthor `json:"fromUser"` // 填写评论的人
  112 + ToUserId int64 `json:"toUserId"` // 回复哪个人
  113 + ToUser CommentAuthor `json:"toUser"` // 回复哪个人
  114 + SectionContent string `json:"sectionContent"` // 引用的文章内容文本
  115 + CountReply int `json:"countReply"` // 回复数量
  116 + CountUserLove int `json:"countUserLove"` // 用户点赞数量
  117 + CountAdminLove int `json:"countAdminLove"` // 运营点赞数量
  118 + AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人
  119 + MatchUrl map[string]string `json:"matchUrl"` // 评论内容中的url文本
  120 + CreatedAt int64 `json:"createdAt"` //
119 } 121 }
120 ) 122 )
121 123
@@ -141,23 +143,24 @@ type ( @@ -141,23 +143,24 @@ type (
141 } 143 }
142 144
143 ArticleCommentItem { 145 ArticleCommentItem {
144 - Id int64 `json:"id"`  
145 - Pid int64 `json:"pid"`  
146 - TopId int64 `json:"topId"`  
147 - ArtitcleId int64 `json:"articleId"` // 文章id  
148 - SectionId int64 `json:"sectionId"` // 段落id  
149 - FromUserId int64 `json:"fromUserId"` // 填写评论的人  
150 - FromUser CommentAuthor `json:"fromUser"` // 填写评论的人  
151 - ToUserId int64 `json:"toUserId"` // 回复哪个人  
152 - ToUser CommentAuthor `json:"toUser"` // 回复哪个人  
153 - SectionContent string `json:"sectionContent"` // 引用的文章内容文本  
154 - CountReply int `json:"countReply"` // 回复数量  
155 - CountUserLove int `json:"countUserLove"` // 用户点赞数量  
156 - CountAdminLove int `json:"countAdminLove"` // 运营点赞数量  
157 - AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人  
158 - CreatedAt int64 `json:"createdAt"` //  
159 - MeLoveFlag int `json:"meLoveFlag"` //当前人员对评论的点赞标识 (0 没有点赞 1有点赞)  
160 - Content string `json:"content"` // 评论的内容 146 + Id int64 `json:"id"`
  147 + Pid int64 `json:"pid"`
  148 + TopId int64 `json:"topId"`
  149 + ArtitcleId int64 `json:"articleId"` // 文章id
  150 + SectionId int64 `json:"sectionId"` // 段落id
  151 + FromUserId int64 `json:"fromUserId"` // 填写评论的人
  152 + FromUser CommentAuthor `json:"fromUser"` // 填写评论的人
  153 + ToUserId int64 `json:"toUserId"` // 回复哪个人
  154 + ToUser CommentAuthor `json:"toUser"` // 回复哪个人
  155 + SectionContent string `json:"sectionContent"` // 引用的文章内容文本
  156 + CountReply int `json:"countReply"` // 回复数量
  157 + CountUserLove int `json:"countUserLove"` // 用户点赞数量
  158 + CountAdminLove int `json:"countAdminLove"` // 运营点赞数量
  159 + AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人
  160 + MatchUrl map[string]string `json:"matchUrl"` // 评论内容中的url文本
  161 + CreatedAt int64 `json:"createdAt"` //
  162 + MeLoveFlag int `json:"meLoveFlag"` //当前人员对评论的点赞标识 (0 没有点赞 1有点赞)
  163 + Content string `json:"content"` // 评论的内容
161 } 164 }
162 ) 165 )
163 166
@@ -241,19 +244,21 @@ type ( @@ -241,19 +244,21 @@ type (
241 List []SystemArticleCommentSearchItem `json:"list"` 244 List []SystemArticleCommentSearchItem `json:"list"`
242 } 245 }
243 SystemArticleCommentSearchItem { 246 SystemArticleCommentSearchItem {
244 - Id int64 `json:"id"`  
245 - Pid int64 `json:"pid"`  
246 - TopId int64 `json:"topId"`  
247 - ArtitcleId int64 `json:"articleId"` // 文章id  
248 - SectionId int64 `json:"sectionId"` // 段落id  
249 - FromUserId int64 `json:"fromUserId"` // 填写评论的人  
250 - FromUser CommentAuthor `json:"fromUser"` // 填写评论的人  
251 - CountReply int `json:"countReply"` // 回复数量  
252 - CountUserLove int `json:"countUserLove"` // 用户点赞数量  
253 - CountAdminLove int `json:"countAdminLove"` // 运营点赞数量  
254 - CreatedAt int64 `json:"createdAt"` // 评论时间  
255 - Content string `json:"content"` // 评论的内容  
256 - Show int `json:"show"` // 显示状态 247 + Id int64 `json:"id"`
  248 + Pid int64 `json:"pid"`
  249 + TopId int64 `json:"topId"`
  250 + ArtitcleId int64 `json:"articleId"` // 文章id
  251 + SectionId int64 `json:"sectionId"` // 段落id
  252 + FromUserId int64 `json:"fromUserId"` // 填写评论的人
  253 + FromUser CommentAuthor `json:"fromUser"` // 填写评论的人
  254 + CountReply int `json:"countReply"` // 回复数量
  255 + CountUserLove int `json:"countUserLove"` // 用户点赞数量
  256 + CountAdminLove int `json:"countAdminLove"` // 运营点赞数量
  257 + CreatedAt int64 `json:"createdAt"` // 评论时间
  258 + Content string `json:"content"` // 评论的内容
  259 + AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人
  260 + MatchUrl map[string]string `json:"matchUrl"` // 评论内容中的url文本
  261 + Show int `json:"show"` // 显示状态
257 } 262 }
258 ) 263 )
259 264
@@ -42,6 +42,7 @@ func (l *MiniAllArticleTagLogic) MiniAllArticleTag(req *types.MiniAllArticleTagR @@ -42,6 +42,7 @@ func (l *MiniAllArticleTagLogic) MiniAllArticleTag(req *types.MiniAllArticleTagR
42 Category: val.Category, 42 Category: val.Category,
43 Name: val.Name, 43 Name: val.Name,
44 Image: val.Image.Url, 44 Image: val.Image.Url,
  45 + SortBy: int(val.SortBy),
45 }) 46 })
46 tagMap[val.Category] = m 47 tagMap[val.Category] = m
47 } else { 48 } else {
@@ -52,6 +53,7 @@ func (l *MiniAllArticleTagLogic) MiniAllArticleTag(req *types.MiniAllArticleTagR @@ -52,6 +53,7 @@ func (l *MiniAllArticleTagLogic) MiniAllArticleTag(req *types.MiniAllArticleTagR
52 Category: val.Category, 53 Category: val.Category,
53 Name: val.Name, 54 Name: val.Name,
54 Image: val.Image.Url, 55 Image: val.Image.Url,
  56 + SortBy: int(val.SortBy),
55 }, 57 },
56 } 58 }
57 } 59 }
@@ -50,8 +50,19 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr @@ -50,8 +50,19 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr
50 if err != nil { 50 if err != nil {
51 return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) 51 return nil, xerr.NewErrMsgErr("标记浏览记录失败", err)
52 } 52 }
  53 + author, _ := l.svcCtx.UserRepository.FindOne(l.ctx, conn, articleData.AuthorId)
  54 + company, _ := l.svcCtx.CompanyRepository.FindOne(l.ctx, conn, req.CompanyId)
53 if len(markRecord) > 0 { 55 if len(markRecord) > 0 {
54 - markRecord[0].Author = articleData.Author 56 + if author != nil {
  57 + markRecord[0].Author = domain.UserSimple{
  58 + Id: author.Id,
  59 + Name: author.Name,
  60 + Avatar: author.Avatar,
  61 + Position: author.Position,
  62 + Company: company.Name,
  63 + CompanyId: company.Id,
  64 + }
  65 + }
55 markRecord[0].Title = articleData.Title 66 markRecord[0].Title = articleData.Title
56 _, err = l.svcCtx.UserReadArticleRepository.Update(l.ctx, conn, markRecord[0]) 67 _, err = l.svcCtx.UserReadArticleRepository.Update(l.ctx, conn, markRecord[0])
57 if err != nil { 68 if err != nil {
@@ -61,14 +72,6 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr @@ -61,14 +72,6 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr
61 return resp, nil 72 return resp, nil
62 } 73 }
63 // 新建一个标记 74 // 新建一个标记
64 -  
65 - articleInfo, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.ArticleId)  
66 - if err != nil {  
67 - return nil, xerr.NewErrMsgErr("标记浏览记录失败", err)  
68 - }  
69 - if articleInfo.CompanyId != req.CompanyId {  
70 - return nil, xerr.NewErrMsg("标记浏览记录失败")  
71 - }  
72 newMark := domain.UserReadArticle{ 75 newMark := domain.UserReadArticle{
73 Id: 0, 76 Id: 0,
74 CompanyId: req.CompanyId, 77 CompanyId: req.CompanyId,
@@ -81,13 +84,23 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr @@ -81,13 +84,23 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr
81 DeletedAt: 0, 84 DeletedAt: 0,
82 Version: 0, 85 Version: 0,
83 } 86 }
  87 + if author != nil {
  88 + newMark.Author = domain.UserSimple{
  89 + Id: author.Id,
  90 + Name: author.Name,
  91 + Avatar: author.Avatar,
  92 + Position: author.Position,
  93 + Company: company.Name,
  94 + CompanyId: company.Id,
  95 + }
  96 + }
84 err = transaction.UseTrans(l.ctx, conn.DB(), func(ctx context.Context, c transaction.Conn) error { 97 err = transaction.UseTrans(l.ctx, conn.DB(), func(ctx context.Context, c transaction.Conn) error {
85 _, err = l.svcCtx.UserReadArticleRepository.Insert(ctx, c, &newMark) 98 _, err = l.svcCtx.UserReadArticleRepository.Insert(ctx, c, &newMark)
86 if err != nil { 99 if err != nil {
87 return err 100 return err
88 } 101 }
89 //增加浏览计数 102 //增加浏览计数
90 - err = l.svcCtx.ArticleRepository.IncreaseCountRead(ctx, c, 1, articleInfo.Id) 103 + err = l.svcCtx.ArticleRepository.IncreaseCountRead(ctx, c, 1, articleData.Id)
91 return err 104 return err
92 }, true) 105 }, true)
93 if err != nil { 106 if err != nil {
@@ -53,6 +53,7 @@ func (l *MiniCreateArticleDraftLogic) MiniCreateArticleDraft(req *types.MiniArti @@ -53,6 +53,7 @@ func (l *MiniCreateArticleDraftLogic) MiniCreateArticleDraft(req *types.MiniArti
53 Latitude: req.Location.Latitude, 53 Latitude: req.Location.Latitude,
54 Descript: req.Location.Descript, 54 Descript: req.Location.Descript,
55 }, 55 },
  56 + MatchUrl: map[string]string{},
56 } 57 }
57 for _, val := range req.Images { 58 for _, val := range req.Images {
58 newDraft.Images = append(newDraft.Images, domain.Image{ 59 newDraft.Images = append(newDraft.Images, domain.Image{
@@ -60,6 +61,10 @@ func (l *MiniCreateArticleDraftLogic) MiniCreateArticleDraft(req *types.MiniArti @@ -60,6 +61,10 @@ func (l *MiniCreateArticleDraftLogic) MiniCreateArticleDraft(req *types.MiniArti
60 }) 61 })
61 } 62 }
62 63
  64 + for k, v := range req.MatchUrl {
  65 + newDraft.MatchUrl[k] = v
  66 + }
  67 +
63 _, err = l.svcCtx.ArticleDraftRepository.Insert(l.ctx, conn, &newDraft) 68 _, err = l.svcCtx.ArticleDraftRepository.Insert(l.ctx, conn, &newDraft)
64 if err != nil { 69 if err != nil {
65 return nil, xerr.NewErrMsgErr("保存草稿失败", err) 70 return nil, xerr.NewErrMsgErr("保存草稿失败", err)
@@ -164,10 +164,14 @@ func (l *MiniCreateArticleLogic) MiniCreateArticle(req *types.MiniArticleCreateR @@ -164,10 +164,14 @@ func (l *MiniCreateArticleLogic) MiniCreateArticle(req *types.MiniArticleCreateR
164 CountRead: 0, 164 CountRead: 0,
165 Show: domain.ArticleShowEnable, 165 Show: domain.ArticleShowEnable,
166 Tags: []int64{}, 166 Tags: []int64{},
  167 + MatchUrl: map[string]string{},
167 } 168 }
168 if len(whoRead) > 0 { 169 if len(whoRead) > 0 {
169 newArticle.TargetUser = domain.ArticleTargetLimit 170 newArticle.TargetUser = domain.ArticleTargetLimit
170 } 171 }
  172 + for k, v := range req.MatchUrl {
  173 + newArticle.MatchUrl[k] = v
  174 + }
171 //设置内容概要 175 //设置内容概要
172 if len(sectionList) > 0 { 176 if len(sectionList) > 0 {
173 // 截取内容 50个字 177 // 截取内容 50个字
@@ -50,6 +50,10 @@ func (l *MiniGetArticleDraftMeLogic) MiniGetArticleDraftMe(req *types.MiniArticl @@ -50,6 +50,10 @@ func (l *MiniGetArticleDraftMeLogic) MiniGetArticleDraftMe(req *types.MiniArticl
50 Latitude: draftInfo.Location.Latitude, 50 Latitude: draftInfo.Location.Latitude,
51 Descript: draftInfo.Location.Descript, 51 Descript: draftInfo.Location.Descript,
52 }, 52 },
  53 + MatchUrl: map[string]string{},
  54 + }
  55 + for k, v := range draftInfo.MatchUrl {
  56 + resp.MatchUrl[k] = v
53 } 57 }
54 for _, val := range draftInfo.Images { 58 for _, val := range draftInfo.Images {
55 resp.Images = append(resp.Images, val.Url) 59 resp.Images = append(resp.Images, val.Url)
@@ -122,10 +122,15 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( @@ -122,10 +122,15 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) (
122 MeLoveFlag: meLoveFlag, 122 MeLoveFlag: meLoveFlag,
123 MeFollowFlag: 0, 123 MeFollowFlag: 0,
124 Tags: tags, 124 Tags: tags,
  125 + MatchUrl: map[string]string{},
125 } 126 }
126 if articleInfo.CreatedAt != articleInfo.UpdatedAt { 127 if articleInfo.CreatedAt != articleInfo.UpdatedAt {
127 resp.Edit = 1 128 resp.Edit = 1
128 } 129 }
  130 +
  131 + for k, v := range articleInfo.MatchUrl {
  132 + resp.MatchUrl[k] = v
  133 + }
129 for _, val := range articleInfo.Images { 134 for _, val := range articleInfo.Images {
130 resp.Images = append(resp.Images, val.Url) 135 resp.Images = append(resp.Images, val.Url)
131 } 136 }
@@ -54,6 +54,7 @@ func (l *MiniSearchArticleDraftMeLogic) MiniSearchArticleDraftMe(req *types.Mini @@ -54,6 +54,7 @@ func (l *MiniSearchArticleDraftMeLogic) MiniSearchArticleDraftMe(req *types.Mini
54 Title: draftList[i].Title, 54 Title: draftList[i].Title,
55 Images: images, 55 Images: images,
56 CreatedAt: draftList[i].CreatedAt, 56 CreatedAt: draftList[i].CreatedAt,
  57 + MatchUrl: draftList[i].MatchUrl,
57 } 58 }
58 } 59 }
59 return resp, nil 60 return resp, nil
@@ -251,6 +251,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeArticle(req *types.MiniSetUserLikeRequ @@ -251,6 +251,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeArticle(req *types.MiniSetUserLikeRequ
251 CommentAuthor: 0, 251 CommentAuthor: 0,
252 UserId: req.UserId, 252 UserId: req.UserId,
253 ToUserId: articleInfo.AuthorId, 253 ToUserId: articleInfo.AuthorId,
  254 + CompanyId: userInfo.CompanyId,
254 } 255 }
255 // 添加点赞标识 256 // 添加点赞标识
256 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo) 257 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo)
@@ -341,6 +342,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeComment(req *types.MiniSetUserLikeRequ @@ -341,6 +342,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeComment(req *types.MiniSetUserLikeRequ
341 CommentAuthor: commentInfo.FromUserId, 342 CommentAuthor: commentInfo.FromUserId,
342 UserId: req.UserId, 343 UserId: req.UserId,
343 ToUserId: commentInfo.FromUserId, 344 ToUserId: commentInfo.FromUserId,
  345 + CompanyId: userInfo.CompanyId,
344 } 346 }
345 // 设置赞标识 347 // 设置赞标识
346 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo) 348 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo)
@@ -56,6 +56,7 @@ func (l *MiniShowHomePageLogic) MiniShowHomePage(req *types.MiniHomePageRequest) @@ -56,6 +56,7 @@ func (l *MiniShowHomePageLogic) MiniShowHomePage(req *types.MiniHomePageRequest)
56 TagRemark: val.Remark, 56 TagRemark: val.Remark,
57 TotalArticle: 0, 57 TotalArticle: 0,
58 ReadArticle: 0, 58 ReadArticle: 0,
  59 + SortBy: int(val.SortBy),
59 } 60 }
60 if count, ok := countDataMap[val.Id]; ok { 61 if count, ok := countDataMap[val.Id]; ok {
61 m.TotalArticle = count.TotalArticle 62 m.TotalArticle = count.TotalArticle
@@ -58,6 +58,10 @@ func (l *MiniUpdateArticleDraftLogic) MiniUpdateArticleDraft(req *types.MiniArti @@ -58,6 +58,10 @@ func (l *MiniUpdateArticleDraftLogic) MiniUpdateArticleDraft(req *types.MiniArti
58 Url: val, 58 Url: val,
59 }) 59 })
60 } 60 }
  61 + draftInfo.MatchUrl = make(map[string]string)
  62 + for k, v := range req.MatchUrl {
  63 + draftInfo.MatchUrl[k] = v
  64 + }
61 _, err = l.svcCtx.ArticleDraftRepository.Update(l.ctx, conn, draftInfo) 65 _, err = l.svcCtx.ArticleDraftRepository.Update(l.ctx, conn, draftInfo)
62 if err != nil { 66 if err != nil {
63 return nil, xerr.NewErrMsgErr("更新草稿失败", err) 67 return nil, xerr.NewErrMsgErr("更新草稿失败", err)
@@ -2,6 +2,7 @@ package article @@ -2,6 +2,7 @@ package article
2 2
3 import ( 3 import (
4 "context" 4 "context"
  5 +
5 "github.com/samber/lo" 6 "github.com/samber/lo"
6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction" 7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain" 8 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
@@ -42,6 +43,7 @@ func (l *SystemArticleRestoreLogic) SystemArticleRestore(req *types.SystemArticl @@ -42,6 +43,7 @@ func (l *SystemArticleRestoreLogic) SystemArticleRestore(req *types.SystemArticl
42 article.Version = article.Version + 1 43 article.Version = article.Version + 1
43 article.Images = backup.Images 44 article.Images = backup.Images
44 article.Title = backup.Title 45 article.Title = backup.Title
  46 + article.MatchUrl = backup.MatchUrl
45 articleSections := make([]domain.ArticleSection, 0) 47 articleSections := make([]domain.ArticleSection, 0)
46 lo.ForEach(backup.Section, func(item domain.ArticleSection, index int) { 48 lo.ForEach(backup.Section, func(item domain.ArticleSection, index int) {
47 articleSections = append(articleSections, domain.ArticleSection{ 49 articleSections = append(articleSections, domain.ArticleSection{
@@ -132,6 +132,11 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini @@ -132,6 +132,11 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini
132 CountAdminLove: 0, 132 CountAdminLove: 0,
133 Show: domain.CommentShowEnable, 133 Show: domain.CommentShowEnable,
134 AtWho: []domain.UserSimple{}, 134 AtWho: []domain.UserSimple{},
  135 + MatchUrl: map[string]string{},
  136 + }
  137 +
  138 + for k, v := range req.MatchUrl {
  139 + newComment.MatchUrl[k] = v
135 } 140 }
136 141
137 if selctionInfo != nil { 142 if selctionInfo != nil {
@@ -238,6 +243,7 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini @@ -238,6 +243,7 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini
238 CountUserLove: 0, 243 CountUserLove: 0,
239 CountAdminLove: 0, 244 CountAdminLove: 0,
240 AtWho: []types.CommentAtWho{}, 245 AtWho: []types.CommentAtWho{},
  246 + MatchUrl: newComment.MatchUrl,
241 CreatedAt: newComment.CreatedAt, 247 CreatedAt: newComment.CreatedAt,
242 } 248 }
243 249
@@ -89,12 +89,17 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt @@ -89,12 +89,17 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt
89 CountUserLove: commentInfo.CountUserLove, 89 CountUserLove: commentInfo.CountUserLove,
90 CountAdminLove: commentInfo.CountAdminLove, 90 CountAdminLove: commentInfo.CountAdminLove,
91 AtWho: []types.CommentAtWho{}, 91 AtWho: []types.CommentAtWho{},
  92 + MatchUrl: map[string]string{},
92 CreatedAt: commentInfo.CreatedAt, 93 CreatedAt: commentInfo.CreatedAt,
93 MeLoveFlag: 0, 94 MeLoveFlag: 0,
  95 + Content: commentInfo.Content,
94 } 96 }
95 if _, ok := flagMap[commentInfo.Id]; ok { 97 if _, ok := flagMap[commentInfo.Id]; ok {
96 commentResp.MeLoveFlag = 1 98 commentResp.MeLoveFlag = 1
97 } 99 }
  100 + for k, v := range commentInfo.MatchUrl {
  101 + commentResp.MatchUrl[k] = v
  102 + }
98 for _, val := range commentInfo.AtWho { 103 for _, val := range commentInfo.AtWho {
99 commentResp.AtWho = append(commentResp.AtWho, types.CommentAtWho{ 104 commentResp.AtWho = append(commentResp.AtWho, types.CommentAtWho{
100 Id: val.Id, 105 Id: val.Id,
@@ -131,12 +136,16 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt @@ -131,12 +136,16 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt
131 CountUserLove: val.CountUserLove, 136 CountUserLove: val.CountUserLove,
132 CountAdminLove: val.CountAdminLove, 137 CountAdminLove: val.CountAdminLove,
133 AtWho: []types.CommentAtWho{}, 138 AtWho: []types.CommentAtWho{},
  139 + MatchUrl: map[string]string{},
134 CreatedAt: val.CreatedAt, 140 CreatedAt: val.CreatedAt,
135 MeLoveFlag: 0, 141 MeLoveFlag: 0,
136 } 142 }
137 if _, ok := flagMap[val.Id]; ok { 143 if _, ok := flagMap[val.Id]; ok {
138 reply.MeLoveFlag = 1 144 reply.MeLoveFlag = 1
139 } 145 }
  146 + for key, url := range val.MatchUrl {
  147 + reply.MatchUrl[key] = url
  148 + }
140 for _, val2 := range val.AtWho { 149 for _, val2 := range val.AtWho {
141 reply.AtWho = append(reply.AtWho, types.CommentAtWho{ 150 reply.AtWho = append(reply.AtWho, types.CommentAtWho{
142 Id: val2.Id, 151 Id: val2.Id,
@@ -37,10 +37,12 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList @@ -37,10 +37,12 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList
37 WithOffsetLimit(req.Page, req.Size). 37 WithOffsetLimit(req.Page, req.Size).
38 MustWithKV("topId", 0). 38 MustWithKV("topId", 0).
39 MustWithKV("articleId", req.ArticleId). 39 MustWithKV("articleId", req.ArticleId).
40 - MustWithKV("sectionId", req.SectionId).  
41 - MustWithKV("show", domain.CommentShowEnable). 40 + MustWithKV("show", int(domain.CommentShowEnable)).
42 MustWithKV("companyId", req.CompanyId) 41 MustWithKV("companyId", req.CompanyId)
43 - 42 + if req.SectionId > 0 {
  43 + //专门获取段落评论
  44 + queryOption.MustWithKV("sectionId", req.SectionId)
  45 + }
44 cnt, commentList, err := l.svcCtx.ArticleCommentRepository.Find(l.ctx, conn, queryOption) 46 cnt, commentList, err := l.svcCtx.ArticleCommentRepository.Find(l.ctx, conn, queryOption)
45 if err != nil { 47 if err != nil {
46 return nil, xerr.NewErrMsgErr("获取评论信息失败", err) 48 return nil, xerr.NewErrMsgErr("获取评论信息失败", err)
@@ -100,6 +102,7 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList @@ -100,6 +102,7 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList
100 CountUserLove: val.CountUserLove, 102 CountUserLove: val.CountUserLove,
101 CountAdminLove: val.CountAdminLove, 103 CountAdminLove: val.CountAdminLove,
102 AtWho: []types.CommentAtWho{}, 104 AtWho: []types.CommentAtWho{},
  105 + MatchUrl: map[string]string{},
103 CreatedAt: val.CreatedAt, 106 CreatedAt: val.CreatedAt,
104 MeLoveFlag: 0, 107 MeLoveFlag: 0,
105 Content: val.Content, 108 Content: val.Content,
@@ -111,7 +114,9 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList @@ -111,7 +114,9 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList
111 if _, ok := flagMap[val.Id]; ok { 114 if _, ok := flagMap[val.Id]; ok {
112 item.Comment.MeLoveFlag = 1 115 item.Comment.MeLoveFlag = 1
113 } 116 }
114 - 117 + for key2, val2 := range val.MatchUrl {
  118 + item.Comment.MatchUrl[key2] = val2
  119 + }
115 for _, val2 := range val.AtWho { 120 for _, val2 := range val.AtWho {
116 item.Comment.AtWho = append(item.Comment.AtWho, types.CommentAtWho{ 121 item.Comment.AtWho = append(item.Comment.AtWho, types.CommentAtWho{
117 Id: val2.Id, 122 Id: val2.Id,
@@ -174,6 +179,7 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag @@ -174,6 +179,7 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag
174 CountUserLove: val.CountUserLove, 179 CountUserLove: val.CountUserLove,
175 CountAdminLove: val.CountAdminLove, 180 CountAdminLove: val.CountAdminLove,
176 AtWho: []types.CommentAtWho{}, 181 AtWho: []types.CommentAtWho{},
  182 + MatchUrl: map[string]string{},
177 CreatedAt: val.CreatedAt, 183 CreatedAt: val.CreatedAt,
178 MeLoveFlag: 0, 184 MeLoveFlag: 0,
179 Content: val.Content, 185 Content: val.Content,
@@ -182,6 +188,9 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag @@ -182,6 +188,9 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag
182 if _, ok := loveFlagMap[val.Id]; ok { 188 if _, ok := loveFlagMap[val.Id]; ok {
183 item.MeLoveFlag = 1 189 item.MeLoveFlag = 1
184 } 190 }
  191 + for key2, val2 := range val.MatchUrl {
  192 + item.MatchUrl[key2] = val2
  193 + }
185 for _, val2 := range val.AtWho { 194 for _, val2 := range val.AtWho {
186 item.AtWho = append(item.AtWho, types.CommentAtWho{ 195 item.AtWho = append(item.AtWho, types.CommentAtWho{
187 Id: val2.Id, 196 Id: val2.Id,
@@ -56,6 +56,9 @@ func (l *MiniTop5ArticleCommentLogic) MiniTop5ArticleComment(req *types.MiniTop5 @@ -56,6 +56,9 @@ func (l *MiniTop5ArticleCommentLogic) MiniTop5ArticleComment(req *types.MiniTop5
56 if _, ok := flagMap[val.Id]; ok { 56 if _, ok := flagMap[val.Id]; ok {
57 item.MeLoveFlag = 1 57 item.MeLoveFlag = 1
58 } 58 }
  59 + for key, url := range val.MatchUrl {
  60 + item.MatchUrl[key] = url
  61 + }
59 for _, val2 := range val.AtWho { 62 for _, val2 := range val.AtWho {
60 item.AtWho = append(item.AtWho, types.CommentAtWho{ 63 item.AtWho = append(item.AtWho, types.CommentAtWho{
61 Id: val2.Id, 64 Id: val2.Id,
@@ -95,6 +98,7 @@ func NewArticleCommentItem(val *domain.ArticleComment) types.ArticleCommentItem @@ -95,6 +98,7 @@ func NewArticleCommentItem(val *domain.ArticleComment) types.ArticleCommentItem
95 CountUserLove: val.CountUserLove, 98 CountUserLove: val.CountUserLove,
96 CountAdminLove: val.CountAdminLove, 99 CountAdminLove: val.CountAdminLove,
97 AtWho: []types.CommentAtWho{}, 100 AtWho: []types.CommentAtWho{},
  101 + MatchUrl: map[string]string{},
98 CreatedAt: val.CreatedAt, 102 CreatedAt: val.CreatedAt,
99 MeLoveFlag: 0, 103 MeLoveFlag: 0,
100 Content: val.Content, 104 Content: val.Content,
@@ -56,6 +56,11 @@ func (l *CreateTagLogic) CreateTag(req *types.TagCreateRequest) (resp *types.Tag @@ -56,6 +56,11 @@ func (l *CreateTagLogic) CreateTag(req *types.TagCreateRequest) (resp *types.Tag
56 Category: req.Category, 56 Category: req.Category,
57 Remark: req.Remark, 57 Remark: req.Remark,
58 Other: req.Other, 58 Other: req.Other,
  59 + SortBy: int64(req.SortBy),
  60 + }
  61 + err = newTag.SetCategory(req.Category)
  62 + if err != nil {
  63 + return nil, xerr.NewErrMsgErr("添加标签失败", err)
59 } 64 }
60 if len(req.Image) > 0 { 65 if len(req.Image) > 0 {
61 //获取图片的尺寸大小 66 //获取图片的尺寸大小
@@ -70,6 +70,11 @@ func (l *EditTagLogic) EditTag(req *types.TagEditRequest) (resp *types.TagEditRe @@ -70,6 +70,11 @@ func (l *EditTagLogic) EditTag(req *types.TagEditRequest) (resp *types.TagEditRe
70 oldTag.Name = req.Name 70 oldTag.Name = req.Name
71 oldTag.Remark = req.Remark 71 oldTag.Remark = req.Remark
72 oldTag.Other = req.Other 72 oldTag.Other = req.Other
  73 + oldTag.SortBy = int64(req.SortBy)
  74 + err = oldTag.SetCategory(req.Category)
  75 + if err != nil {
  76 + return nil, xerr.NewErrMsgErr("添加标签失败", err)
  77 + }
73 oldTag, err = l.svcCtx.ArticleTagRepository.Update(l.ctx, conn, oldTag) 78 oldTag, err = l.svcCtx.ArticleTagRepository.Update(l.ctx, conn, oldTag)
74 if err != nil { 79 if err != nil {
75 return nil, xerr.NewErrMsgErr("添加标签失败", err) 80 return nil, xerr.NewErrMsgErr("添加标签失败", err)
@@ -41,6 +41,7 @@ func (l *GetTagLogic) GetTag(req *types.TagGetRequest) (resp *types.TagGetRespon @@ -41,6 +41,7 @@ func (l *GetTagLogic) GetTag(req *types.TagGetRequest) (resp *types.TagGetRespon
41 Category: oldTag.Category, 41 Category: oldTag.Category,
42 Remark: oldTag.Remark, 42 Remark: oldTag.Remark,
43 Other: oldTag.Other, 43 Other: oldTag.Other,
  44 + SortBy: int(oldTag.SortBy),
44 } 45 }
45 return 46 return
46 } 47 }
@@ -53,6 +53,7 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi @@ -53,6 +53,7 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi
53 Category: tagList[i].Category, 53 Category: tagList[i].Category,
54 Remark: tagList[i].Remark, 54 Remark: tagList[i].Remark,
55 CreatedAt: tagList[i].CreatedAt, 55 CreatedAt: tagList[i].CreatedAt,
  56 + SortBy: int(tagList[i].SortBy),
56 } 57 }
57 } 58 }
58 return resp, nil 59 return resp, nil
@@ -45,30 +45,35 @@ func (l *MiniMyBeLikedLogic) MiniMyBeLiked(req *types.MiniBeLikedRequest) (resp @@ -45,30 +45,35 @@ func (l *MiniMyBeLikedLogic) MiniMyBeLiked(req *types.MiniBeLikedRequest) (resp
45 return resp, nil 45 return resp, nil
46 } 46 }
47 47
  48 + var companyMap = make(map[int64]*domain.Company)
48 var userMap = make(map[int64]*domain.User) 49 var userMap = make(map[int64]*domain.User)
49 var articleMap = make(map[int64]*domain.Article) 50 var articleMap = make(map[int64]*domain.Article)
50 var commentMap = make(map[int64]*domain.ArticleComment) 51 var commentMap = make(map[int64]*domain.ArticleComment)
51 52
52 lo.ForEach(list, func(item *domain.UserLoveFlag, index int) { 53 lo.ForEach(list, func(item *domain.UserLoveFlag, index int) {
53 var ( 54 var (
  55 + company *domain.Company
54 user *domain.User 56 user *domain.User
55 article *domain.Article 57 article *domain.Article
56 comment *domain.ArticleComment 58 comment *domain.ArticleComment
57 ) 59 )
58 user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.UserId, l.svcCtx.UserRepository.FindOne) 60 user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.UserId, l.svcCtx.UserRepository.FindOne)
  61 + if user != nil {
  62 + company, _ = domain.LazyLoad(companyMap, l.ctx, conn, user.CompanyId, l.svcCtx.CompanyRepository.FindOne)
  63 + }
59 article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne) 64 article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne)
60 // 点赞评论 65 // 点赞评论
61 if item.CommentId != 0 { 66 if item.CommentId != 0 {
62 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne) 67 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne)
63 } 68 }
64 69
65 - resp.List = append(resp.List, l.NewItemSimple(item, user, article, comment)) 70 + resp.List = append(resp.List, l.NewItemSimple(item, company, user, article, comment))
66 }) 71 })
67 72
68 return resp, nil 73 return resp, nil
69 } 74 }
70 75
71 -func (l *MiniMyBeLikedLogic) NewItemSimple(love *domain.UserLoveFlag, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyBeLikedItem { 76 +func (l *MiniMyBeLikedLogic) NewItemSimple(love *domain.UserLoveFlag, company *domain.Company, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyBeLikedItem {
72 item := types.MyBeLikedItem{ 77 item := types.MyBeLikedItem{
73 UserId: love.UserId, 78 UserId: love.UserId,
74 ArticleId: love.ArticleId, 79 ArticleId: love.ArticleId,
@@ -84,6 +89,9 @@ func (l *MiniMyBeLikedLogic) NewItemSimple(love *domain.UserLoveFlag, user *doma @@ -84,6 +89,9 @@ func (l *MiniMyBeLikedLogic) NewItemSimple(love *domain.UserLoveFlag, user *doma
84 Avatar: user.Avatar, 89 Avatar: user.Avatar,
85 Position: user.Position, 90 Position: user.Position,
86 } 91 }
  92 + if company != nil {
  93 + item.User.CompanyName = company.Name
  94 + }
87 } 95 }
88 96
89 if article != nil { 97 if article != nil {
@@ -45,30 +45,35 @@ func (l *MiniMyLikeLogic) MiniMyLike(req *types.MiniMyLikeRequest) (resp *types. @@ -45,30 +45,35 @@ func (l *MiniMyLikeLogic) MiniMyLike(req *types.MiniMyLikeRequest) (resp *types.
45 return resp, nil 45 return resp, nil
46 } 46 }
47 47
  48 + var companyMap = make(map[int64]*domain.Company)
48 var userMap = make(map[int64]*domain.User) 49 var userMap = make(map[int64]*domain.User)
49 var articleMap = make(map[int64]*domain.Article) 50 var articleMap = make(map[int64]*domain.Article)
50 var commentMap = make(map[int64]*domain.ArticleComment) 51 var commentMap = make(map[int64]*domain.ArticleComment)
51 52
52 lo.ForEach(list, func(item *domain.UserLoveFlag, index int) { 53 lo.ForEach(list, func(item *domain.UserLoveFlag, index int) {
53 var ( 54 var (
  55 + company *domain.Company
54 user *domain.User 56 user *domain.User
55 article *domain.Article 57 article *domain.Article
56 comment *domain.ArticleComment 58 comment *domain.ArticleComment
57 ) 59 )
58 user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.ToUserId, l.svcCtx.UserRepository.FindOne) 60 user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.ToUserId, l.svcCtx.UserRepository.FindOne)
  61 + if user != nil {
  62 + company, _ = domain.LazyLoad(companyMap, l.ctx, conn, user.CompanyId, l.svcCtx.CompanyRepository.FindOne)
  63 + }
59 article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne) 64 article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne)
60 // 点赞评论 65 // 点赞评论
61 if item.CommentId != 0 { 66 if item.CommentId != 0 {
62 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne) 67 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne)
63 } 68 }
64 69
65 - resp.List = append(resp.List, l.NewItemSimple(item, user, article, comment)) 70 + resp.List = append(resp.List, l.NewItemSimple(item, company, user, article, comment))
66 }) 71 })
67 72
68 return resp, nil 73 return resp, nil
69 } 74 }
70 75
71 -func (l *MiniMyLikeLogic) NewItemSimple(love *domain.UserLoveFlag, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyLikeItem { 76 +func (l *MiniMyLikeLogic) NewItemSimple(love *domain.UserLoveFlag, company *domain.Company, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyLikeItem {
72 item := types.MyLikeItem{ 77 item := types.MyLikeItem{
73 UserId: love.ToUserId, 78 UserId: love.ToUserId,
74 ArticleId: love.ArticleId, 79 ArticleId: love.ArticleId,
@@ -84,6 +89,9 @@ func (l *MiniMyLikeLogic) NewItemSimple(love *domain.UserLoveFlag, user *domain. @@ -84,6 +89,9 @@ func (l *MiniMyLikeLogic) NewItemSimple(love *domain.UserLoveFlag, user *domain.
84 Avatar: user.Avatar, 89 Avatar: user.Avatar,
85 Position: user.Position, 90 Position: user.Position,
86 } 91 }
  92 + if company != nil {
  93 + item.User.CompanyName = company.Name
  94 + }
87 } 95 }
88 96
89 if article != nil { 97 if article != nil {
@@ -17,13 +17,14 @@ type CommentAuthor struct { @@ -17,13 +17,14 @@ type CommentAuthor struct {
17 } 17 }
18 18
19 type MiniCreateArticleCommentRequest struct { 19 type MiniCreateArticleCommentRequest struct {
20 - ArtitcleId int64 `json:"articleId"` // 文章id  
21 - SectionId int64 `json:"sectionId"` // 段落id  
22 - FromUserId int64 `json:",optional"` // 填写文章的人,服务端自动获取  
23 - CompanyId int64 `json:",optional"` // 服务端自动获取  
24 - Pid int64 `json:"pid"` // 回复那个评论的id  
25 - Content string `json:"content"` // 评论的内容  
26 - AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人 20 + ArtitcleId int64 `json:"articleId"` // 文章id
  21 + SectionId int64 `json:"sectionId"` // 段落id
  22 + FromUserId int64 `json:",optional"` // 填写文章的人,服务端自动获取
  23 + CompanyId int64 `json:",optional"` // 服务端自动获取
  24 + Pid int64 `json:"pid,optional"` // 回复那个评论的id
  25 + Content string `json:"content"` // 评论的内容
  26 + AtWho []CommentAtWho `json:"atWho,optional"` // 填写评论时@的人
  27 + MatchUrl map[string]string `json:"matchUrl,optional"` // 评论内容中的url文本
27 } 28 }
28 29
29 type CommentAtWho struct { 30 type CommentAtWho struct {
@@ -33,21 +34,22 @@ type CommentAtWho struct { @@ -33,21 +34,22 @@ type CommentAtWho struct {
33 } 34 }
34 35
35 type MiniCreateArticleCommentResponse struct { 36 type MiniCreateArticleCommentResponse struct {
36 - Id int64 `json:"id"`  
37 - Pid int64 `json:"pid"`  
38 - TopId int64 `json:"topId"`  
39 - ArtitcleId int64 `json:"articleId"` // 文章id  
40 - SectionId int64 `json:"sectionId"` // 段落id  
41 - FromUserId int64 `json:"fromUserId"` // 填写评论的人  
42 - FromUser CommentAuthor `json:"fromUser"` // 填写评论的人  
43 - ToUserId int64 `json:"toUserId"` // 回复哪个人  
44 - ToUser CommentAuthor `json:"toUser"` // 回复哪个人  
45 - SectionContent string `json:"sectionContent"` // 引用的文章内容文本  
46 - CountReply int `json:"countReply"` // 回复数量  
47 - CountUserLove int `json:"countUserLove"` // 用户点赞数量  
48 - CountAdminLove int `json:"countAdminLove"` // 运营点赞数量  
49 - AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人  
50 - CreatedAt int64 `json:"createdAt"` // 37 + Id int64 `json:"id"`
  38 + Pid int64 `json:"pid"`
  39 + TopId int64 `json:"topId"`
  40 + ArtitcleId int64 `json:"articleId"` // 文章id
  41 + SectionId int64 `json:"sectionId"` // 段落id
  42 + FromUserId int64 `json:"fromUserId"` // 填写评论的人
  43 + FromUser CommentAuthor `json:"fromUser"` // 填写评论的人
  44 + ToUserId int64 `json:"toUserId"` // 回复哪个人
  45 + ToUser CommentAuthor `json:"toUser"` // 回复哪个人
  46 + SectionContent string `json:"sectionContent"` // 引用的文章内容文本
  47 + CountReply int `json:"countReply"` // 回复数量
  48 + CountUserLove int `json:"countUserLove"` // 用户点赞数量
  49 + CountAdminLove int `json:"countAdminLove"` // 运营点赞数量
  50 + AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人
  51 + MatchUrl map[string]string `json:"matchUrl"` // 评论内容中的url文本
  52 + CreatedAt int64 `json:"createdAt"` //
51 } 53 }
52 54
53 type MiniListArticleCommentRequest struct { 55 type MiniListArticleCommentRequest struct {
@@ -71,23 +73,24 @@ type ArticleCommentAndReply struct { @@ -71,23 +73,24 @@ type ArticleCommentAndReply struct {
71 } 73 }
72 74
73 type ArticleCommentItem struct { 75 type ArticleCommentItem struct {
74 - Id int64 `json:"id"`  
75 - Pid int64 `json:"pid"`  
76 - TopId int64 `json:"topId"`  
77 - ArtitcleId int64 `json:"articleId"` // 文章id  
78 - SectionId int64 `json:"sectionId"` // 段落id  
79 - FromUserId int64 `json:"fromUserId"` // 填写评论的人  
80 - FromUser CommentAuthor `json:"fromUser"` // 填写评论的人  
81 - ToUserId int64 `json:"toUserId"` // 回复哪个人  
82 - ToUser CommentAuthor `json:"toUser"` // 回复哪个人  
83 - SectionContent string `json:"sectionContent"` // 引用的文章内容文本  
84 - CountReply int `json:"countReply"` // 回复数量  
85 - CountUserLove int `json:"countUserLove"` // 用户点赞数量  
86 - CountAdminLove int `json:"countAdminLove"` // 运营点赞数量  
87 - AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人  
88 - CreatedAt int64 `json:"createdAt"` //  
89 - MeLoveFlag int `json:"meLoveFlag"` //当前人员对评论的点赞标识 (0 没有点赞 1有点赞)  
90 - Content string `json:"content"` // 评论的内容 76 + Id int64 `json:"id"`
  77 + Pid int64 `json:"pid"`
  78 + TopId int64 `json:"topId"`
  79 + ArtitcleId int64 `json:"articleId"` // 文章id
  80 + SectionId int64 `json:"sectionId"` // 段落id
  81 + FromUserId int64 `json:"fromUserId"` // 填写评论的人
  82 + FromUser CommentAuthor `json:"fromUser"` // 填写评论的人
  83 + ToUserId int64 `json:"toUserId"` // 回复哪个人
  84 + ToUser CommentAuthor `json:"toUser"` // 回复哪个人
  85 + SectionContent string `json:"sectionContent"` // 引用的文章内容文本
  86 + CountReply int `json:"countReply"` // 回复数量
  87 + CountUserLove int `json:"countUserLove"` // 用户点赞数量
  88 + CountAdminLove int `json:"countAdminLove"` // 运营点赞数量
  89 + AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人
  90 + MatchUrl map[string]string `json:"matchUrl"` // 评论内容中的url文本
  91 + CreatedAt int64 `json:"createdAt"` //
  92 + MeLoveFlag int `json:"meLoveFlag"` //当前人员对评论的点赞标识 (0 没有点赞 1有点赞)
  93 + Content string `json:"content"` // 评论的内容
91 } 94 }
92 95
93 type MiniGetArticleCommentRequest struct { 96 type MiniGetArticleCommentRequest struct {
@@ -160,19 +163,21 @@ type SystemArticleCommentSearchResponse struct { @@ -160,19 +163,21 @@ type SystemArticleCommentSearchResponse struct {
160 } 163 }
161 164
162 type SystemArticleCommentSearchItem struct { 165 type SystemArticleCommentSearchItem struct {
163 - Id int64 `json:"id"`  
164 - Pid int64 `json:"pid"`  
165 - TopId int64 `json:"topId"`  
166 - ArtitcleId int64 `json:"articleId"` // 文章id  
167 - SectionId int64 `json:"sectionId"` // 段落id  
168 - FromUserId int64 `json:"fromUserId"` // 填写评论的人  
169 - FromUser CommentAuthor `json:"fromUser"` // 填写评论的人  
170 - CountReply int `json:"countReply"` // 回复数量  
171 - CountUserLove int `json:"countUserLove"` // 用户点赞数量  
172 - CountAdminLove int `json:"countAdminLove"` // 运营点赞数量  
173 - CreatedAt int64 `json:"createdAt"` // 评论时间  
174 - Content string `json:"content"` // 评论的内容  
175 - Show int `json:"show"` // 显示状态 166 + Id int64 `json:"id"`
  167 + Pid int64 `json:"pid"`
  168 + TopId int64 `json:"topId"`
  169 + ArtitcleId int64 `json:"articleId"` // 文章id
  170 + SectionId int64 `json:"sectionId"` // 段落id
  171 + FromUserId int64 `json:"fromUserId"` // 填写评论的人
  172 + FromUser CommentAuthor `json:"fromUser"` // 填写评论的人
  173 + CountReply int `json:"countReply"` // 回复数量
  174 + CountUserLove int `json:"countUserLove"` // 用户点赞数量
  175 + CountAdminLove int `json:"countAdminLove"` // 运营点赞数量
  176 + CreatedAt int64 `json:"createdAt"` // 评论时间
  177 + Content string `json:"content"` // 评论的内容
  178 + AtWho []CommentAtWho `json:"atWho"` // 填写评论时@的人
  179 + MatchUrl map[string]string `json:"matchUrl"` // 评论内容中的url文本
  180 + Show int `json:"show"` // 显示状态
176 } 181 }
177 182
178 type SystemListCommentRequest struct { 183 type SystemListCommentRequest struct {
@@ -318,6 +323,7 @@ type TagCreateRequest struct { @@ -318,6 +323,7 @@ type TagCreateRequest struct {
318 Category string `json:"category"` // 标签分类 323 Category string `json:"category"` // 标签分类
319 Remark string `json:"remark,optional"` // 备注 324 Remark string `json:"remark,optional"` // 备注
320 Other string `json:"other,optional"` 325 Other string `json:"other,optional"`
  326 + SortBy int `json:"sortBy,optional"` //排序
321 } 327 }
322 328
323 type TagCreateResponse struct { 329 type TagCreateResponse struct {
@@ -332,6 +338,7 @@ type TagEditRequest struct { @@ -332,6 +338,7 @@ type TagEditRequest struct {
332 Category string `json:"category"` // 标签分类 338 Category string `json:"category"` // 标签分类
333 Remark string `json:"remark,optional"` // 备注 339 Remark string `json:"remark,optional"` // 备注
334 Other string `json:"other,optional"` 340 Other string `json:"other,optional"`
  341 + SortBy int `json:"sortBy,optional"` // 排序
335 } 342 }
336 343
337 type TagEditResponse struct { 344 type TagEditResponse struct {
@@ -350,6 +357,7 @@ type TagGetResponse struct { @@ -350,6 +357,7 @@ type TagGetResponse struct {
350 Category string `json:"category"` // 标签分类 357 Category string `json:"category"` // 标签分类
351 Remark string `json:"remark"` // 备注 358 Remark string `json:"remark"` // 备注
352 Other string `json:"other"` 359 Other string `json:"other"`
  360 + SortBy int `json:"sortBy,optional"` // 排序
353 } 361 }
354 362
355 type TagListRequest struct { 363 type TagListRequest struct {
@@ -373,6 +381,7 @@ type TagItem struct { @@ -373,6 +381,7 @@ type TagItem struct {
373 Category string `json:"category"` // 标签分类 381 Category string `json:"category"` // 标签分类
374 Remark string `json:"remark"` // 备注 382 Remark string `json:"remark"` // 备注
375 CreatedAt int64 `json:"createdAt"` 383 CreatedAt int64 `json:"createdAt"`
  384 + SortBy int `json:"sortBy,optional"` // 排序
376 } 385 }
377 386
378 type TagDeleteRequest struct { 387 type TagDeleteRequest struct {
@@ -792,13 +801,14 @@ type ArticleAuthor struct { @@ -792,13 +801,14 @@ type ArticleAuthor struct {
792 } 801 }
793 802
794 type MiniArticleCreateRequest struct { 803 type MiniArticleCreateRequest struct {
795 - Title string `json:"title"` //标题  
796 - Section []string `json:"section"` //文章的文本内容  
797 - AuthorId int64 `json:"authorId,optional"` //发布人id  
798 - Images []string `json:"images,optional"` //图片  
799 - WhoRead []int64 `json:"whoRead,optional"` //谁可查看  
800 - WhoReview []int64 `json:"whoReview,optional"` //谁可评论  
801 - Location Location `json:"location,optional"` //定位坐标 804 + Title string `json:"title"` //标题
  805 + Section []string `json:"section"` //文章的文本内容
  806 + AuthorId int64 `json:"authorId,optional"` //发布人id
  807 + Images []string `json:"images,optional"` //图片
  808 + WhoRead []int64 `json:"whoRead,optional"` //谁可查看
  809 + WhoReview []int64 `json:"whoReview,optional"` //谁可评论
  810 + Location Location `json:"location,optional"` //定位坐标
  811 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
802 } 812 }
803 813
804 type MiniArticleCreateResponse struct { 814 type MiniArticleCreateResponse struct {
@@ -812,24 +822,25 @@ type MiniArticleGetRequest struct { @@ -812,24 +822,25 @@ type MiniArticleGetRequest struct {
812 } 822 }
813 823
814 type MiniArticleGetResponse struct { 824 type MiniArticleGetResponse struct {
815 - Id int64 `json:"id"` //id  
816 - Title string `json:"title"` //标题  
817 - AuthorId int64 `json:"authorId"` //发布人id  
818 - Author ArticleAuthor `json:"author"` //发布人  
819 - CreatedAt int64 `json:"createdAt"` //文章的发布时间  
820 - Section []ArticleSection `json:"section"` //文章的文本内容  
821 - Images []string `json:"images"` //图片  
822 - WhoRead []int64 `json:"whoRead"` //谁可查看  
823 - WhoReview []int64 `json:"whoReview"` //谁可评论  
824 - Location Location `json:"location"` //定位坐标  
825 - CountLove int `json:"countLove"` // 点赞数量  
826 - CountComment int `json:"countComment"` // 评论数量  
827 - CountRead int `json:"countRead"` // 浏览数量  
828 - Show int `json:"show"` // 评论的展示状态(1显示、2不显示)  
829 - Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)  
830 - MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)  
831 - MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)  
832 - Tags []string `json:"tags"` // 文章的标签 825 + Id int64 `json:"id"` //id
  826 + Title string `json:"title"` //标题
  827 + AuthorId int64 `json:"authorId"` //发布人id
  828 + Author ArticleAuthor `json:"author"` //发布人
  829 + CreatedAt int64 `json:"createdAt"` //文章的发布时间
  830 + Section []ArticleSection `json:"section"` //文章的文本内容
  831 + Images []string `json:"images"` //图片
  832 + WhoRead []int64 `json:"whoRead"` //谁可查看
  833 + WhoReview []int64 `json:"whoReview"` //谁可评论
  834 + Location Location `json:"location"` //定位坐标
  835 + CountLove int `json:"countLove"` // 点赞数量
  836 + CountComment int `json:"countComment"` // 评论数量
  837 + CountRead int `json:"countRead"` // 浏览数量
  838 + Show int `json:"show"` // 评论的展示状态(1显示、2不显示)
  839 + Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)
  840 + MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)
  841 + MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)
  842 + Tags []string `json:"tags"` // 文章的标签
  843 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
833 } 844 }
834 845
835 type ArticleSection struct { 846 type ArticleSection struct {
@@ -941,15 +952,16 @@ type MiniArticleMarkUserReadResponse struct { @@ -941,15 +952,16 @@ type MiniArticleMarkUserReadResponse struct {
941 } 952 }
942 953
943 type MiniArticleDraftCreateRequest struct { 954 type MiniArticleDraftCreateRequest struct {
944 - CompanyId int64 `json:",optional"`  
945 - AuthorId int64 `json:",optional"` // 发布人  
946 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
947 - Section []string `json:"section"` // 填写的内容  
948 - Title string `json:"title"` // 标题  
949 - Images []string `json:"images"` // 图片  
950 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
951 - WhoReview []int64 `json:"whoReview"` // 评论人  
952 - Location Location `json:"location"` // 坐标 955 + CompanyId int64 `json:",optional"`
  956 + AuthorId int64 `json:",optional"` // 发布人
  957 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  958 + Section []string `json:"section"` // 填写的内容
  959 + Title string `json:"title"` // 标题
  960 + Images []string `json:"images"` // 图片
  961 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  962 + WhoReview []int64 `json:"whoReview"` // 评论人
  963 + Location Location `json:"location"` // 坐标
  964 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
953 } 965 }
954 966
955 type MiniArticleDraftCreateResponse struct { 967 type MiniArticleDraftCreateResponse struct {
@@ -957,16 +969,17 @@ type MiniArticleDraftCreateResponse struct { @@ -957,16 +969,17 @@ type MiniArticleDraftCreateResponse struct {
957 } 969 }
958 970
959 type MiniArticleDraftUpdateRequest struct { 971 type MiniArticleDraftUpdateRequest struct {
960 - Id int64 `json:"id"`  
961 - CompanyId int64 `json:",optional"`  
962 - AuthorId int64 `json:",optional"` // 发布人  
963 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
964 - Section []string `json:"section"` // 填写的内容  
965 - Title string `json:"title"` // 标题  
966 - Images []string `json:"images"` // 图片  
967 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
968 - WhoReview []int64 `json:"whoReview"` // 评论人  
969 - Location Location `json:"location"` // 坐标 972 + Id int64 `json:"id"`
  973 + CompanyId int64 `json:",optional"`
  974 + AuthorId int64 `json:",optional"` // 发布人
  975 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  976 + Section []string `json:"section"` // 填写的内容
  977 + Title string `json:"title"` // 标题
  978 + Images []string `json:"images"` // 图片
  979 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  980 + WhoReview []int64 `json:"whoReview"` // 评论人
  981 + Location Location `json:"location"` // 坐标
  982 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
970 } 983 }
971 984
972 type MiniArticleDraftUpdateResponse struct { 985 type MiniArticleDraftUpdateResponse struct {
@@ -986,12 +999,13 @@ type MiniArticleDraftSearchMeResponse struct { @@ -986,12 +999,13 @@ type MiniArticleDraftSearchMeResponse struct {
986 } 999 }
987 1000
988 type MiniArticleDraftItem struct { 1001 type MiniArticleDraftItem struct {
989 - Id int64 `json:"id"`  
990 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
991 - Section []string `json:"section"` // 填写的内容  
992 - Title string `json:"title"` // 标题  
993 - Images []string `json:"images"` // 图片  
994 - CreatedAt int64 `json:"createdAt"` 1002 + Id int64 `json:"id"`
  1003 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  1004 + Section []string `json:"section"` // 填写的内容
  1005 + Title string `json:"title"` // 标题
  1006 + Images []string `json:"images"` // 图片
  1007 + CreatedAt int64 `json:"createdAt"` //
  1008 + MatchUrl map[string]string `json:"matchUrl"` //匹配内容中的url文本
995 } 1009 }
996 1010
997 type MiniArticleDraftGetMeRequest struct { 1011 type MiniArticleDraftGetMeRequest struct {
@@ -1001,14 +1015,15 @@ type MiniArticleDraftGetMeRequest struct { @@ -1001,14 +1015,15 @@ type MiniArticleDraftGetMeRequest struct {
1001 } 1015 }
1002 1016
1003 type MiniArticleDraftGetMeResponse struct { 1017 type MiniArticleDraftGetMeResponse struct {
1004 - Id int64 `json:"id"` //  
1005 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
1006 - Section []string `json:"section"` // 填写的内容  
1007 - Title string `json:"title"` // 标题  
1008 - Images []string `json:"images"` // 图片  
1009 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
1010 - WhoReview []int64 `json:"whoReview"` // 评论人  
1011 - Location Location `json:"location"` // 坐标 1018 + Id int64 `json:"id"` //
  1019 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  1020 + Section []string `json:"section"` // 填写的内容
  1021 + Title string `json:"title"` // 标题
  1022 + Images []string `json:"images"` // 图片
  1023 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  1024 + WhoReview []int64 `json:"whoReview"` // 评论人
  1025 + Location Location `json:"location"` // 坐标
  1026 + MatchUrl map[string]string `json:"matchUrl"` //
1012 } 1027 }
1013 1028
1014 type MiniArticleDraftDeleteMeRequest struct { 1029 type MiniArticleDraftDeleteMeRequest struct {
@@ -1071,6 +1086,7 @@ type ArticleTagItem struct { @@ -1071,6 +1086,7 @@ type ArticleTagItem struct {
1071 Category string `json:"category"` 1086 Category string `json:"category"`
1072 Name string `json:"name"` 1087 Name string `json:"name"`
1073 Image string `json:"image"` 1088 Image string `json:"image"`
  1089 + SortBy int `json:"sortBy"`
1074 } 1090 }
1075 1091
1076 type SystemArticleGetRequest struct { 1092 type SystemArticleGetRequest struct {
@@ -1230,6 +1246,7 @@ type ArticleTagCount struct { @@ -1230,6 +1246,7 @@ type ArticleTagCount struct {
1230 TagRemark string `json:"tagRemark"` // 标签备注 1246 TagRemark string `json:"tagRemark"` // 标签备注
1231 TotalArticle int `json:"totalArticle"` // 总的文章数量 1247 TotalArticle int `json:"totalArticle"` // 总的文章数量
1232 ReadArticle int `json:"readArticle"` // 已读的标签数量 1248 ReadArticle int `json:"readArticle"` // 已读的标签数量
  1249 + SortBy int `json:"sortBy"` // 排序
1233 } 1250 }
1234 1251
1235 type MiniSearchArticleRequest struct { 1252 type MiniSearchArticleRequest struct {
@@ -31,6 +31,7 @@ type Article struct { @@ -31,6 +31,7 @@ type Article struct {
31 Tags []int64 `gorm:"type:jsonb;serializer:json"` //定性标签 31 Tags []int64 `gorm:"type:jsonb;serializer:json"` //定性标签
32 Show int // 评论的展示状态(0显示、1不显示) 32 Show int // 评论的展示状态(0显示、1不显示)
33 Summary string // 内容概要 33 Summary string // 内容概要
  34 + MatchUrl map[string]string `gorm:"type:jsonb;serializer:json"` // 匹配文章内容中的url文本
34 } 35 }
35 36
36 func (m *Article) TableName() string { 37 func (m *Article) TableName() string {
@@ -28,6 +28,7 @@ type ArticleBackup struct { @@ -28,6 +28,7 @@ type ArticleBackup struct {
28 Tags []int64 `gorm:"type:jsonb;serializer:json"` // 标签 28 Tags []int64 `gorm:"type:jsonb;serializer:json"` // 标签
29 Location domain.Location `gorm:"type:jsonb;serializer:json"` // 坐标 29 Location domain.Location `gorm:"type:jsonb;serializer:json"` // 坐标
30 TargetUser int // 分发方式 0 分发给所有人 1 分发给指定的人 30 TargetUser int // 分发方式 0 分发给所有人 1 分发给指定的人
  31 + MatchUrl map[string]string `gorm:"type:jsonb;serializer:json"` // 匹配文章内容中的url文本
31 } 32 }
32 33
33 func (m *ArticleBackup) TableName() string { 34 func (m *ArticleBackup) TableName() string {
@@ -27,11 +27,13 @@ type ArticleComment struct { @@ -27,11 +27,13 @@ type ArticleComment struct {
27 ToUserId int64 // 回复谁的评论 27 ToUserId int64 // 回复谁的评论
28 ToUser domain.UserSimple `gorm:"type:jsonb;serializer:json"` // 回复谁的评论 28 ToUser domain.UserSimple `gorm:"type:jsonb;serializer:json"` // 回复谁的评论
29 AtWho []domain.UserSimple `gorm:"type:jsonb;serializer:json"` // 填写评论@的人 29 AtWho []domain.UserSimple `gorm:"type:jsonb;serializer:json"` // 填写评论@的人
  30 + MatchUrl map[string]string `gorm:"type:jsonb;serializer:json"` // 评论内容中出现的url. 用于页面上进行匹配文本后进行特殊显示处理
30 Content string // 评论内容 31 Content string // 评论内容
31 CountReply int // 回复数量 32 CountReply int // 回复数量
32 CountUserLove int // 用户点赞数量 33 CountUserLove int // 用户点赞数量
33 CountAdminLove int // 运营点赞数量 34 CountAdminLove int // 运营点赞数量
34 Show int // 评论的展示状态(0显示、1不显示) 35 Show int // 评论的展示状态(0显示、1不显示)
  36 +
35 } 37 }
36 38
37 func (m *ArticleComment) TableName() string { 39 func (m *ArticleComment) TableName() string {
@@ -17,14 +17,15 @@ type ArticleDraft struct { @@ -17,14 +17,15 @@ type ArticleDraft struct {
17 IsDel soft_delete.DeletedAt `gorm:"softDelete:flag,DeletedAtField:DeletedAt"` 17 IsDel soft_delete.DeletedAt `gorm:"softDelete:flag,DeletedAtField:DeletedAt"`
18 DeletedAt int64 18 DeletedAt int64
19 Version int 19 Version int
20 - Template int // 填写内容时用的样板0、无 1、演绎式 2、归纳式  
21 - Content []string `gorm:"type:jsonb;serializer:json"` // 文章内容  
22 - AuthorId int64 // 发布人  
23 - Title string // 文章标题  
24 - Images []domain.Image `gorm:"type:jsonb;serializer:json"` // 图片  
25 - WhoRead []int64 `gorm:"type:jsonb;serializer:json"` // 谁可以看  
26 - WhoReview []int64 `gorm:"type:jsonb;serializer:json"` // 评论人  
27 - Location domain.Location `gorm:"type:jsonb;serializer:json"` // 坐标 20 + Template int // 填写内容时用的样板0、无 1、演绎式 2、归纳式
  21 + Content []string `gorm:"type:jsonb;serializer:json"` // 文章内容
  22 + AuthorId int64 // 发布人
  23 + Title string // 文章标题
  24 + Images []domain.Image `gorm:"type:jsonb;serializer:json"` // 图片
  25 + WhoRead []int64 `gorm:"type:jsonb;serializer:json"` // 谁可以看
  26 + WhoReview []int64 `gorm:"type:jsonb;serializer:json"` // 评论人
  27 + Location domain.Location `gorm:"type:jsonb;serializer:json"` // 坐标
  28 + MatchUrl map[string]string `gorm:"type:jsonb;serializer:json"` // 匹配文章内容中的url文本
28 } 29 }
29 30
30 func (m *ArticleDraft) TableName() string { 31 func (m *ArticleDraft) TableName() string {
@@ -17,6 +17,7 @@ type UserLoveFlag struct { @@ -17,6 +17,7 @@ type UserLoveFlag struct {
17 CommentAuthor int64 // 评论的填写人 17 CommentAuthor int64 // 评论的填写人
18 UserId int64 18 UserId int64
19 ToUserId int64 19 ToUserId int64
  20 + CompanyId int64
20 CreatedAt int64 21 CreatedAt int64
21 UpdatedAt int64 22 UpdatedAt int64
22 DeletedAt int64 23 DeletedAt int64
@@ -171,6 +171,7 @@ func (repository *ArticleBackupRepository) ModelToDomainModel(from *models.Artic @@ -171,6 +171,7 @@ func (repository *ArticleBackupRepository) ModelToDomainModel(from *models.Artic
171 WhoRead: from.WhoRead, 171 WhoRead: from.WhoRead,
172 WhoReview: from.WhoReview, 172 WhoReview: from.WhoReview,
173 Tags: from.Tags, 173 Tags: from.Tags,
  174 + MatchUrl: from.MatchUrl,
174 } 175 }
175 // err := copier.Copy(to, from) 176 // err := copier.Copy(to, from)
176 return to, nil 177 return to, nil
@@ -193,9 +194,10 @@ func (repository *ArticleBackupRepository) DomainModelToModel(from *domain.Artic @@ -193,9 +194,10 @@ func (repository *ArticleBackupRepository) DomainModelToModel(from *domain.Artic
193 Action: from.Action, 194 Action: from.Action,
194 WhoRead: from.WhoRead, 195 WhoRead: from.WhoRead,
195 WhoReview: from.WhoReview, 196 WhoReview: from.WhoReview,
196 - Location: from.Location,  
197 Tags: from.Tags, 197 Tags: from.Tags,
  198 + Location: from.Location,
198 TargetUser: int(from.TargetUser), 199 TargetUser: int(from.TargetUser),
  200 + MatchUrl: from.MatchUrl,
199 } 201 }
200 // err := copier.Copy(to, from) 202 // err := copier.Copy(to, from)
201 return to, nil 203 return to, nil
@@ -199,6 +199,7 @@ func (repository *ArticleCommentRepository) ModelToDomainModel(from *models.Arti @@ -199,6 +199,7 @@ func (repository *ArticleCommentRepository) ModelToDomainModel(from *models.Arti
199 CountAdminLove: from.CountAdminLove, 199 CountAdminLove: from.CountAdminLove,
200 Show: domain.CommentShow(from.Show), 200 Show: domain.CommentShow(from.Show),
201 AtWho: from.AtWho, 201 AtWho: from.AtWho,
  202 + MatchUrl: from.MatchUrl,
202 } 203 }
203 // err := copier.Copy(to, from) 204 // err := copier.Copy(to, from)
204 return to, nil 205 return to, nil
@@ -228,6 +229,7 @@ func (repository *ArticleCommentRepository) DomainModelToModel(from *domain.Arti @@ -228,6 +229,7 @@ func (repository *ArticleCommentRepository) DomainModelToModel(from *domain.Arti
228 CountUserLove: from.CountUserLove, 229 CountUserLove: from.CountUserLove,
229 CountAdminLove: from.CountAdminLove, 230 CountAdminLove: from.CountAdminLove,
230 Show: int(from.Show), 231 Show: int(from.Show),
  232 + MatchUrl: from.MatchUrl,
231 } 233 }
232 // err := copier.Copy(to, from) 234 // err := copier.Copy(to, from)
233 return to, nil 235 return to, nil
@@ -156,6 +156,7 @@ func (repository *ArticleDraftRepository) ModelToDomainModel(from *models.Articl @@ -156,6 +156,7 @@ func (repository *ArticleDraftRepository) ModelToDomainModel(from *models.Articl
156 WhoRead: from.WhoRead, 156 WhoRead: from.WhoRead,
157 WhoReview: from.WhoReview, 157 WhoReview: from.WhoReview,
158 Location: from.Location, 158 Location: from.Location,
  159 + MatchUrl: from.MatchUrl,
159 } 160 }
160 // err := copier.Copy(to, from) 161 // err := copier.Copy(to, from)
161 return to, nil 162 return to, nil
@@ -177,6 +178,7 @@ func (repository *ArticleDraftRepository) DomainModelToModel(from *domain.Articl @@ -177,6 +178,7 @@ func (repository *ArticleDraftRepository) DomainModelToModel(from *domain.Articl
177 WhoRead: from.WhoRead, 178 WhoRead: from.WhoRead,
178 WhoReview: from.WhoReview, 179 WhoReview: from.WhoReview,
179 Location: from.Location, 180 Location: from.Location,
  181 + MatchUrl: from.MatchUrl,
180 } 182 }
181 // err := copier.Copy(to, from) 183 // err := copier.Copy(to, from)
182 return to, nil 184 return to, nil
@@ -304,6 +304,7 @@ func (repository *ArticleRepository) ModelToDomainModel(from *models.Article) (* @@ -304,6 +304,7 @@ func (repository *ArticleRepository) ModelToDomainModel(from *models.Article) (*
304 Show: domain.ArticleShow(from.Show), 304 Show: domain.ArticleShow(from.Show),
305 Tags: from.Tags, 305 Tags: from.Tags,
306 Summary: from.Summary, 306 Summary: from.Summary,
  307 + MatchUrl: from.MatchUrl,
307 } 308 }
308 return to, nil 309 return to, nil
309 } 310 }
@@ -328,9 +329,10 @@ func (repository *ArticleRepository) DomainModelToModel(from *domain.Article) (* @@ -328,9 +329,10 @@ func (repository *ArticleRepository) DomainModelToModel(from *domain.Article) (*
328 CountLove: from.CountLove, 329 CountLove: from.CountLove,
329 CountRead: from.CountRead, 330 CountRead: from.CountRead,
330 CountComment: from.CountComment, 331 CountComment: from.CountComment,
331 - Show: int(from.Show),  
332 Tags: from.Tags, 332 Tags: from.Tags,
  333 + Show: int(from.Show),
333 Summary: from.Summary, 334 Summary: from.Summary,
  335 + MatchUrl: from.MatchUrl,
334 } 336 }
335 // err := copier.Copy(to, from) 337 // err := copier.Copy(to, from)
336 return to, nil 338 return to, nil
@@ -164,6 +164,7 @@ func (repository *UserLoveFlagRepository) ModelToDomainModel(from *models.UserLo @@ -164,6 +164,7 @@ func (repository *UserLoveFlagRepository) ModelToDomainModel(from *models.UserLo
164 CommentId: from.CommentId, 164 CommentId: from.CommentId,
165 UserId: from.UserId, 165 UserId: from.UserId,
166 ToUserId: from.ToUserId, 166 ToUserId: from.ToUserId,
  167 + CompanyId: from.CompanyId,
167 CreatedAt: from.CreatedAt, 168 CreatedAt: from.CreatedAt,
168 UpdatedAt: from.UpdatedAt, 169 UpdatedAt: from.UpdatedAt,
169 DeletedAt: from.DeletedAt, 170 DeletedAt: from.DeletedAt,
@@ -182,6 +183,7 @@ func (repository *UserLoveFlagRepository) DomainModelToModel(from *domain.UserLo @@ -182,6 +183,7 @@ func (repository *UserLoveFlagRepository) DomainModelToModel(from *domain.UserLo
182 CommentAuthor: from.CommentAuthor, 183 CommentAuthor: from.CommentAuthor,
183 UserId: from.UserId, 184 UserId: from.UserId,
184 ToUserId: from.ToUserId, 185 ToUserId: from.ToUserId,
  186 + CompanyId: from.CompanyId,
185 CreatedAt: from.CreatedAt, 187 CreatedAt: from.CreatedAt,
186 UpdatedAt: from.UpdatedAt, 188 UpdatedAt: from.UpdatedAt,
187 DeletedAt: from.DeletedAt, 189 DeletedAt: from.DeletedAt,
@@ -8,26 +8,27 @@ import ( @@ -8,26 +8,27 @@ import (
8 8
9 // 文章 9 // 文章
10 type Article struct { 10 type Article struct {
11 - Id int64 `json:"id"`  
12 - CompanyId int64 `json:"companyId"`  
13 - CreatedAt int64 `json:"createdAt,omitempty"`  
14 - UpdatedAt int64 `json:"updatedAt,omitempty"`  
15 - DeletedAt int64 `json:"deletedAt,omitempty"`  
16 - Version int `json:"version,omitempty"`  
17 - AuthorId int64 `json:"authorId"` // 发布人  
18 - Author UserSimple `json:"author"` // 发布人  
19 - Title string `json:"title"` // 文章标题  
20 - Images []Image `json:"images"` // 图片  
21 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
22 - WhoReview []int64 `json:"whoReview"` // 评论人  
23 - Location Location `json:"location"` // 坐标  
24 - TargetUser ArticleTarget `json:"targetUser"` // 分发方式 0 分发给所有人 1 分发给指定的人  
25 - CountLove int `json:"countLove"` // 点赞数量  
26 - CountComment int `json:"countComment"` // 评论数量  
27 - CountRead int `json:"countRead"` // 浏览数量  
28 - Show ArticleShow `json:"show"` // 评论的展示状态(1显示,2不显示、)  
29 - Tags []int64 `json:"tags"` // 定性标签  
30 - Summary string `json:"summary"` // 内容概要 11 + Id int64 `json:"id"`
  12 + CompanyId int64 `json:"companyId"`
  13 + CreatedAt int64 `json:"createdAt,omitempty"`
  14 + UpdatedAt int64 `json:"updatedAt,omitempty"`
  15 + DeletedAt int64 `json:"deletedAt,omitempty"`
  16 + Version int `json:"version,omitempty"`
  17 + AuthorId int64 `json:"authorId"` // 发布人
  18 + Author UserSimple `json:"author"` // 发布人
  19 + Title string `json:"title"` // 文章标题
  20 + Images []Image `json:"images"` // 图片
  21 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  22 + WhoReview []int64 `json:"whoReview"` // 评论人
  23 + Location Location `json:"location"` // 坐标
  24 + TargetUser ArticleTarget `json:"targetUser"` // 分发方式 0 分发给所有人 1 分发给指定的人
  25 + CountLove int `json:"countLove"` // 点赞数量
  26 + CountComment int `json:"countComment"` // 评论数量
  27 + CountRead int `json:"countRead"` // 浏览数量
  28 + Show ArticleShow `json:"show"` // 评论的展示状态(1显示,2不显示、)
  29 + Tags []int64 `json:"tags"` // 定性标签
  30 + Summary string `json:"summary"` // 内容概要
  31 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
31 // ...more 32 // ...more
32 } 33 }
33 34
@@ -110,6 +111,11 @@ func (m *Article) MakeBackup(operator UserSimple, section []ArticleSection) *Art @@ -110,6 +111,11 @@ func (m *Article) MakeBackup(operator UserSimple, section []ArticleSection) *Art
110 WhoRead: m.WhoRead, 111 WhoRead: m.WhoRead,
111 WhoReview: m.WhoReview, 112 WhoReview: m.WhoReview,
112 Tags: m.Tags, 113 Tags: m.Tags,
  114 + MatchUrl: map[string]string{},
  115 + }
  116 +
  117 + for k, v := range m.MatchUrl {
  118 + b.MatchUrl[k] = v
113 } 119 }
114 return &b 120 return &b
115 } 121 }
@@ -8,23 +8,24 @@ import ( @@ -8,23 +8,24 @@ import (
8 8
9 // 编辑文章后保存的历史记录 9 // 编辑文章后保存的历史记录
10 type ArticleBackup struct { 10 type ArticleBackup struct {
11 - Id int64 `json:"id"`  
12 - CompanyId int64 `json:"companyId"`  
13 - CreatedAt int64 `json:"createdAt,omitempty"`  
14 - UpdatedAt int64 `json:"updatedAt,omitempty"`  
15 - DeletedAt int64 `json:"deletedAt,omitempty"`  
16 - Version int `json:"version,omitempty"`  
17 - Operator UserSimple `json:"operator"` // 操作人  
18 - ArticleId int64 `json:"articleId"` //  
19 - Title string `json:"title"` // 标题  
20 - Section []ArticleSection `json:"section"` // 分段内容  
21 - Images []Image `json:"images"` // 图片  
22 - Action string `json:"action"` // 操作  
23 - TargetUser ArticleTarget `json:"targetUser"` // 分发方式 0 分发给所有人 1 分发给指定的人  
24 - Location Location `json:"location"` // 定位坐标  
25 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
26 - WhoReview []int64 `json:"whoReview"` // 评论人  
27 - Tags []int64 `json:"tags"` // 标签 11 + Id int64 `json:"id"`
  12 + CompanyId int64 `json:"companyId"`
  13 + CreatedAt int64 `json:"createdAt,omitempty"`
  14 + UpdatedAt int64 `json:"updatedAt,omitempty"`
  15 + DeletedAt int64 `json:"deletedAt,omitempty"`
  16 + Version int `json:"version,omitempty"`
  17 + Operator UserSimple `json:"operator"` // 操作人
  18 + ArticleId int64 `json:"articleId"` //
  19 + Title string `json:"title"` // 标题
  20 + Section []ArticleSection `json:"section"` // 分段内容
  21 + Images []Image `json:"images"` // 图片
  22 + Action string `json:"action"` // 操作
  23 + TargetUser ArticleTarget `json:"targetUser"` // 分发方式 0 分发给所有人 1 分发给指定的人
  24 + Location Location `json:"location"` // 定位坐标
  25 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  26 + WhoReview []int64 `json:"whoReview"` // 评论人
  27 + Tags []int64 `json:"tags"` // 标签
  28 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
28 } 29 }
29 30
30 type ArticleBackupRepository interface { 31 type ArticleBackupRepository interface {
@@ -8,27 +8,28 @@ import ( @@ -8,27 +8,28 @@ import (
8 8
9 // 文章评论 9 // 文章评论
10 type ArticleComment struct { 10 type ArticleComment struct {
11 - Id int64 `json:"id"` // 评论id  
12 - CompanyId int64 `json:"companyId"`  
13 - CreatedAt int64 `json:"createdAt,omitempty"`  
14 - UpdatedAt int64 `json:"updatedAt,omitempty"`  
15 - DeletedAt int64 `json:"deletedAt,omitempty"`  
16 - Version int `json:"version,omitempty"`  
17 - Pid int64 `json:"pid"` // 对哪个评论进行回复  
18 - TopId int64 `json:"topId"` // 归属于最上级的哪个评论  
19 - ArticleId int64 `json:"articleId"` // 文章id  
20 - SectionId int64 `json:"sectionId"` // 文本段落内容id  
21 - SectionContent string `json:"sectionContent"` // 引用的文章内容文本  
22 - FromUserId int64 `json:"fromUserId"` // 谁填写的评论  
23 - FromUser UserSimple `json:"fromUser"` // 谁填写的评论  
24 - ToUserId int64 `json:"toUserId"` // 回复谁的评论  
25 - ToUser UserSimple `json:"toUser"` // 回复谁的评论  
26 - Content string `json:"content"` // 评论内容  
27 - CountReply int `json:"countReply"` // 回复数量  
28 - CountUserLove int `json:"countUserLove"` // 用户点赞数量  
29 - CountAdminLove int `json:"countAdminLove"` // 运营点赞数量  
30 - Show CommentShow `json:"showState"` // 评论的展示状态(1显示、2不显示)  
31 - AtWho []UserSimple `json:"atWho"` // 填写评论时@的人 11 + Id int64 `json:"id"` // 评论id
  12 + CompanyId int64 `json:"companyId"`
  13 + CreatedAt int64 `json:"createdAt,omitempty"`
  14 + UpdatedAt int64 `json:"updatedAt,omitempty"`
  15 + DeletedAt int64 `json:"deletedAt,omitempty"`
  16 + Version int `json:"version,omitempty"`
  17 + Pid int64 `json:"pid"` // 对哪个评论进行回复
  18 + TopId int64 `json:"topId"` // 归属于最上级的哪个评论
  19 + ArticleId int64 `json:"articleId"` // 文章id
  20 + SectionId int64 `json:"sectionId"` // 文本段落内容id
  21 + SectionContent string `json:"sectionContent"` // 引用的文章内容文本
  22 + FromUserId int64 `json:"fromUserId"` // 谁填写的评论
  23 + FromUser UserSimple `json:"fromUser"` // 谁填写的评论
  24 + ToUserId int64 `json:"toUserId"` // 回复谁的评论
  25 + ToUser UserSimple `json:"toUser"` // 回复谁的评论
  26 + Content string `json:"content"` // 评论内容
  27 + CountReply int `json:"countReply"` // 回复数量
  28 + CountUserLove int `json:"countUserLove"` // 用户点赞数量
  29 + CountAdminLove int `json:"countAdminLove"` // 运营点赞数量
  30 + Show CommentShow `json:"showState"` // 评论的展示状态(1显示、2不显示)
  31 + AtWho []UserSimple `json:"atWho"` // 填写评论时@的人. 评论内容中出现的@人,用于页面上进行匹配文本后进行特殊显示处理
  32 + MatchUrl map[string]string `json:"matchUrl"` // 评论内容中出现的url. 用于页面上进行匹配文本后进行特殊显示处理
32 // ...more 33 // ...more
33 } 34 }
34 35
@@ -9,20 +9,21 @@ import ( @@ -9,20 +9,21 @@ import (
9 // 填写文章时保存的草稿 9 // 填写文章时保存的草稿
10 10
11 type ArticleDraft struct { 11 type ArticleDraft struct {
12 - Id int64 `json:"id"`  
13 - CompanyId int64 `json:"companyId"`  
14 - CreatedAt int64 `json:"createdAt,omitempty"`  
15 - UpdatedAt int64 `json:"updatedAt,omitempty"`  
16 - DeletedAt int64 `json:"deletedAt,omitempty"`  
17 - Version int `json:"version,omitempty"`  
18 - Template int `json:"template"` // 填写内容时用的样板0、无 1、演绎式 2、归纳式  
19 - Content []string `json:"content"` // 文章内容  
20 - AuthorId int64 `json:"authorId"` // 发布人  
21 - Title string `json:"title"` // 文章标题  
22 - Images []Image `json:"images"` // 图片  
23 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
24 - WhoReview []int64 `json:"whoReview"` // 评论人  
25 - Location Location `json:"location"` // 坐标 12 + Id int64 `json:"id"`
  13 + CompanyId int64 `json:"companyId"`
  14 + CreatedAt int64 `json:"createdAt,omitempty"`
  15 + UpdatedAt int64 `json:"updatedAt,omitempty"`
  16 + DeletedAt int64 `json:"deletedAt,omitempty"`
  17 + Version int `json:"version,omitempty"`
  18 + Template int `json:"template"` // 填写内容时用的样板0、无 1、演绎式 2、归纳式
  19 + Content []string `json:"content"` // 文章内容
  20 + AuthorId int64 `json:"authorId"` // 发布人
  21 + Title string `json:"title"` // 文章标题
  22 + Images []Image `json:"images"` // 图片
  23 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  24 + WhoReview []int64 `json:"whoReview"` // 评论人
  25 + Location Location `json:"location"` // 坐标
  26 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
26 } 27 }
27 type ArticleDraftRepository interface { 28 type ArticleDraftRepository interface {
28 Insert(ctx context.Context, conn transaction.Conn, dm *ArticleDraft) (*ArticleDraft, error) 29 Insert(ctx context.Context, conn transaction.Conn, dm *ArticleDraft) (*ArticleDraft, error)
@@ -2,6 +2,7 @@ package domain @@ -2,6 +2,7 @@ package domain
2 2
3 import ( 3 import (
4 "context" 4 "context"
  5 + "fmt"
5 6
6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction" 7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
7 ) 8 )
@@ -22,6 +23,7 @@ type ArticleTag struct { @@ -22,6 +23,7 @@ type ArticleTag struct {
22 SortBy int64 `json:"sortBy"` // 顺序 23 SortBy int64 `json:"sortBy"` // 顺序
23 Other string `json:"other"` // 24 Other string `json:"other"` //
24 } 25 }
  26 +
25 type ArticleTagRepository interface { 27 type ArticleTagRepository interface {
26 Insert(ctx context.Context, conn transaction.Conn, dm *ArticleTag) (*ArticleTag, error) 28 Insert(ctx context.Context, conn transaction.Conn, dm *ArticleTag) (*ArticleTag, error)
27 CreateInBatches(ctx context.Context, conn transaction.Conn, dm []*ArticleTag) error 29 CreateInBatches(ctx context.Context, conn transaction.Conn, dm []*ArticleTag) error
@@ -31,3 +33,14 @@ type ArticleTagRepository interface { @@ -31,3 +33,14 @@ type ArticleTagRepository interface {
31 FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ArticleTag, error) 33 FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ArticleTag, error)
32 Find(ctx context.Context, conn transaction.Conn, companyId int64, queryOptions map[string]interface{}) (int64, []*ArticleTag, error) 34 Find(ctx context.Context, conn transaction.Conn, companyId int64, queryOptions map[string]interface{}) (int64, []*ArticleTag, error)
33 } 35 }
  36 +
  37 +func (m *ArticleTag) SetCategory(str string) error {
  38 + var err error
  39 + switch str {
  40 + case "紧急重要", "机会风险":
  41 + m.Category = str
  42 + default:
  43 + err = fmt.Errorf("ArticleTag.Category error")
  44 + }
  45 + return err
  46 +}
@@ -16,6 +16,7 @@ type UserLoveFlag struct { @@ -16,6 +16,7 @@ type UserLoveFlag struct {
16 CommentAuthor int64 `json:"commentAuthor"` // 评论的填写人 16 CommentAuthor int64 `json:"commentAuthor"` // 评论的填写人
17 ToUserId int64 `json:"toUserId"` // 点赞的接受人 17 ToUserId int64 `json:"toUserId"` // 点赞的接受人
18 UserId int64 `json:"userId"` // 点赞的人 18 UserId int64 `json:"userId"` // 点赞的人
  19 + CompanyId int64 `json:"companyId"` //
19 CreatedAt int64 `json:"createdAt,omitempty"` 20 CreatedAt int64 `json:"createdAt,omitempty"`
20 UpdatedAt int64 `json:"updatedAt,omitempty"` 21 UpdatedAt int64 `json:"updatedAt,omitempty"`
21 DeletedAt int64 `json:"deletedAt,omitempty"` 22 DeletedAt int64 `json:"deletedAt,omitempty"`