作者 tangxvhui

Merge branch 'dev' into test

@@ -26,6 +26,7 @@ type ( @@ -26,6 +26,7 @@ type (
26 WhoRead []int64 `json:"whoRead,optional"` //谁可查看 26 WhoRead []int64 `json:"whoRead,optional"` //谁可查看
27 WhoReview []int64 `json:"whoReview,optional"` //谁可评论 27 WhoReview []int64 `json:"whoReview,optional"` //谁可评论
28 Location Location `json:"location,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"`
@@ -58,6 +59,7 @@ type ( @@ -58,6 +59,7 @@ type (
58 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞) 59 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)
59 MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注) 60 MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)
60 Tags []string `json:"tags"` // 文章的标签 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 {
@@ -235,7 +239,8 @@ type ( @@ -235,7 +239,8 @@ type (
235 Section []string `json:"section"` // 填写的内容 239 Section []string `json:"section"` // 填写的内容
236 Title string `json:"title"` // 标题 240 Title string `json:"title"` // 标题
237 Images []string `json:"images"` // 图片 241 Images []string `json:"images"` // 图片
238 - CreatedAt int64 `json:"createdAt"` 242 + CreatedAt int64 `json:"createdAt"`//
  243 + MatchUrl map[string]string `json:"matchUrl"` //匹配内容中的url文本
239 } 244 }
240 ) 245 )
241 246
@@ -256,6 +261,7 @@ type ( @@ -256,6 +261,7 @@ type (
256 WhoRead []int64 `json:"whoRead"` // 谁可以看 261 WhoRead []int64 `json:"whoRead"` // 谁可以看
257 WhoReview []int64 `json:"whoReview"` // 评论人 262 WhoReview []int64 `json:"whoReview"` // 评论人
258 Location Location `json:"location"` // 坐标 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{
@@ -804,6 +804,7 @@ type MiniArticleCreateRequest struct { @@ -804,6 +804,7 @@ type MiniArticleCreateRequest struct {
804 WhoRead []int64 `json:"whoRead,optional"` //谁可查看 804 WhoRead []int64 `json:"whoRead,optional"` //谁可查看
805 WhoReview []int64 `json:"whoReview,optional"` //谁可评论 805 WhoReview []int64 `json:"whoReview,optional"` //谁可评论
806 Location Location `json:"location,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 {
@@ -835,6 +836,7 @@ type MiniArticleGetResponse struct { @@ -835,6 +836,7 @@ type MiniArticleGetResponse struct {
835 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞) 836 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)
836 MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注) 837 MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)
837 Tags []string `json:"tags"` // 文章的标签 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 {
@@ -955,6 +957,7 @@ type MiniArticleDraftCreateRequest struct { @@ -955,6 +957,7 @@ type MiniArticleDraftCreateRequest struct {
955 WhoRead []int64 `json:"whoRead"` // 谁可以看 957 WhoRead []int64 `json:"whoRead"` // 谁可以看
956 WhoReview []int64 `json:"whoReview"` // 评论人 958 WhoReview []int64 `json:"whoReview"` // 评论人
957 Location Location `json:"location"` // 坐标 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 {
@@ -972,6 +975,7 @@ type MiniArticleDraftUpdateRequest struct { @@ -972,6 +975,7 @@ type MiniArticleDraftUpdateRequest struct {
972 WhoRead []int64 `json:"whoRead"` // 谁可以看 975 WhoRead []int64 `json:"whoRead"` // 谁可以看
973 WhoReview []int64 `json:"whoReview"` // 评论人 976 WhoReview []int64 `json:"whoReview"` // 评论人
974 Location Location `json:"location"` // 坐标 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 {
@@ -996,7 +1000,8 @@ type MiniArticleDraftItem struct { @@ -996,7 +1000,8 @@ type MiniArticleDraftItem struct {
996 Section []string `json:"section"` // 填写的内容 1000 Section []string `json:"section"` // 填写的内容
997 Title string `json:"title"` // 标题 1001 Title string `json:"title"` // 标题
998 Images []string `json:"images"` // 图片 1002 Images []string `json:"images"` // 图片
999 - CreatedAt int64 `json:"createdAt"` 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 {
@@ -1014,6 +1019,7 @@ type MiniArticleDraftGetMeResponse struct { @@ -1014,6 +1019,7 @@ type MiniArticleDraftGetMeResponse struct {
1014 WhoRead []int64 `json:"whoRead"` // 谁可以看 1019 WhoRead []int64 `json:"whoRead"` // 谁可以看
1015 WhoReview []int64 `json:"whoReview"` // 评论人 1020 WhoReview []int64 `json:"whoReview"` // 评论人
1016 Location Location `json:"location"` // 坐标 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 {
@@ -25,6 +25,7 @@ type ArticleDraft struct { @@ -25,6 +25,7 @@ type ArticleDraft struct {
25 WhoRead []int64 `gorm:"type:jsonb;serializer:json"` // 谁可以看 25 WhoRead []int64 `gorm:"type:jsonb;serializer:json"` // 谁可以看
26 WhoReview []int64 `gorm:"type:jsonb;serializer:json"` // 评论人 26 WhoReview []int64 `gorm:"type:jsonb;serializer:json"` // 评论人
27 Location domain.Location `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
@@ -28,6 +28,7 @@ type Article struct { @@ -28,6 +28,7 @@ type Article struct {
28 Show ArticleShow `json:"show"` // 评论的展示状态(1显示,2不显示、) 28 Show ArticleShow `json:"show"` // 评论的展示状态(1显示,2不显示、)
29 Tags []int64 `json:"tags"` // 定性标签 29 Tags []int64 `json:"tags"` // 定性标签
30 Summary string `json:"summary"` // 内容概要 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 }
@@ -25,6 +25,7 @@ type ArticleBackup struct { @@ -25,6 +25,7 @@ type ArticleBackup struct {
25 WhoRead []int64 `json:"whoRead"` // 谁可以看 25 WhoRead []int64 `json:"whoRead"` // 谁可以看
26 WhoReview []int64 `json:"whoReview"` // 评论人 26 WhoReview []int64 `json:"whoReview"` // 评论人
27 Tags []int64 `json:"tags"` // 标签 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 {
@@ -23,6 +23,7 @@ type ArticleDraft struct { @@ -23,6 +23,7 @@ type ArticleDraft struct {
23 WhoRead []int64 `json:"whoRead"` // 谁可以看 23 WhoRead []int64 `json:"whoRead"` // 谁可以看
24 WhoReview []int64 `json:"whoReview"` // 评论人 24 WhoReview []int64 `json:"whoReview"` // 评论人
25 Location Location `json:"location"` // 坐标 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)