puzhibing
2023-06-14 e9c96f32b0830cf7bc6ee66ce2c7a9784c679753
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
package com.dsh.account.controller;
 
import com.dsh.account.service.TAppUserService;
import com.dsh.account.util.ResultUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author zhibing.pu
 * @date 2023/6/14 15:30
 */
@RestController
@RequestMapping("")
public class AppUserController {
 
    @Autowired
    private TAppUserService appUserService;
 
 
 
 
    @ResponseBody
    @PostMapping("/base/appUser/getSMSCode")
    @ApiOperation(value = "获取短信验证码", tags = {"用户—登录注册"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "类型(1:登录,2:注册,3:修改密码,4:忘记密码)", name = "type", dataType = "int", required = true),
            @ApiImplicitParam(value = "电话号码", name = "phone", dataType = "string", required = true)
    })
    public ResultUtil getSMSCode(@RequestBody Integer type, @RequestBody String phone){
        try {
            ResultUtil smsCode = appUserService.getSMSCode(type, phone);
            return smsCode;
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}