更新ArticleBackup ,ArticleDraft ,Article的数据结构
正在显示
13 个修改的文件
包含
136 行增加
和
111 行删除
| @@ -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 |
| @@ -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个字 |
| @@ -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 | } |
| @@ -790,13 +790,14 @@ type ArticleAuthor struct { | @@ -790,13 +790,14 @@ type ArticleAuthor struct { | ||
| 790 | } | 790 | } |
| 791 | 791 | ||
| 792 | type MiniArticleCreateRequest struct { | 792 | type MiniArticleCreateRequest struct { |
| 793 | - Title string `json:"title"` //标题 | ||
| 794 | - Section []string `json:"section"` //文章的文本内容 | ||
| 795 | - AuthorId int64 `json:"authorId,optional"` //发布人id | ||
| 796 | - Images []string `json:"images,optional"` //图片 | ||
| 797 | - WhoRead []int64 `json:"whoRead,optional"` //谁可查看 | ||
| 798 | - WhoReview []int64 `json:"whoReview,optional"` //谁可评论 | ||
| 799 | - Location Location `json:"location,optional"` //定位坐标 | 793 | + Title string `json:"title"` //标题 |
| 794 | + Section []string `json:"section"` //文章的文本内容 | ||
| 795 | + AuthorId int64 `json:"authorId,optional"` //发布人id | ||
| 796 | + Images []string `json:"images,optional"` //图片 | ||
| 797 | + WhoRead []int64 `json:"whoRead,optional"` //谁可查看 | ||
| 798 | + WhoReview []int64 `json:"whoReview,optional"` //谁可评论 | ||
| 799 | + Location Location `json:"location,optional"` //定位坐标 | ||
| 800 | + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本 | ||
| 800 | } | 801 | } |
| 801 | 802 | ||
| 802 | type MiniArticleCreateResponse struct { | 803 | type MiniArticleCreateResponse struct { |
| @@ -810,24 +811,25 @@ type MiniArticleGetRequest struct { | @@ -810,24 +811,25 @@ type MiniArticleGetRequest struct { | ||
| 810 | } | 811 | } |
| 811 | 812 | ||
| 812 | type MiniArticleGetResponse struct { | 813 | type MiniArticleGetResponse struct { |
| 813 | - Id int64 `json:"id"` //id | ||
| 814 | - Title string `json:"title"` //标题 | ||
| 815 | - AuthorId int64 `json:"authorId"` //发布人id | ||
| 816 | - Author ArticleAuthor `json:"author"` //发布人 | ||
| 817 | - CreatedAt int64 `json:"createdAt"` //文章的发布时间 | ||
| 818 | - Section []ArticleSection `json:"section"` //文章的文本内容 | ||
| 819 | - Images []string `json:"images"` //图片 | ||
| 820 | - WhoRead []int64 `json:"whoRead"` //谁可查看 | ||
| 821 | - WhoReview []int64 `json:"whoReview"` //谁可评论 | ||
| 822 | - Location Location `json:"location"` //定位坐标 | ||
| 823 | - CountLove int `json:"countLove"` // 点赞数量 | ||
| 824 | - CountComment int `json:"countComment"` // 评论数量 | ||
| 825 | - CountRead int `json:"countRead"` // 浏览数量 | ||
| 826 | - Show int `json:"show"` // 评论的展示状态(1显示、2不显示) | ||
| 827 | - Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在) | ||
| 828 | - MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞) | ||
| 829 | - MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注) | ||
| 830 | - Tags []string `json:"tags"` // 文章的标签 | 814 | + Id int64 `json:"id"` //id |
| 815 | + Title string `json:"title"` //标题 | ||
| 816 | + AuthorId int64 `json:"authorId"` //发布人id | ||
| 817 | + Author ArticleAuthor `json:"author"` //发布人 | ||
| 818 | + CreatedAt int64 `json:"createdAt"` //文章的发布时间 | ||
| 819 | + Section []ArticleSection `json:"section"` //文章的文本内容 | ||
| 820 | + Images []string `json:"images"` //图片 | ||
| 821 | + WhoRead []int64 `json:"whoRead"` //谁可查看 | ||
| 822 | + WhoReview []int64 `json:"whoReview"` //谁可评论 | ||
| 823 | + Location Location `json:"location"` //定位坐标 | ||
| 824 | + CountLove int `json:"countLove"` // 点赞数量 | ||
| 825 | + CountComment int `json:"countComment"` // 评论数量 | ||
| 826 | + CountRead int `json:"countRead"` // 浏览数量 | ||
| 827 | + Show int `json:"show"` // 评论的展示状态(1显示、2不显示) | ||
| 828 | + Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在) | ||
| 829 | + MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞) | ||
| 830 | + MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注) | ||
| 831 | + Tags []string `json:"tags"` // 文章的标签 | ||
| 832 | + MatchUrl map[string]string `json:"matchUrl"` // 匹配文章内容中的url文本 | ||
| 831 | } | 833 | } |
| 832 | 834 | ||
| 833 | type ArticleSection struct { | 835 | type ArticleSection 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 |
| @@ -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) |
-
请 注册 或 登录 后发表评论