v1.0.0
This commit is contained in:
@@ -27,7 +27,49 @@ func NewQueryExampleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Quer
|
||||
}
|
||||
|
||||
func (l *QueryExampleLogic) QueryExample(req *types.QueryExampleReq) (resp *types.QueryExampleResp, err error) {
|
||||
var exampleID int64 = 8
|
||||
var exampleID int64
|
||||
switch req.Feature {
|
||||
case "toc_PhoneThreeElements":
|
||||
exampleID = 83
|
||||
case "toc_BankCardBlacklist":
|
||||
exampleID = 106
|
||||
case "toc_IDCardTwoElements":
|
||||
exampleID = 85
|
||||
case "toc_PhoneTwoElements":
|
||||
exampleID = 86
|
||||
case "toc_NetworkDuration":
|
||||
exampleID = 117
|
||||
case "toc_PhoneSecondaryCard":
|
||||
exampleID = 124
|
||||
case "toc_PhoneNumberRisk":
|
||||
exampleID = 126
|
||||
case "toc_BankCardFourElements":
|
||||
exampleID = 131
|
||||
//case "toc_BankCardThreeElements":
|
||||
// exampleID = 9
|
||||
//case "toc_NaturalLifeStatus":
|
||||
// exampleID = 10
|
||||
//case "toc_EducationVerification":
|
||||
// exampleID = 11
|
||||
case "toc_PersonVehicleVerification":
|
||||
exampleID = 110
|
||||
case "toc_VehiclesUnderName":
|
||||
exampleID = 108
|
||||
case "toc_DualMarriage":
|
||||
exampleID = 103
|
||||
case "toc_PersonalBadRecord":
|
||||
exampleID = 73
|
||||
case "toc_ShareholderBusinessRelation":
|
||||
exampleID = 16
|
||||
case "toc_PersonalLawsuit":
|
||||
exampleID = 75
|
||||
case "toc_EnterpriseLawsuit":
|
||||
exampleID = 81
|
||||
case "toc_Marriage":
|
||||
exampleID = 72
|
||||
default:
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "示例报告, 获取示例报告失败: %v", err)
|
||||
}
|
||||
queryModel, err := l.svcCtx.QueryModel.FindOne(l.ctx, exampleID)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "示例报告, 获取示例报告失败: %v", err)
|
||||
@@ -36,20 +78,24 @@ func (l *QueryExampleLogic) QueryExample(req *types.QueryExampleReq) (resp *type
|
||||
query.CreateTime = queryModel.CreateTime.Format("2006-01-02 15:04:05")
|
||||
query.UpdateTime = queryModel.UpdateTime.Format("2006-01-02 15:04:05")
|
||||
|
||||
// 解密查询数据
|
||||
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(queryModel.QueryParams, &query.QueryParams, key)
|
||||
if processParamsErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 报告参数处理失败: %v", processParamsErr)
|
||||
}
|
||||
processErr := ProcessQueryData(queryModel.QueryData, &query.QueryData, key)
|
||||
if processErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 报告结果处理失败: %v", processErr)
|
||||
}
|
||||
|
||||
copyErr := copier.Copy(&query, queryModel)
|
||||
if copyErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 示例报告结构体复制失败, %+v", err)
|
||||
// 复制报告数据
|
||||
err = copier.Copy(&query, queryModel)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "示例报告, 报告结构体复制失败, %+v", err)
|
||||
}
|
||||
product, err := l.svcCtx.ProductModel.FindOne(l.ctx, queryModel.ProductId)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user