UserController.java
1.46 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 cn.com.glsx.modules.controller;
import cn.com.glsx.modules.model.param.UserBo;
import cn.com.glsx.modules.model.param.UserInfo;
import cn.com.glsx.modules.service.UserService;
import com.alibaba.fastjson.JSONObject;
import com.glsx.plat.core.web.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
* 对接涂鸦用户模块
*
* @author zhouhaibao
* @date 2021/3/3 17:35
*/
@Controller
@RequestMapping("/user")
@Api(value = "用户模块", tags = {"用户模块"})
public class UserController {
@Autowired
private UserService userService;
/**
* 注册用户信息
*
* @param userBo 用户信息
* @return
*/
@RequestMapping(value = "/registerUser", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "注册用户")
public R registerUser(@RequestBody UserBo userBo) {
return userService.registerUser(userBo);
}
/**
* 根据id查询用户信息
*
* @param id 用户id
* @return 用户信息
*/
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户")
public R getUserInfo(@PathVariable String id) {
return userService.getUserInfo(id);
}
}