Merge pull request 'by Robin at 20240618' (#538) from feat-IRONFANS-148-Robin into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/538
This commit is contained in:
chenhao 2024-06-18 20:08:08 +08:00
commit d8151b4368
3 changed files with 21 additions and 8 deletions

View File

@ -16,7 +16,7 @@ func ApiHvyogoQueryAgreeState(ctx *gin.Context) {
// 存入数据
data, ec := service.DefaultService.ApiHvyogoQueryAgreeState(ctx, req)
if ec != errcode.ErrCodeWorkerIdSrvOk {
if ec != errcode.ErrCodeHvyogoSrvOk {
logger.Error("ApiHygQueryAgreeState fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
@ -31,7 +31,7 @@ func ApiHvyogoWorkerFindDetail(ctx *gin.Context) {
// 存入数据
data, ec := service.DefaultService.ApiHvyogoWorkerFindDetail(ctx, req)
if ec != errcode.ErrCodeWorkerIdSrvOk {
if ec != errcode.ErrCodeHvyogoSrvOk {
logger.Error("ApiHygWorkerFindDetail fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
@ -46,7 +46,7 @@ func ApiHvyogoSingleDistribute(ctx *gin.Context) {
// 存入数据
data, ec := service.DefaultService.ApiHvyogoSingleDistribute(ctx, req)
if ec != errcode.ErrCodeWorkerIdSrvOk {
if ec != errcode.ErrCodeHvyogoSrvOk {
logger.Error("ApiHygSingleDistribute fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return

View File

@ -3261,6 +3261,9 @@ func (s *Service) ApiGetZoneCollaboratorList(ctx *gin.Context, req *zone_collabo
}
func (s *Service) ApiHvyogoQueryAgreeState(ctx *gin.Context, req *hvyogoproto.ApiQueryAgreeStateReq) (data *hvyogoproto.ApiQueryAgreeStateData, ec errcode.ErrCode) {
ec = errcode.ErrCodeHvyogoSrvOk
// 1.查询workerId
workerId, err := _DefaultWorkerId.OpListByMid(ctx, &workeridproto.OpListByMidReq{
BaseRequest: req.BaseRequest,
@ -3298,6 +3301,9 @@ func (s *Service) ApiHvyogoQueryAgreeState(ctx *gin.Context, req *hvyogoproto.Ap
}
func (s *Service) ApiHvyogoWorkerFindDetail(ctx *gin.Context, req *hvyogoproto.ApiWorkerFindDetailReq) (data *hvyogoproto.ApiWorkerFindDetailData, ec errcode.ErrCode) {
ec = errcode.ErrCodeHvyogoSrvOk
// 1.查询workerId
workerId, err := _DefaultWorkerId.OpListByMid(ctx, &workeridproto.OpListByMidReq{
BaseRequest: req.BaseRequest,
@ -3336,6 +3342,8 @@ func (s *Service) ApiHvyogoWorkerFindDetail(ctx *gin.Context, req *hvyogoproto.A
func (s *Service) ApiHvyogoSingleDistribute(ctx *gin.Context, req *hvyogoproto.ApiSingleDistributeReq) (data *hvyogoproto.ApiSingleDistributeData, ec errcode.ErrCode) {
ec = errcode.ErrCodeHvyogoSrvOk
// 1.查询workerId
workerId, err := _DefaultWorkerId.OpListByMid(ctx, &workeridproto.OpListByMidReq{
BaseRequest: req.BaseRequest,

View File

@ -118,11 +118,21 @@ func (s *HvyogoService) SingleDistribute(req *request.HYG10010001Req) (vo *hvyog
func afterReceiving(resp []byte, vo any) (err error) {
baseResponse := &response.HygBaseResponse{}
err = json.Unmarshal(resp, vo)
if err != nil {
logger.Error("json Unmarshal fail, err: %v", err)
return
}
err = json.Unmarshal(resp, baseResponse)
if err != nil {
logger.Error("json Unmarshal fail, err: %v", err)
return
}
if baseResponse.StatusCode != response.StatusCodeSuccess {
return
}
aesEncryptedStr, ok := baseResponse.Data.(string)
if !ok {
err = fmt.Errorf("type assertion fail")
@ -143,11 +153,6 @@ func afterReceiving(resp []byte, vo any) (err error) {
logger.Error("json Unmarshal fail, err: %v", err)
return
}
err = json.Unmarshal(resp, vo)
if err != nil {
logger.Error("json Unmarshal fail, err: %v", err)
return
}
return
}