正在显示
8 个修改的文件
包含
31 行增加
和
2 行删除
| @@ -191,6 +191,7 @@ type ( | @@ -191,6 +191,7 @@ type ( | ||
| 191 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 191 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| 192 | WhoReview []int64 `json:"whoReview"` // 评论人 | 192 | WhoReview []int64 `json:"whoReview"` // 评论人 |
| 193 | Location Location `json:"location"` // 坐标 | 193 | Location Location `json:"location"` // 坐标 |
| 194 | + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本 | ||
| 194 | } | 195 | } |
| 195 | 196 | ||
| 196 | MiniArticleDraftCreateResponse { | 197 | MiniArticleDraftCreateResponse { |
| @@ -211,6 +212,7 @@ type ( | @@ -211,6 +212,7 @@ type ( | ||
| 211 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 212 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| 212 | WhoReview []int64 `json:"whoReview"` // 评论人 | 213 | WhoReview []int64 `json:"whoReview"` // 评论人 |
| 213 | Location Location `json:"location"` // 坐标 | 214 | Location Location `json:"location"` // 坐标 |
| 215 | + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本 | ||
| 214 | } | 216 | } |
| 215 | 217 | ||
| 216 | MiniArticleDraftUpdateResponse { | 218 | MiniArticleDraftUpdateResponse { |
| @@ -237,7 +239,8 @@ type ( | @@ -237,7 +239,8 @@ type ( | ||
| 237 | Section []string `json:"section"` // 填写的内容 | 239 | Section []string `json:"section"` // 填写的内容 |
| 238 | Title string `json:"title"` // 标题 | 240 | Title string `json:"title"` // 标题 |
| 239 | Images []string `json:"images"` // 图片 | 241 | Images []string `json:"images"` // 图片 |
| 240 | - CreatedAt int64 `json:"createdAt"` | 242 | + CreatedAt int64 `json:"createdAt"`// |
| 243 | + MatchUrl map[string]string `json:"matchUrl"` //匹配内容中的url文本 | ||
| 241 | } | 244 | } |
| 242 | ) | 245 | ) |
| 243 | 246 | ||
| @@ -258,6 +261,7 @@ type ( | @@ -258,6 +261,7 @@ type ( | ||
| 258 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 261 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| 259 | WhoReview []int64 `json:"whoReview"` // 评论人 | 262 | WhoReview []int64 `json:"whoReview"` // 评论人 |
| 260 | Location Location `json:"location"` // 坐标 | 263 | Location Location `json:"location"` // 坐标 |
| 264 | + MatchUrl map[string]string `json:"matchUrl"` // | ||
| 261 | } | 265 | } |
| 262 | ) | 266 | ) |
| 263 | 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) |
| @@ -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) |
| @@ -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{ |
| @@ -950,6 +950,7 @@ type MiniArticleDraftCreateRequest struct { | @@ -950,6 +950,7 @@ type MiniArticleDraftCreateRequest struct { | ||
| 950 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 950 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| 951 | WhoReview []int64 `json:"whoReview"` // 评论人 | 951 | WhoReview []int64 `json:"whoReview"` // 评论人 |
| 952 | Location Location `json:"location"` // 坐标 | 952 | Location Location `json:"location"` // 坐标 |
| 953 | + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本 | ||
| 953 | } | 954 | } |
| 954 | 955 | ||
| 955 | type MiniArticleDraftCreateResponse struct { | 956 | type MiniArticleDraftCreateResponse struct { |
| @@ -967,6 +968,7 @@ type MiniArticleDraftUpdateRequest struct { | @@ -967,6 +968,7 @@ type MiniArticleDraftUpdateRequest struct { | ||
| 967 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 968 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| 968 | WhoReview []int64 `json:"whoReview"` // 评论人 | 969 | WhoReview []int64 `json:"whoReview"` // 评论人 |
| 969 | Location Location `json:"location"` // 坐标 | 970 | Location Location `json:"location"` // 坐标 |
| 971 | + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本 | ||
| 970 | } | 972 | } |
| 971 | 973 | ||
| 972 | type MiniArticleDraftUpdateResponse struct { | 974 | type MiniArticleDraftUpdateResponse struct { |
| @@ -991,7 +993,8 @@ type MiniArticleDraftItem struct { | @@ -991,7 +993,8 @@ type MiniArticleDraftItem struct { | ||
| 991 | Section []string `json:"section"` // 填写的内容 | 993 | Section []string `json:"section"` // 填写的内容 |
| 992 | Title string `json:"title"` // 标题 | 994 | Title string `json:"title"` // 标题 |
| 993 | Images []string `json:"images"` // 图片 | 995 | Images []string `json:"images"` // 图片 |
| 994 | - CreatedAt int64 `json:"createdAt"` | 996 | + CreatedAt int64 `json:"createdAt"` // |
| 997 | + MatchUrl map[string]string `json:"matchUrl"` //匹配内容中的url文本 | ||
| 995 | } | 998 | } |
| 996 | 999 | ||
| 997 | type MiniArticleDraftGetMeRequest struct { | 1000 | type MiniArticleDraftGetMeRequest struct { |
| @@ -1009,6 +1012,7 @@ type MiniArticleDraftGetMeResponse struct { | @@ -1009,6 +1012,7 @@ type MiniArticleDraftGetMeResponse struct { | ||
| 1009 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 1012 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| 1010 | WhoReview []int64 `json:"whoReview"` // 评论人 | 1013 | WhoReview []int64 `json:"whoReview"` // 评论人 |
| 1011 | Location Location `json:"location"` // 坐标 | 1014 | Location Location `json:"location"` // 坐标 |
| 1015 | + MatchUrl map[string]string `json:"matchUrl"` // | ||
| 1012 | } | 1016 | } |
| 1013 | 1017 | ||
| 1014 | type MiniArticleDraftDeleteMeRequest struct { | 1018 | type MiniArticleDraftDeleteMeRequest struct { |
| @@ -111,6 +111,11 @@ func (m *Article) MakeBackup(operator UserSimple, section []ArticleSection) *Art | @@ -111,6 +111,11 @@ func (m *Article) MakeBackup(operator UserSimple, section []ArticleSection) *Art | ||
| 111 | WhoRead: m.WhoRead, | 111 | WhoRead: m.WhoRead, |
| 112 | WhoReview: m.WhoReview, | 112 | WhoReview: m.WhoReview, |
| 113 | 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 | ||
| 114 | } | 119 | } |
| 115 | return &b | 120 | return &b |
| 116 | } | 121 | } |
-
请 注册 或 登录 后发表评论