xcopy赋值
This commit is contained in:
parent
4a40f28e7a
commit
701b72bf89
@ -70,7 +70,7 @@ func (d *didiUnionApiImpl) GenerateH5Link(ctx context.Context, req GenerateLinkR
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *GenerateLinkResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][GenerateH5Link] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
@ -89,7 +89,7 @@ func (d *didiUnionApiImpl) GenerateMiniLink(ctx context.Context, req GenerateLin
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *GenerateLinkResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][GenerateMiniLink] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
@ -108,7 +108,7 @@ func (d *didiUnionApiImpl) GenerateAlipayMiniLink(ctx context.Context, req Gener
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *GenerateLinkResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][GenerateAlipayMiniLink] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
@ -127,7 +127,7 @@ func (d *didiUnionApiImpl) GenerateH5Code(ctx context.Context, req GenerateCodeR
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *GenerateCodeResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][GenerateH5Code] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
@ -146,7 +146,7 @@ func (d *didiUnionApiImpl) GenerateMiniCode(ctx context.Context, req GenerateCod
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *GenerateCodeResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][GenerateMiniCode] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
@ -165,7 +165,7 @@ func (d *didiUnionApiImpl) GeneratePoster(ctx context.Context, req GeneratePoste
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *GeneratePosterResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][GeneratePoster] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
@ -184,7 +184,7 @@ func (d *didiUnionApiImpl) QueryOrderList(ctx context.Context, req QueryOrderLis
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *QueryOrderListResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][QueryOrderList] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
@ -203,7 +203,7 @@ func (d *didiUnionApiImpl) SelfQueryOrder(ctx context.Context, req SelfQueryOrde
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
var result *SelfQueryOrderResponse
|
||||
if err := xcopy.Copy(&result, resp.Data); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&result, resp.Data); err != nil {
|
||||
d.log.WithFields(logx.LogField{Key: "req", Value: req}).Errorf("[didiUnionApiImpl][SelfQueryOrder] copy resp to result error, error: %v", err)
|
||||
return nil, errors.New(resp.ErrMsg)
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ func (a *meituanUnionApiImpl) NotifySign(params map[string]interface{}) string {
|
||||
// GetLink 获取推广链接
|
||||
func (a *meituanUnionApiImpl) GetLink(params GenerateLinkRequest) (*GenerateLinkResponse, error) {
|
||||
request := new(ThirdGenerateLinkRequest)
|
||||
if err := xcopy.Copy(&request, params); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&request, params); err != nil {
|
||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
@ -78,7 +78,7 @@ func (a *meituanUnionApiImpl) GetLink(params GenerateLinkRequest) (*GenerateLink
|
||||
// MiniCode 获取小程序码
|
||||
func (a *meituanUnionApiImpl) MiniCode(params MiniCodeRequest) (*MimiCodeResponse, error) {
|
||||
request := new(ThirdMiniCodeRequest)
|
||||
if err := xcopy.Copy(&request, params); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&request, params); err != nil {
|
||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
@ -96,7 +96,7 @@ func (a *meituanUnionApiImpl) MiniCode(params MiniCodeRequest) (*MimiCodeRespons
|
||||
// GetOrderBySinge 获取单个订单
|
||||
func (a *meituanUnionApiImpl) GetOrderBySinge(params GetOrderBySingeRequest) (*GetOrderBySingeResponse, error) {
|
||||
request := new(ThirdGetOrderBySingeRequest)
|
||||
if err := xcopy.Copy(&request, params); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&request, params); err != nil {
|
||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
@ -115,7 +115,7 @@ func (a *meituanUnionApiImpl) GetOrderBySinge(params GetOrderBySingeRequest) (*G
|
||||
func (a *meituanUnionApiImpl) GetOrderByBatch(params GetOrderByBatchRequest) (*GetOrderByBatchResponse, error) {
|
||||
fmt.Printf("params: %+v\n", util.StructToMap(params))
|
||||
request := new(ThirdGetOrderByBatchRequest)
|
||||
if err := xcopy.Copy(&request, params); err != nil {
|
||||
if err := xcopy.SetJSONTag(false).Copy(&request, params); err != nil {
|
||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user