package utils import ( "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" ) func ConvertReward(data ...*cfg.Gameatn) (res []*pb.UserAssets) { for _, v := range data { res = append(res, &pb.UserAssets{ A: v.A, T: v.T, N: v.N, }) } return } // 去重 func RemoveDuplicate(arr []int32) []int32 { visited := make(map[int32]bool) result := []int32{} for _, num := range arr { if !visited[num] { visited[num] = true result = append(result, num) } } return result } func NoContain(exist, all []int32) (contain []int32) { existMap := make(map[int32]bool) for _, b := range exist { existMap[b] = true } for _, a := range all { if !existMap[a] { contain = append(contain, a) } } return }