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);
|
}
|
|
|
}
|