|
|
@ -375,13 +375,17 @@ func (s *userServer) ProcessUserCommandGet(ctx context.Context, req *pbuser.Proc
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Create a new map with the required type
|
|
|
|
// Create a slice to store CommandInfoResp
|
|
|
|
commandPointers := make(map[string]*pbuser.CommandInfo)
|
|
|
|
var commandInfoSlice []*pbuser.CommandInfoResp
|
|
|
|
for k, v := range commands {
|
|
|
|
|
|
|
|
vCopy := v // Create a copy of v
|
|
|
|
for _, v := range commands {
|
|
|
|
commandPointers[k] = &vCopy
|
|
|
|
commandInfoSlice = append(commandInfoSlice, &pbuser.CommandInfoResp{
|
|
|
|
|
|
|
|
Uuid: v.Uuid,
|
|
|
|
|
|
|
|
Value: v.Value,
|
|
|
|
|
|
|
|
CreateTime: v.CreateTime,
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Return the new map
|
|
|
|
// Return the new slice
|
|
|
|
return &pbuser.ProcessUserCommandGetResp{UuidValue: commandPointers}, nil
|
|
|
|
return &pbuser.ProcessUserCommandGetResp{KVArray: commandInfoSlice}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|