feat-IRONFANS-32-20240125-Robin #79

Merged
chenhao merged 6 commits from feat-IRONFANS-32-20240125-Robin into test 2024-01-25 09:01:57 +08:00
2 changed files with 6 additions and 0 deletions
Showing only changes of commit a7c7d5f99e - Show all commits

View File

@ -42,6 +42,9 @@ type ToCVideo struct {
Id int64 `json:"id"` // 视频id Id int64 `json:"id"` // 视频id
Dur int64 `json:"dur"` // 视频时 Dur int64 `json:"dur"` // 视频时
CoverUrls []string `json:"cover_urls"` // 视频封面地址 CoverUrls []string `json:"cover_urls"` // 视频封面地址
CoverW int64 `json:"cover_w"` // 封面宽
CoverH int64 `json:"cover_h"` // 封面高
CoverFmt string `json:"cover_fmt"` // 封面图片格式
Urls []string `json:"urls"` // 视频地址 Urls []string `json:"urls"` // 视频地址
} }

View File

@ -67,6 +67,9 @@ func transToCVideo(video *dbstruct.Video, coverImg *dbstruct.Image) *dbstruct.To
Urls: []string{defaultMediaFiller.fileServerDomainName + video.SrcId}, Urls: []string{defaultMediaFiller.fileServerDomainName + video.SrcId},
} }
if coverImg != nil { if coverImg != nil {
ret.CoverW = coverImg.W
ret.CoverH = coverImg.H
ret.CoverFmt = coverImg.Fmt
ret.CoverUrls = []string{defaultMediaFiller.fileServerDomainName + coverImg.SrcId} ret.CoverUrls = []string{defaultMediaFiller.fileServerDomainName + coverImg.SrcId}
} }
return ret return ret