package aitemplatemoduledata import ( "91porn-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 }