正在显示
8 个修改的文件
包含
76 行增加
和
47 行删除
| @@ -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 { |
| @@ -232,12 +234,13 @@ type ( | @@ -232,12 +234,13 @@ type ( | ||
| 232 | List []MiniArticleDraftItem `json:"list"` | 234 | List []MiniArticleDraftItem `json:"list"` |
| 233 | } | 235 | } |
| 234 | MiniArticleDraftItem { | 236 | MiniArticleDraftItem { |
| 235 | - Id int64 `json:"id"` | ||
| 236 | - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
| 237 | - Section []string `json:"section"` // 填写的内容 | ||
| 238 | - Title string `json:"title"` // 标题 | ||
| 239 | - Images []string `json:"images"` // 图片 | ||
| 240 | - 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文本 | ||
| 241 | } | 244 | } |
| 242 | ) | 245 | ) |
| 243 | 246 | ||
| @@ -250,14 +253,15 @@ type ( | @@ -250,14 +253,15 @@ type ( | ||
| 250 | } | 253 | } |
| 251 | 254 | ||
| 252 | MiniArticleDraftGetMeResponse { | 255 | MiniArticleDraftGetMeResponse { |
| 253 | - Id int64 `json:"id"` // | ||
| 254 | - Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
| 255 | - Section []string `json:"section"` // 填写的内容 | ||
| 256 | - Title string `json:"title"` // 标题 | ||
| 257 | - Images []string `json:"images"` // 图片 | ||
| 258 | - WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
| 259 | - WhoReview []int64 `json:"whoReview"` // 评论人 | ||
| 260 | - 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"` // | ||
| 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{ |
| @@ -941,15 +941,16 @@ type MiniArticleMarkUserReadResponse struct { | @@ -941,15 +941,16 @@ type MiniArticleMarkUserReadResponse struct { | ||
| 941 | } | 941 | } |
| 942 | 942 | ||
| 943 | type MiniArticleDraftCreateRequest struct { | 943 | 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"` // 坐标 | 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"` // 坐标 | ||
| 953 | + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本 | ||
| 953 | } | 954 | } |
| 954 | 955 | ||
| 955 | type MiniArticleDraftCreateResponse struct { | 956 | type MiniArticleDraftCreateResponse struct { |
| @@ -957,16 +958,17 @@ type MiniArticleDraftCreateResponse struct { | @@ -957,16 +958,17 @@ type MiniArticleDraftCreateResponse struct { | ||
| 957 | } | 958 | } |
| 958 | 959 | ||
| 959 | type MiniArticleDraftUpdateRequest struct { | 960 | 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"` // 坐标 | 961 | + Id int64 `json:"id"` |
| 962 | + CompanyId int64 `json:",optional"` | ||
| 963 | + AuthorId int64 `json:",optional"` // 发布人 | ||
| 964 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
| 965 | + Section []string `json:"section"` // 填写的内容 | ||
| 966 | + Title string `json:"title"` // 标题 | ||
| 967 | + Images []string `json:"images"` // 图片 | ||
| 968 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
| 969 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
| 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 { |
| @@ -986,12 +988,13 @@ type MiniArticleDraftSearchMeResponse struct { | @@ -986,12 +988,13 @@ type MiniArticleDraftSearchMeResponse struct { | ||
| 986 | } | 988 | } |
| 987 | 989 | ||
| 988 | type MiniArticleDraftItem struct { | 990 | 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"` | 991 | + Id int64 `json:"id"` |
| 992 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
| 993 | + Section []string `json:"section"` // 填写的内容 | ||
| 994 | + Title string `json:"title"` // 标题 | ||
| 995 | + Images []string `json:"images"` // 图片 | ||
| 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 { |
| @@ -1001,14 +1004,15 @@ type MiniArticleDraftGetMeRequest struct { | @@ -1001,14 +1004,15 @@ type MiniArticleDraftGetMeRequest struct { | ||
| 1001 | } | 1004 | } |
| 1002 | 1005 | ||
| 1003 | type MiniArticleDraftGetMeResponse struct { | 1006 | 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"` // 坐标 | 1007 | + Id int64 `json:"id"` // |
| 1008 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
| 1009 | + Section []string `json:"section"` // 填写的内容 | ||
| 1010 | + Title string `json:"title"` // 标题 | ||
| 1011 | + Images []string `json:"images"` // 图片 | ||
| 1012 | + WhoRead []int64 `json:"whoRead"` // 谁可以看 | ||
| 1013 | + WhoReview []int64 `json:"whoReview"` // 评论人 | ||
| 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 | } |
-
请 注册 或 登录 后发表评论