Commit f5930dd2 authored by 黎博's avatar 黎博

新增vcc

parent fdd777c6
package cn.qg.qaplatform.controller;
import cn.qg.qaplatform.common.JsonResult;
import cn.qg.qaplatform.domain.GenVccUser;
import cn.qg.qaplatform.service.VccDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("vcc")
public class GenVccController {
@Autowired
VccDataService vccDataService;
@PostMapping("/gen")
public JsonResult genVccUser(String namespace, String phoneNo, String channel) throws Exception {
GenVccUser result = vccDataService.makeVccUser(namespace, phoneNo, channel, 0);
return JsonResult.success(result);
}
}
package cn.qg.qaplatform.domain;
import lombok.Data;
import java.util.Date;
@Data
public class GenVccUser {
/**
* 手机号
*/
private String phoneNo;
/**
* uuid
*/
private String uuid;
/**
* 开通的渠道
*/
private Long openedChannel;
/**
* 创建日期
*/
private Date createdAt;
/**
* 开通状态
* 0-授信通过
*/
private Integer status;
}
This diff is collapsed.
package cn.qg.qaplatform.service;
import cn.qg.qaplatform.domain.GenVccUser;
public interface VccDataService {
GenVccUser makeVccUser(String namespace, String phoneNo, String openedChannel, Integer status) throws Exception;
}
package cn.qg.qaplatform.service.impl;
import cn.qg.qaplatform.domain.GenVccUser;
import cn.qg.qaplatform.process.Vcc;
import cn.qg.qaplatform.service.VccDataService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service
public class VccDataServiceImpl implements VccDataService {
@Override
public GenVccUser makeVccUser(String namespace, String phoneNo, String openedChannel, Integer status) throws Exception {
String vccChannel = null;
if (openedChannel.equals("214")) {
vccChannel = "159904";
} else if (openedChannel.equals("217")) {
vccChannel = "159905";
}
if (vccChannel == null) {
return null;
}
// 登录
Map loginResult = Vcc.login(namespace, phoneNo, openedChannel, openedChannel);
String token = loginResult.get("token").toString();
String uuid = loginResult.get("uuid").toString();
// credit url
String vccToken = Vcc.creditUrl(namespace, token, vccChannel, vccChannel);
// 身份证正面
Vcc.uploadFrontIdCard(vccToken, uuid);
// 身份证反面
Vcc.uploadBackIdCard(vccToken, uuid);
// 放置身份证重复
Vcc.modifyExistIdNo(namespace);
// talos保存用户信息
Vcc.saveUserDetails(namespace, token, vccChannel);
// 提交ocr
Vcc.submitOcr(vccToken, vccChannel);
// 提交授信
Vcc.submitCredit(namespace, token, vccChannel);
// 授信结果查询
Vcc.searchCreditResult(namespace, token, vccChannel);
// 人脸识别回调
Vcc.appFaceCallback(namespace, token, vccChannel);
// 基本信息
Vcc.basicInfo(namespace, token, vccChannel);
// 发送验证码
String requestId = Vcc.bindCardSms(namespace, token, vccChannel, "ABC", "6228272537046278993");
// 额度激活
Vcc.quotaActivation(namespace, token, vccChannel, "6228272537046278993", requestId);
// 开户结果
JSONObject result = Vcc.openResult(namespace, token, vccChannel);
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment