v1.0.0
This commit is contained in:
parent
7309ef704d
commit
e96f8a5c8d
@ -65,7 +65,7 @@ func (l *QueryDetailByOrderIdLogic) QueryDetailByOrderId(req *types.QueryDetailB
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告查询, 查找订单错误: %+v", err)
|
||||
}
|
||||
}
|
||||
if order.Status == "failed" {
|
||||
if order.Status != "paid" {
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.LOGIC_QUERY_ERROR, ""), "")
|
||||
}
|
||||
// 获取报告信息
|
||||
|
@ -62,7 +62,7 @@ func (l *QueryDetailByOrderNoLogic) QueryDetailByOrderNo(req *types.QueryDetailB
|
||||
}
|
||||
}
|
||||
if order.Status != "paid" {
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.LOGIC_QUERY_WAIT, ""), "")
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.LOGIC_QUERY_ERROR, ""), "")
|
||||
}
|
||||
// 获取报告信息
|
||||
queryModel, err := l.svcCtx.QueryModel.FindOneByOrderId(l.ctx, order.Id)
|
||||
|
@ -9,7 +9,6 @@ import (
|
||||
"github.com/tidwall/gjson"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"qnc-server/app/user/cmd/api/internal/config"
|
||||
@ -364,7 +363,6 @@ func (a *ApiRequestService) ProcessG35SC01Request(params []byte) ([]byte, error)
|
||||
},
|
||||
}
|
||||
resp, callApiErr := a.westDexService.CallAPI("G35SC01", request)
|
||||
log.Println(string(resp))
|
||||
if callApiErr != nil {
|
||||
return nil, callApiErr
|
||||
}
|
||||
@ -386,13 +384,16 @@ func (a *ApiRequestService) ProcessG35SC01Request(params []byte) ([]byte, error)
|
||||
return nil, fmt.Errorf("内层 data 字段不存在或类型错误")
|
||||
}
|
||||
|
||||
if innerData == "" || innerData == "{}" || innerData == "[]" {
|
||||
innerData = "{}"
|
||||
}
|
||||
|
||||
// 第四步:解析内层 data 的 JSON 字符串
|
||||
var finalDataMap map[string]interface{}
|
||||
if err := json.Unmarshal([]byte(innerData), &finalDataMap); err != nil {
|
||||
return nil, fmt.Errorf("解析内层 data 字段失败: %v", err)
|
||||
}
|
||||
|
||||
// 将最终的 JSON 对象编码为字节数组返回
|
||||
finalDataBytes, err := json.Marshal(finalDataMap)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("编码最终的 JSON 对象失败: %v", err)
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/pkg/errors"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"qnc-server/app/user/cmd/api/internal/config"
|
||||
"qnc-server/pkg/lzkit/crypto"
|
||||
@ -98,6 +99,7 @@ func (w *WestDexService) CallAPI(code string, reqData map[string]interface{}) (r
|
||||
return nil, DecryptErr
|
||||
}
|
||||
return decryptedData, errors.New(westDexResp.Message)
|
||||
log.Println(string(decryptedData))
|
||||
}
|
||||
if westDexResp.Data == "" {
|
||||
return nil, errors.New(westDexResp.Message)
|
||||
@ -108,6 +110,8 @@ func (w *WestDexService) CallAPI(code string, reqData map[string]interface{}) (r
|
||||
return nil, DecryptErr
|
||||
}
|
||||
// 输出解密后的数据
|
||||
log.Println(string(decryptedData))
|
||||
|
||||
return decryptedData, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user