xuhy
2025-01-09 712f70b2936079a131ecb1e63c6d337171618cad
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
package com.stylefeng.guns.modular.cloudPayment.controller;
 
import com.google.gson.Gson;
import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.unionpay.upyzt.resp.CusApplicationSmsCodeResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@Api(tags = "个人用户进件")
@Slf4j
@RestController
@RequestMapping("/api/openAccountMgmt")
public class OpenAccountMgmtController {
 
    @Autowired
    private Gson gson;
 
    /**
     * 个人用户进件-短信验证码
     * @param phone 手机号
     * @return 返回参数
     * @throws Exception 异常
     */
    @ResponseBody
    @PostMapping("/smsCode")
    @ApiOperation(value = "个人用户进件-短信验证码", tags = {"用户端-云闪付相关"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<CusApplicationSmsCodeResp> smsCode(@RequestBody String phone){
        CusApplicationSmsCodeResp cusApplicationSmsCodeResp;
        try{
            // 个人用户进件-短信验证码
            cusApplicationSmsCodeResp = CusApplicationExample.smsCode(phone);
            log.info("------- 个人用户进件-短信验证码 ------- {} ", gson.toJson(cusApplicationSmsCodeResp));
        }catch (Exception e){
            log.error("个人用户进件-短信验证码失败!!!:{}",e.getMessage());
            e.printStackTrace();
            return ResultUtil.error("个人用户进件-短信验证码失败!!!");
        }
        return ResultUtil.success(cusApplicationSmsCodeResp);
    }
 
 
}