作者 tangxvhui

Merge branch 'dev' into test

@@ -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
@@ -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
@@ -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{
@@ -797,13 +797,14 @@ type ArticleAuthor struct { @@ -797,13 +797,14 @@ type ArticleAuthor struct {
797 } 797 }
798 798
799 type MiniArticleCreateRequest struct { 799 type MiniArticleCreateRequest struct {
800 - Title string `json:"title"` //标题  
801 - Section []string `json:"section"` //文章的文本内容  
802 - AuthorId int64 `json:"authorId,optional"` //发布人id  
803 - Images []string `json:"images,optional"` //图片  
804 - WhoRead []int64 `json:"whoRead,optional"` //谁可查看  
805 - WhoReview []int64 `json:"whoReview,optional"` //谁可评论  
806 - Location Location `json:"location,optional"` //定位坐标 800 + Title string `json:"title"` //标题
  801 + Section []string `json:"section"` //文章的文本内容
  802 + AuthorId int64 `json:"authorId,optional"` //发布人id
  803 + Images []string `json:"images,optional"` //图片
  804 + WhoRead []int64 `json:"whoRead,optional"` //谁可查看
  805 + WhoReview []int64 `json:"whoReview,optional"` //谁可评论
  806 + Location Location `json:"location,optional"` //定位坐标
  807 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
807 } 808 }
808 809
809 type MiniArticleCreateResponse struct { 810 type MiniArticleCreateResponse struct {
@@ -817,24 +818,25 @@ type MiniArticleGetRequest struct { @@ -817,24 +818,25 @@ type MiniArticleGetRequest struct {
817 } 818 }
818 819
819 type MiniArticleGetResponse struct { 820 type MiniArticleGetResponse struct {
820 - Id int64 `json:"id"` //id  
821 - Title string `json:"title"` //标题  
822 - AuthorId int64 `json:"authorId"` //发布人id  
823 - Author ArticleAuthor `json:"author"` //发布人  
824 - CreatedAt int64 `json:"createdAt"` //文章的发布时间  
825 - Section []ArticleSection `json:"section"` //文章的文本内容  
826 - Images []string `json:"images"` //图片  
827 - WhoRead []int64 `json:"whoRead"` //谁可查看  
828 - WhoReview []int64 `json:"whoReview"` //谁可评论  
829 - Location Location `json:"location"` //定位坐标  
830 - CountLove int `json:"countLove"` // 点赞数量  
831 - CountComment int `json:"countComment"` // 评论数量  
832 - CountRead int `json:"countRead"` // 浏览数量  
833 - Show int `json:"show"` // 评论的展示状态(1显示、2不显示)  
834 - Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)  
835 - MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)  
836 - MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)  
837 - Tags []string `json:"tags"` // 文章的标签 821 + Id int64 `json:"id"` //id
  822 + Title string `json:"title"` //标题
  823 + AuthorId int64 `json:"authorId"` //发布人id
  824 + Author ArticleAuthor `json:"author"` //发布人
  825 + CreatedAt int64 `json:"createdAt"` //文章的发布时间
  826 + Section []ArticleSection `json:"section"` //文章的文本内容
  827 + Images []string `json:"images"` //图片
  828 + WhoRead []int64 `json:"whoRead"` //谁可查看
  829 + WhoReview []int64 `json:"whoReview"` //谁可评论
  830 + Location Location `json:"location"` //定位坐标
  831 + CountLove int `json:"countLove"` // 点赞数量
  832 + CountComment int `json:"countComment"` // 评论数量
  833 + CountRead int `json:"countRead"` // 浏览数量
  834 + Show int `json:"show"` // 评论的展示状态(1显示、2不显示)
  835 + Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)
  836 + MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)
  837 + MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)
  838 + Tags []string `json:"tags"` // 文章的标签
  839 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
838 } 840 }
839 841
840 type ArticleSection struct { 842 type ArticleSection struct {
@@ -946,15 +948,16 @@ type MiniArticleMarkUserReadResponse struct { @@ -946,15 +948,16 @@ type MiniArticleMarkUserReadResponse struct {
946 } 948 }
947 949
948 type MiniArticleDraftCreateRequest struct { 950 type MiniArticleDraftCreateRequest struct {
949 - CompanyId int64 `json:",optional"`  
950 - AuthorId int64 `json:",optional"` // 发布人  
951 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
952 - Section []string `json:"section"` // 填写的内容  
953 - Title string `json:"title"` // 标题  
954 - Images []string `json:"images"` // 图片  
955 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
956 - WhoReview []int64 `json:"whoReview"` // 评论人  
957 - Location Location `json:"location"` // 坐标 951 + CompanyId int64 `json:",optional"`
  952 + AuthorId int64 `json:",optional"` // 发布人
  953 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  954 + Section []string `json:"section"` // 填写的内容
  955 + Title string `json:"title"` // 标题
  956 + Images []string `json:"images"` // 图片
  957 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  958 + WhoReview []int64 `json:"whoReview"` // 评论人
  959 + Location Location `json:"location"` // 坐标
  960 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
958 } 961 }
959 962
960 type MiniArticleDraftCreateResponse struct { 963 type MiniArticleDraftCreateResponse struct {
@@ -962,16 +965,17 @@ type MiniArticleDraftCreateResponse struct { @@ -962,16 +965,17 @@ type MiniArticleDraftCreateResponse struct {
962 } 965 }
963 966
964 type MiniArticleDraftUpdateRequest struct { 967 type MiniArticleDraftUpdateRequest struct {
965 - Id int64 `json:"id"`  
966 - CompanyId int64 `json:",optional"`  
967 - AuthorId int64 `json:",optional"` // 发布人  
968 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
969 - Section []string `json:"section"` // 填写的内容  
970 - Title string `json:"title"` // 标题  
971 - Images []string `json:"images"` // 图片  
972 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
973 - WhoReview []int64 `json:"whoReview"` // 评论人  
974 - Location Location `json:"location"` // 坐标 968 + Id int64 `json:"id"`
  969 + CompanyId int64 `json:",optional"`
  970 + AuthorId int64 `json:",optional"` // 发布人
  971 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  972 + Section []string `json:"section"` // 填写的内容
  973 + Title string `json:"title"` // 标题
  974 + Images []string `json:"images"` // 图片
  975 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  976 + WhoReview []int64 `json:"whoReview"` // 评论人
  977 + Location Location `json:"location"` // 坐标
  978 + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本
975 } 979 }
976 980
977 type MiniArticleDraftUpdateResponse struct { 981 type MiniArticleDraftUpdateResponse struct {
@@ -991,12 +995,13 @@ type MiniArticleDraftSearchMeResponse struct { @@ -991,12 +995,13 @@ type MiniArticleDraftSearchMeResponse struct {
991 } 995 }
992 996
993 type MiniArticleDraftItem struct { 997 type MiniArticleDraftItem struct {
994 - Id int64 `json:"id"`  
995 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
996 - Section []string `json:"section"` // 填写的内容  
997 - Title string `json:"title"` // 标题  
998 - Images []string `json:"images"` // 图片  
999 - CreatedAt int64 `json:"createdAt"` 998 + Id int64 `json:"id"`
  999 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  1000 + Section []string `json:"section"` // 填写的内容
  1001 + Title string `json:"title"` // 标题
  1002 + Images []string `json:"images"` // 图片
  1003 + CreatedAt int64 `json:"createdAt"` //
  1004 + MatchUrl map[string]string `json:"matchUrl"` //匹配内容中的url文本
1000 } 1005 }
1001 1006
1002 type MiniArticleDraftGetMeRequest struct { 1007 type MiniArticleDraftGetMeRequest struct {
@@ -1006,14 +1011,15 @@ type MiniArticleDraftGetMeRequest struct { @@ -1006,14 +1011,15 @@ type MiniArticleDraftGetMeRequest struct {
1006 } 1011 }
1007 1012
1008 type MiniArticleDraftGetMeResponse struct { 1013 type MiniArticleDraftGetMeResponse struct {
1009 - Id int64 `json:"id"` //  
1010 - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式  
1011 - Section []string `json:"section"` // 填写的内容  
1012 - Title string `json:"title"` // 标题  
1013 - Images []string `json:"images"` // 图片  
1014 - WhoRead []int64 `json:"whoRead"` // 谁可以看  
1015 - WhoReview []int64 `json:"whoReview"` // 评论人  
1016 - Location Location `json:"location"` // 坐标 1014 + Id int64 `json:"id"` //
  1015 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  1016 + Section []string `json:"section"` // 填写的内容
  1017 + Title string `json:"title"` // 标题
  1018 + Images []string `json:"images"` // 图片
  1019 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  1020 + WhoReview []int64 `json:"whoReview"` // 评论人
  1021 + Location Location `json:"location"` // 坐标
  1022 + MatchUrl map[string]string `json:"matchUrl"` //
1017 } 1023 }
1018 1024
1019 type MiniArticleDraftDeleteMeRequest struct { 1025 type MiniArticleDraftDeleteMeRequest 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 {
@@ -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 {
@@ -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
@@ -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
@@ -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 {
@@ -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)