正在显示
9 个修改的文件
包含
165 行增加
和
126 行删除
| @@ -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 |
| @@ -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 { |
| @@ -89,6 +89,7 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt | @@ -89,6 +89,7 @@ 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, |
| 94 | Content: commentInfo.Content, | 95 | Content: commentInfo.Content, |
| @@ -96,6 +97,9 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt | @@ -96,6 +97,9 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt | ||
| 96 | if _, ok := flagMap[commentInfo.Id]; ok { | 97 | if _, ok := flagMap[commentInfo.Id]; ok { |
| 97 | commentResp.MeLoveFlag = 1 | 98 | commentResp.MeLoveFlag = 1 |
| 98 | } | 99 | } |
| 100 | + for k, v := range commentInfo.MatchUrl { | ||
| 101 | + commentResp.MatchUrl[k] = v | ||
| 102 | + } | ||
| 99 | for _, val := range commentInfo.AtWho { | 103 | for _, val := range commentInfo.AtWho { |
| 100 | commentResp.AtWho = append(commentResp.AtWho, types.CommentAtWho{ | 104 | commentResp.AtWho = append(commentResp.AtWho, types.CommentAtWho{ |
| 101 | Id: val.Id, | 105 | Id: val.Id, |
| @@ -132,12 +136,16 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt | @@ -132,12 +136,16 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt | ||
| 132 | CountUserLove: val.CountUserLove, | 136 | CountUserLove: val.CountUserLove, |
| 133 | CountAdminLove: val.CountAdminLove, | 137 | CountAdminLove: val.CountAdminLove, |
| 134 | AtWho: []types.CommentAtWho{}, | 138 | AtWho: []types.CommentAtWho{}, |
| 139 | + MatchUrl: map[string]string{}, | ||
| 135 | CreatedAt: val.CreatedAt, | 140 | CreatedAt: val.CreatedAt, |
| 136 | MeLoveFlag: 0, | 141 | MeLoveFlag: 0, |
| 137 | } | 142 | } |
| 138 | if _, ok := flagMap[val.Id]; ok { | 143 | if _, ok := flagMap[val.Id]; ok { |
| 139 | reply.MeLoveFlag = 1 | 144 | reply.MeLoveFlag = 1 |
| 140 | } | 145 | } |
| 146 | + for key, url := range val.MatchUrl { | ||
| 147 | + reply.MatchUrl[key] = url | ||
| 148 | + } | ||
| 141 | for _, val2 := range val.AtWho { | 149 | for _, val2 := range val.AtWho { |
| 142 | reply.AtWho = append(reply.AtWho, types.CommentAtWho{ | 150 | reply.AtWho = append(reply.AtWho, types.CommentAtWho{ |
| 143 | Id: val2.Id, | 151 | Id: val2.Id, |
| @@ -100,6 +100,7 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList | @@ -100,6 +100,7 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList | ||
| 100 | CountUserLove: val.CountUserLove, | 100 | CountUserLove: val.CountUserLove, |
| 101 | CountAdminLove: val.CountAdminLove, | 101 | CountAdminLove: val.CountAdminLove, |
| 102 | AtWho: []types.CommentAtWho{}, | 102 | AtWho: []types.CommentAtWho{}, |
| 103 | + MatchUrl: map[string]string{}, | ||
| 103 | CreatedAt: val.CreatedAt, | 104 | CreatedAt: val.CreatedAt, |
| 104 | MeLoveFlag: 0, | 105 | MeLoveFlag: 0, |
| 105 | Content: val.Content, | 106 | Content: val.Content, |
| @@ -111,7 +112,9 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList | @@ -111,7 +112,9 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList | ||
| 111 | if _, ok := flagMap[val.Id]; ok { | 112 | if _, ok := flagMap[val.Id]; ok { |
| 112 | item.Comment.MeLoveFlag = 1 | 113 | item.Comment.MeLoveFlag = 1 |
| 113 | } | 114 | } |
| 114 | - | 115 | + for key2, val2 := range val.MatchUrl { |
| 116 | + item.Comment.MatchUrl[key2] = val2 | ||
| 117 | + } | ||
| 115 | for _, val2 := range val.AtWho { | 118 | for _, val2 := range val.AtWho { |
| 116 | item.Comment.AtWho = append(item.Comment.AtWho, types.CommentAtWho{ | 119 | item.Comment.AtWho = append(item.Comment.AtWho, types.CommentAtWho{ |
| 117 | Id: val2.Id, | 120 | Id: val2.Id, |
| @@ -174,6 +177,7 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag | @@ -174,6 +177,7 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag | ||
| 174 | CountUserLove: val.CountUserLove, | 177 | CountUserLove: val.CountUserLove, |
| 175 | CountAdminLove: val.CountAdminLove, | 178 | CountAdminLove: val.CountAdminLove, |
| 176 | AtWho: []types.CommentAtWho{}, | 179 | AtWho: []types.CommentAtWho{}, |
| 180 | + MatchUrl: map[string]string{}, | ||
| 177 | CreatedAt: val.CreatedAt, | 181 | CreatedAt: val.CreatedAt, |
| 178 | MeLoveFlag: 0, | 182 | MeLoveFlag: 0, |
| 179 | Content: val.Content, | 183 | Content: val.Content, |
| @@ -182,6 +186,9 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag | @@ -182,6 +186,9 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag | ||
| 182 | if _, ok := loveFlagMap[val.Id]; ok { | 186 | if _, ok := loveFlagMap[val.Id]; ok { |
| 183 | item.MeLoveFlag = 1 | 187 | item.MeLoveFlag = 1 |
| 184 | } | 188 | } |
| 189 | + for key2, val2 := range val.MatchUrl { | ||
| 190 | + item.MatchUrl[key2] = val2 | ||
| 191 | + } | ||
| 185 | for _, val2 := range val.AtWho { | 192 | for _, val2 := range val.AtWho { |
| 186 | item.AtWho = append(item.AtWho, types.CommentAtWho{ | 193 | item.AtWho = append(item.AtWho, types.CommentAtWho{ |
| 187 | Id: val2.Id, | 194 | 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, |
| @@ -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 { |
| @@ -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 { |
| @@ -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 |
| @@ -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 |
-
请 注册 或 登录 后发表评论