50 lines
1.2 KiB
Go
Executable File
50 lines
1.2 KiB
Go
Executable File
package aitexttoimagedata
|
|
|
|
import (
|
|
"91porn-server/models/v/aitexttoimagemod"
|
|
)
|
|
|
|
// FormatAppDataList 格式化app列表数据
|
|
func FormatAppDataList(origin []aitexttoimagemod.AiTextToImage) (res []*aitexttoimagemod.AiTextToImageInfo) {
|
|
res = make([]*aitexttoimagemod.AiTextToImageInfo, len(origin))
|
|
if len(origin) == 0 {
|
|
return
|
|
}
|
|
|
|
// 组装返回数据
|
|
for i, item := range origin {
|
|
res[i] = FormatAppData(item)
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
// FormatAppData 格式化app数据
|
|
func FormatAppData(item aitexttoimagemod.AiTextToImage) (res *aitexttoimagemod.AiTextToImageInfo) {
|
|
if item.ID.IsZero() {
|
|
return
|
|
}
|
|
|
|
// 组装返回数据
|
|
res = &aitexttoimagemod.AiTextToImageInfo{
|
|
ID: item.ID,
|
|
UID: item.UID,
|
|
Text: item.Text,
|
|
NewImgUrl: item.NewImgUrl,
|
|
Status: item.Status,
|
|
AspectRatio: item.AspectRatio,
|
|
StyleType: item.StyleType,
|
|
Coin: item.Coin,
|
|
DebitAmountCoin: item.DebitAmountCoin,
|
|
DebitIncomeCoin: item.DebitIncomeCoin,
|
|
IsFreeTimes: item.IsFreeTimes,
|
|
IsHide: item.IsHide,
|
|
Remark: item.Remark,
|
|
IsDelete: item.IsDelete,
|
|
CreatedAt: item.CreatedAt,
|
|
UpdatedAt: item.UpdatedAt,
|
|
}
|
|
|
|
return
|
|
}
|