44 lines
1.0 KiB
Go
Executable File
44 lines
1.0 KiB
Go
Executable File
package aiimagetovideodata
|
|
|
|
import "91porn-server/models/v/aiimagetovideomod"
|
|
|
|
// FormatAppDataList 格式化app列表数据
|
|
func FormatAppDataList(origin []aiimagetovideomod.AiImageToVideo) (res []*aiimagetovideomod.AiImageToVideoInfo) {
|
|
res = make([]*aiimagetovideomod.AiImageToVideoInfo, len(origin))
|
|
if len(origin) == 0 {
|
|
return
|
|
}
|
|
|
|
// 组装返回数据
|
|
for i, item := range origin {
|
|
res[i] = FormatAppData(item)
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
// FormatAppData 格式化app数据
|
|
func FormatAppData(item aiimagetovideomod.AiImageToVideo) (res *aiimagetovideomod.AiImageToVideoInfo) {
|
|
if item.ID.IsZero() {
|
|
return
|
|
}
|
|
|
|
// 组装返回数据
|
|
res = &aiimagetovideomod.AiImageToVideoInfo{
|
|
ID: item.ID,
|
|
UID: item.UID,
|
|
ImgUrl: item.ImgUrl,
|
|
NewImgUrl: item.NewImgUrl,
|
|
Status: item.Status,
|
|
Coin: item.Coin,
|
|
IsFreeTimes: item.IsFreeTimes,
|
|
IsHide: item.IsHide,
|
|
Remark: item.Remark,
|
|
IsDelete: item.IsDelete,
|
|
CreatedAt: item.CreatedAt,
|
|
UpdatedAt: item.UpdatedAt,
|
|
}
|
|
|
|
return
|
|
}
|