diff --git a/app/mix/controller/hvyogo_api.go b/app/mix/controller/hvyogo_api.go index 22ab7605..51cdf892 100644 --- a/app/mix/controller/hvyogo_api.go +++ b/app/mix/controller/hvyogo_api.go @@ -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 diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 4991d969..6761bd16 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -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, diff --git a/app/mix/service/hvyogoservice.go b/app/mix/service/hvyogoservice.go index 7eda30b3..49ac2d51 100644 --- a/app/mix/service/hvyogoservice.go +++ b/app/mix/service/hvyogoservice.go @@ -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 }