正在显示
4 个修改的文件
包含
12 行增加
和
0 行删除
| @@ -21,6 +21,7 @@ type Article struct { | @@ -21,6 +21,7 @@ type Article struct { | ||
| 21 | Author domain.UserSimple `gorm:"type:jsonb;serializer:json"` // 发布人 | 21 | Author domain.UserSimple `gorm:"type:jsonb;serializer:json"` // 发布人 |
| 22 | Title string // 文章标题 | 22 | Title string // 文章标题 |
| 23 | Images []domain.Image `gorm:"type:jsonb;serializer:json"` // 图片 | 23 | Images []domain.Image `gorm:"type:jsonb;serializer:json"` // 图片 |
| 24 | + Videos []domain.Video `gorm:"type:jsonb;serializer:json"` // 视频 | ||
| 24 | WhoRead []int64 `gorm:"type:jsonb;serializer:json"` // 谁可以看 | 25 | WhoRead []int64 `gorm:"type:jsonb;serializer:json"` // 谁可以看 |
| 25 | WhoReview []int64 `gorm:"type:jsonb;serializer:json"` // 评论人 | 26 | WhoReview []int64 `gorm:"type:jsonb;serializer:json"` // 评论人 |
| 26 | Location domain.Location `gorm:"type:jsonb;serializer:json"` // 坐标 | 27 | Location domain.Location `gorm:"type:jsonb;serializer:json"` // 坐标 |
| @@ -305,6 +305,7 @@ func (repository *ArticleRepository) ModelToDomainModel(from *models.Article) (* | @@ -305,6 +305,7 @@ func (repository *ArticleRepository) ModelToDomainModel(from *models.Article) (* | ||
| 305 | Tags: from.Tags, | 305 | Tags: from.Tags, |
| 306 | Summary: from.Summary, | 306 | Summary: from.Summary, |
| 307 | MatchUrl: from.MatchUrl, | 307 | MatchUrl: from.MatchUrl, |
| 308 | + Videos: from.Videos, | ||
| 308 | } | 309 | } |
| 309 | return to, nil | 310 | return to, nil |
| 310 | } | 311 | } |
| @@ -333,6 +334,7 @@ func (repository *ArticleRepository) DomainModelToModel(from *domain.Article) (* | @@ -333,6 +334,7 @@ func (repository *ArticleRepository) DomainModelToModel(from *domain.Article) (* | ||
| 333 | Show: int(from.Show), | 334 | Show: int(from.Show), |
| 334 | Summary: from.Summary, | 335 | Summary: from.Summary, |
| 335 | MatchUrl: from.MatchUrl, | 336 | MatchUrl: from.MatchUrl, |
| 337 | + Videos: from.Videos, | ||
| 336 | } | 338 | } |
| 337 | // err := copier.Copy(to, from) | 339 | // err := copier.Copy(to, from) |
| 338 | return to, nil | 340 | return to, nil |
| @@ -18,6 +18,7 @@ type Article struct { | @@ -18,6 +18,7 @@ type Article struct { | ||
| 18 | Author UserSimple `json:"author"` // 发布人 | 18 | Author UserSimple `json:"author"` // 发布人 |
| 19 | Title string `json:"title"` // 文章标题 | 19 | Title string `json:"title"` // 文章标题 |
| 20 | Images []Image `json:"images"` // 图片 | 20 | Images []Image `json:"images"` // 图片 |
| 21 | + Videos []Video `json:"videos"` // 视频 | ||
| 21 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 22 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| 22 | WhoReview []int64 `json:"whoReview"` // 评论人 | 23 | WhoReview []int64 `json:"whoReview"` // 评论人 |
| 23 | Location Location `json:"location"` // 坐标 | 24 | Location Location `json:"location"` // 坐标 |
| @@ -7,6 +7,14 @@ type Image struct { | @@ -7,6 +7,14 @@ type Image struct { | ||
| 7 | Height int `json:"height"` // 图片高度 | 7 | Height int `json:"height"` // 图片高度 |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | +// 视频信息 | ||
| 11 | +type Video struct { | ||
| 12 | + Url string `json:"url"` //视频文件的地址 | ||
| 13 | + Cover string `json:"cover"` //封面 | ||
| 14 | + Width int `json:"width"` //封面图片宽 | ||
| 15 | + Height int `json:"height"` //封面图片长 | ||
| 16 | +} | ||
| 17 | + | ||
| 10 | // 坐标位置 | 18 | // 坐标位置 |
| 11 | type Location struct { | 19 | type Location struct { |
| 12 | Longitude float64 `json:"longitude"` //经度 | 20 | Longitude float64 `json:"longitude"` //经度 |
-
请 注册 或 登录 后发表评论