Files
hjsq_server/models/cache/aitemplatemoduledata/data.go
T
2026-10-08 16:50:13 +08:00

37 lines
786 B
Go
Executable File

package aitemplatemoduledata
import (
"91jd-server/models/v/aitemplatemodulemod"
)
// FormatAppDataList 格式化app列表数据
func FormatAppDataList(origin []aitemplatemodulemod.AiTemplateModule) (res []*aitemplatemodulemod.AiTemplateModuleInfo) {
res = make([]*aitemplatemodulemod.AiTemplateModuleInfo, len(origin))
if len(origin) == 0 {
return
}
// 组装返回数据
for i, item := range origin {
res[i] = FormatAppData(item)
}
return
}
// FormatAppData 格式化app数据
func FormatAppData(item aitemplatemodulemod.AiTemplateModule) (res *aitemplatemodulemod.AiTemplateModuleInfo) {
if item.ID.IsZero() {
return
}
// 组装返回数据
res = &aitemplatemodulemod.AiTemplateModuleInfo{
ID: item.ID,
Type: item.Type,
Name: item.Name,
}
return
}