diff --git a/api/dto/VideoAuthor.go b/api/dto/VideoAuthor.go index 117af8e..36321ac 100644 --- a/api/dto/VideoAuthor.go +++ b/api/dto/VideoAuthor.go @@ -6,6 +6,7 @@ import ( type VideoAuthorDto struct { AuthorName string `json:"author_name"` // 作者姓名 + AuthorAvatar string `json:"author_avatar"` // 作者头像 HospitalName string `json:"hospital_name"` // 作者所属医院 } @@ -17,7 +18,8 @@ func GetVideoAuthorListDto(m []*model.VideoAuthor) []*VideoAuthorDto { if len(m) > 0 { for i, v := range m { response := &VideoAuthorDto{ - AuthorName: v.AuthorName, + AuthorName: v.AuthorName, + AuthorAvatar: v.AuthorAvatar, } // 加载数据-医院属性 diff --git a/api/model/VideoAuthor.go b/api/model/VideoAuthor.go index a96e37e..de0aa25 100644 --- a/api/model/VideoAuthor.go +++ b/api/model/VideoAuthor.go @@ -1,17 +1,19 @@ package model import ( - "gorm.io/gorm" "time" "vote-video-api/global" + + "gorm.io/gorm" ) // VideoAuthor 视频-作者表 type VideoAuthor struct { - AuthorId int64 `gorm:"column:author_id;type:bigint(19);primary_key;comment:主键id" json:"author_id"` - VideoId int64 `gorm:"column:video_id;type:bigint(19);comment:视频id;NOT NULL" json:"video_id"` - AuthorName string `gorm:"column:author_name;type:varchar(100);comment:作者姓名" json:"author_name"` - HospitalId int64 `gorm:"column:hospital_id;type:bigint(19);comment:作者所属医院id" json:"hospital_id"` + AuthorId int64 `gorm:"column:author_id;type:bigint(19);primary_key;comment:主键id" json:"author_id"` + VideoId int64 `gorm:"column:video_id;type:bigint(19);comment:视频id;NOT NULL" json:"video_id"` + AuthorName string `gorm:"column:author_name;type:varchar(100);comment:作者姓名" json:"author_name"` + AuthorAvatar string `gorm:"column:author_avatar;type:varchar(255);comment:作者头像" json:"author_avatar"` + HospitalId int64 `gorm:"column:hospital_id;type:bigint(19);comment:作者所属医院id" json:"hospital_id"` Model BaseHospital *BaseHospital `gorm:"foreignKey:HospitalId;references:hospital_id" json:"base_hospital"` }