package Account type Company struct { Id int `xml:"Id"` T_mid int `xml:"T_mid"` // 上一级 ID T_name string `xml:"T_name"` // 公司名称 T_uids string `xml:"T_uids"` // 绑定用户 Uid| 如:U1|U2| } func CompanyListToMap(list []Company) map[int]string { maps := make(map[int]string, len(list)) for _, v := range list { maps[v.Id] = v.T_name } return maps }