50 lines
1.3 KiB
Go
Executable File
50 lines
1.3 KiB
Go
Executable File
package aitexttonoveldata
|
|
|
|
import "91porn-server/models/v/aitexttonovelmod"
|
|
|
|
// FormatAppDataList 格式化app列表数据
|
|
func FormatAppDataList(origin []aitexttonovelmod.AiTextToNovel) (res []*aitexttonovelmod.AiTextToNovel) {
|
|
res = make([]*aitexttonovelmod.AiTextToNovel, len(origin))
|
|
if len(origin) == 0 {
|
|
return
|
|
}
|
|
|
|
// 组装返回数据
|
|
for i, item := range origin {
|
|
res[i] = FormatAppData(item)
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
// FormatAppData 格式化app数据
|
|
func FormatAppData(item aitexttonovelmod.AiTextToNovel) (res *aitexttonovelmod.AiTextToNovel) {
|
|
if item.ID.IsZero() {
|
|
return
|
|
}
|
|
|
|
// 组装返回数据
|
|
res = &aitexttonovelmod.AiTextToNovel{
|
|
ID: item.ID,
|
|
UID: item.UID,
|
|
Description: item.Description,
|
|
Content: item.Content,
|
|
Status: item.Status,
|
|
CharacterSetting: item.CharacterSetting,
|
|
LocationScene: item.LocationScene,
|
|
Details: item.Details,
|
|
ModelType: item.ModelType,
|
|
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
|
|
}
|