|
@@ -4,8 +4,10 @@ package com.community.huiju.controller;
|
4
|
4
|
import com.alibaba.fastjson.JSONObject;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.community.commom.mode.ResponseBean;
|
|
7
|
+import com.community.commom.session.UserElement;
|
7
|
8
|
import com.community.huiju.common.base.BaseController;
|
8
|
9
|
import com.community.huiju.model.TaUser;
|
|
10
|
+import com.community.huiju.model.User;
|
9
|
11
|
import com.community.huiju.service.IUserService;
|
10
|
12
|
import io.swagger.annotations.Api;
|
11
|
13
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -60,4 +62,31 @@ public class UserController extends BaseController {
|
60
|
62
|
ResponseBean allApprove=userService.selectUserApprove(paramets);
|
61
|
63
|
return allApprove;
|
62
|
64
|
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+ @ApiOperation(value = "登陆", notes = "登陆")
|
|
68
|
+ @ApiImplicitParams({
|
|
69
|
+ @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "phone手机号;code验证码;communityId小区Id")
|
|
70
|
+ })
|
|
71
|
+ @RequestMapping(value = "/user/login")
|
|
72
|
+ public ResponseBean login(@RequestBody String parameter){
|
|
73
|
+ ResponseBean responseBean = new ResponseBean();
|
|
74
|
+ JSONObject jsonObject = JSONObject.parseObject(parameter);
|
|
75
|
+ responseBean = userService.login(jsonObject.getString("phone"),
|
|
76
|
+ jsonObject.getInteger("communityId"),
|
|
77
|
+ jsonObject.getInteger("code"));
|
|
78
|
+ return responseBean;
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ @ApiOperation(value = "获取用户信息", notes = "获取用户信息")
|
|
82
|
+ @ApiImplicitParams({
|
|
83
|
+ @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
|
|
84
|
+ })
|
|
85
|
+ @RequestMapping(value = "/user/info", method = RequestMethod.GET)
|
|
86
|
+ public ResponseBean info(HttpSession session){
|
|
87
|
+ ResponseBean responseBean = new ResponseBean();
|
|
88
|
+ UserElement userElement = getUserElement(session);
|
|
89
|
+ responseBean = userService.userInfo(userElement.getId());
|
|
90
|
+ return responseBean;
|
|
91
|
+ }
|
63
|
92
|
}
|