package com.nova.sankuai.controller.v2;
|
|
import com.nova.sankuai.domain.api.jiniu.JnRegisterResponse;
|
import com.nova.sankuai.domain.api.jiniu.JnRequest;
|
import com.nova.sankuai.domain.api.jiniu.JnResponse;
|
import com.nova.sankuai.service.IJnService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* <p>
|
* 极牛半流程对接
|
* </p>
|
*
|
* @author denglb 2022/7/13
|
*/
|
@Api(tags = "极牛半流程对接")
|
@RestController
|
@RequestMapping(value = "/api/v2/jn")
|
@Slf4j
|
public class JnV2Controller {
|
|
@Autowired
|
private IJnService jnService;
|
|
@Value("${bsbjiniu.secretKey}")
|
private String bsbSecretKey;
|
|
@Value("${bsbjiniu.appId}")
|
private String bsbAppId;
|
|
@Value("${bsbjiniu.url}")
|
private String bsbUrl;
|
|
@Value("${kdnjiniu.secretKey}")
|
private String kdnSecretKey;
|
|
@Value("${kdnjiniu.appId}")
|
private String kdnAppId;
|
|
@Value("${kdnjiniu.url}")
|
private String kdnUrl;
|
|
|
@ApiOperation("彪河百顺宝极牛撞库")
|
@PostMapping("/customCheck")
|
public JnResponse customCheck(String userPhone) {
|
return jnService.checkUserPhone(userPhone);
|
}
|
|
@ApiOperation("彪河百顺宝联合注册登录")
|
@PostMapping("/register")
|
public JnRegisterResponse register(JnRequest request) {
|
if (request == null) {
|
log.error("极牛半流程对接:接受参数为null");
|
return JnRegisterResponse.fail("1003", "request is null");
|
}
|
return jnService.register(request, bsbSecretKey,bsbUrl,bsbAppId,"bsb");
|
}
|
|
@ApiOperation("秋畅卡大拿极牛撞库")
|
@PostMapping("/kdn/customCheck")
|
public JnResponse kdnCustomCheck(String userPhone) {
|
return jnService.checkUserPhone(userPhone);
|
}
|
|
@ApiOperation("秋畅卡大拿联合注册登录")
|
@PostMapping("/kdn/register")
|
public JnRegisterResponse kdnRegister(JnRequest request) {
|
if (request == null) {
|
log.error("极牛半流程对接:接受参数为null");
|
return JnRegisterResponse.fail("1003", "request is null");
|
}
|
return jnService.register(request, kdnSecretKey, kdnUrl, kdnAppId,"kdn");
|
}
|
}
|