Sunshine
2024-11-04 177f10973fd9bc1f0930369bb086ad9f0053440c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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");
    }
}