fix queryExample
This commit is contained in:
parent
ab282e4bcc
commit
52e88b1cbf
@ -45,12 +45,15 @@ func (l *QueryExampleLogic) QueryExample(req *types.QueryExampleReq) (resp *type
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 获取示例参数失败, %v", err)
|
||||
}
|
||||
// 将字符串类型的QueryParams解析为map[string]interface{}
|
||||
var queryParams map[string]interface{}
|
||||
if err := sonic.Unmarshal([]byte(exampleParams.QueryParams), &queryParams); err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 解析示例参数失败, %v", err)
|
||||
secretKey := l.svcCtx.Config.Encrypt.SecretKey
|
||||
key, decodeErr := hex.DecodeString(secretKey)
|
||||
if decodeErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 获取AES解密解药失败, %+v", err)
|
||||
}
|
||||
processParamsErr := ProcessQueryParams(exampleParams.QueryParams, &query.QueryParams, key)
|
||||
if processParamsErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 报告参数处理失败: %v", processParamsErr)
|
||||
}
|
||||
query.QueryParams = queryParams
|
||||
// 查询ProductFeatureModel获取产品相关的功能列表
|
||||
builder := l.svcCtx.ProductFeatureModel.SelectBuilder().Where("product_id = ?", product.Id)
|
||||
productFeatures, err := l.svcCtx.ProductFeatureModel.FindAll(l.ctx, builder, "")
|
||||
|
Loading…
Reference in New Issue
Block a user