UserController.java
1.66 KB
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
package org.nafmii.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nafmii.dto.user.LoginDto;
import org.nafmii.dto.user.RegisterDto;
import org.nafmii.response.Result;
import org.nafmii.service.UserService;
import org.nafmii.vo.AppUser;
import org.nafmii.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.*;
/**
* @author:zhoujh
* @Function:TODO
* @date 2021/4/25 10:10
* @ClassName:
* @version:
* @remark:
*/
@RestController
@RequestMapping("app/nafmii/user")
@Api(tags = "2.0.0", description = "用户登陆注册操作操作【zjh】")
public class UserController {
@Autowired
private UserService userService;
@ApiOperation( value = "模拟用户登陆",notes = "模拟用户登陆")
@PostMapping("/login")
@ResponseBody
public Result<UserVO> login (){
Result<UserVO> login = userService.login();
return login;
}
@ApiOperation( value = "app用户注册接口",notes = "app用户注册接口")
@PostMapping("/register")
@ResponseBody
public Result register (@RequestBody RegisterDto registerDto){
Result register = userService.register(registerDto);
return register;
}
@ApiOperation( value = "app用户登陆接口(密码加验证码)",notes = "app用户登陆接口(密码加验证码)")
@PostMapping("/login")
@ResponseBody
public Result<UserVO> login (@RequestBody LoginDto loginDto){
Result<UserVO> login = userService.userLogin(loginDto);
return login;
}
}