package nakedchatorderdata import ( "91porn-server/models/v/nakedchatordermod" ) // FormatAppDataList 格式化app列表数据 func FormatAppDataList(origin []nakedchatordermod.NakedChatOrder) (res []*nakedchatordermod.NakedChatOrderInfo) { res = make([]*nakedchatordermod.NakedChatOrderInfo, len(origin)) if len(origin) == 0 { return } // 组装返回数据 for i, item := range origin { res[i] = FormatAppData(item) } return } // FormatAppData 格式化app数据 func FormatAppData(item nakedchatordermod.NakedChatOrder) (res *nakedchatordermod.NakedChatOrderInfo) { if item.ID.IsZero() { return } // 组装返回数据 res = &nakedchatordermod.NakedChatOrderInfo{ ID: item.ID, Nid: item.Nid, Uid: item.Uid, UserContact: item.UserContact, Num: item.Num, Price: item.Price, Amount: item.Amount, Remark: item.Remark, Status: item.Status, CreatedAt: item.CreatedAt, UpdatedAt: item.UpdatedAt, } return }