正在显示
3 个修改的文件
包含
27 行增加
和
35 行删除
| @@ -12,23 +12,16 @@ type Article struct { | @@ -12,23 +12,16 @@ type Article struct { | ||
| 12 | CreatedAt time.Time | 12 | CreatedAt time.Time |
| 13 | UpdatedAt time.Time | 13 | UpdatedAt time.Time |
| 14 | DeletedAt *time.Time | 14 | DeletedAt *time.Time |
| 15 | - AuthorId int64 // 发布人 | ||
| 16 | - Author ArticleAuthor // 发布人 | ||
| 17 | - Title string // 文章标题 | ||
| 18 | - Images []Image // 图片 | ||
| 19 | - WhoRead []int64 // 谁可以看 | ||
| 20 | - WhoReview []int64 // 评论人 | ||
| 21 | - Location Location // 坐标 | 15 | + AuthorId int64 // 发布人 |
| 16 | + Author UserSimple // 发布人 | ||
| 17 | + Title string // 文章标题 | ||
| 18 | + Images []Image // 图片 | ||
| 19 | + WhoRead []int64 // 谁可以看 | ||
| 20 | + WhoReview []int64 // 评论人 | ||
| 21 | + Location Location // 坐标 | ||
| 22 | // ...more | 22 | // ...more |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | -type ArticleAuthor struct { | ||
| 26 | - Id int64 // 人员id | ||
| 27 | - Name string // 人员的名字 | ||
| 28 | - Avatar string // 人员头像URL | ||
| 29 | - Group string // 人员的分组 | ||
| 30 | -} | ||
| 31 | - | ||
| 32 | type ArticleRepository interface { | 25 | type ArticleRepository interface { |
| 33 | Insert(ctx context.Context, conn transaction.Conn, dm *Article) (*Article, error) | 26 | Insert(ctx context.Context, conn transaction.Conn, dm *Article) (*Article, error) |
| 34 | Update(ctx context.Context, conn transaction.Conn, dm *Article) (*Article, error) | 27 | Update(ctx context.Context, conn transaction.Conn, dm *Article) (*Article, error) |
| @@ -8,26 +8,18 @@ type ArticleComment struct { | @@ -8,26 +8,18 @@ type ArticleComment struct { | ||
| 8 | UpdatedAt time.Time // 更新时间 | 8 | UpdatedAt time.Time // 更新时间 |
| 9 | DeletedAt *time.Time | 9 | DeletedAt *time.Time |
| 10 | CreatedAt time.Time | 10 | CreatedAt time.Time |
| 11 | - Pid int64 // 对哪个评论进行回复 | ||
| 12 | - TopId int64 // 归属于最上级的哪个评论 | ||
| 13 | - ArticleId int64 // 文章id | ||
| 14 | - ArticleSectionId int64 // 文本内容id | ||
| 15 | - SectionContent string // 引用的文章内容文本 | ||
| 16 | - FromUserId int64 // 谁填写的评论 | ||
| 17 | - FromUser CommentUser // 谁填写的评论 | ||
| 18 | - ToUserId int64 // 回复谁的评论 | ||
| 19 | - ToUser CommentUser // 回复谁的评论 | ||
| 20 | - Content string // 评论内容 | ||
| 21 | - CountReply int // 回复数量 | ||
| 22 | - CountUserLove int // 用户点赞数量 | ||
| 23 | - CountAdminLove int // 运营点赞数量 | 11 | + Pid int64 // 对哪个评论进行回复 |
| 12 | + TopId int64 // 归属于最上级的哪个评论 | ||
| 13 | + ArticleId int64 // 文章id | ||
| 14 | + ArticleSectionId int64 // 文本内容id | ||
| 15 | + SectionContent string // 引用的文章内容文本 | ||
| 16 | + FromUserId int64 // 谁填写的评论 | ||
| 17 | + FromUser UserSimple // 谁填写的评论 | ||
| 18 | + ToUserId int64 // 回复谁的评论 | ||
| 19 | + ToUser UserSimple // 回复谁的评论 | ||
| 20 | + Content string // 评论内容 | ||
| 21 | + CountReply int // 回复数量 | ||
| 22 | + CountUserLove int // 用户点赞数量 | ||
| 23 | + CountAdminLove int // 运营点赞数量 | ||
| 24 | // ...more | 24 | // ...more |
| 25 | } | 25 | } |
| 26 | - | ||
| 27 | -// 评论的填写人 | ||
| 28 | -type CommentUser struct { | ||
| 29 | - Id int64 // 人员id | ||
| 30 | - Name string // 人员的名字 | ||
| 31 | - Avatar string // 人员头像URL | ||
| 32 | - Group string // 人员的分组 | ||
| 33 | -} |
| @@ -13,3 +13,10 @@ type Location struct { | @@ -13,3 +13,10 @@ type Location struct { | ||
| 13 | Latitude float64 `json:"latitude"` //纬度 | 13 | Latitude float64 `json:"latitude"` //纬度 |
| 14 | Descript string `json:"descript"` //地点描述 | 14 | Descript string `json:"descript"` //地点描述 |
| 15 | } | 15 | } |
| 16 | + | ||
| 17 | +type UserSimple struct { | ||
| 18 | + Id int64 // 人员id | ||
| 19 | + Name string // 人员的名字 | ||
| 20 | + Avatar string // 人员头像URL | ||
| 21 | + Group string // 人员的分组 | ||
| 22 | +} |
-
请 注册 或 登录 后发表评论