pull/131/head
wenxu12345 3 years ago
parent 848510d4ca
commit ec95f0a7af

@ -28,7 +28,7 @@ func UserRegister(c *gin.Context) {
return return
} }
req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
utils.CopyStructFields(*req.UserInfo, params) utils.CopyStructFields(req.UserInfo, &params)
//copier.Copy(req.UserInfo, &params) //copier.Copy(req.UserInfo, &params)
req.OperationID = params.OperationID req.OperationID = params.OperationID
log.NewInfo(req.OperationID, "UserRegister args ", req.String()) log.NewInfo(req.OperationID, "UserRegister args ", req.String())

@ -8,7 +8,7 @@ import (
// copy a by b b->a // copy a by b b->a
func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error) { func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error) {
return copier.Copy(&a, &b) return copier.Copy(a, b)
at := reflect.TypeOf(a) at := reflect.TypeOf(a)
av := reflect.ValueOf(a) av := reflect.ValueOf(a)

Loading…
Cancel
Save