|
@@ -40,15 +40,14 @@ public class UserController {
|
40
|
40
|
@ApiOperation(value = "登录", notes = "根据登录名和验证码")
|
41
|
41
|
@ApiImplicitParams({
|
42
|
42
|
@ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区"),
|
43
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginName",value = "登陆名(手机号)"),
|
44
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码")
|
|
43
|
+ @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "loginName(登陆名(手机号)) code(验证码)"),
|
45
|
44
|
})
|
46
|
45
|
@RequestMapping(value = "/user/login/{communityId}",method = RequestMethod.POST)
|
47
|
|
- public ResponseBean login(@RequestParam(value = "loginName") String loginName,
|
48
|
|
- @RequestParam(value = "code",defaultValue = "") String code,
|
|
46
|
+ public ResponseBean login(@RequestBody String parameter,
|
49
|
47
|
@PathVariable(value = "communityId") String communityId,
|
50
|
48
|
HttpSession session){
|
51
|
|
- ResponseBean responseBean = iTaUserService.login(loginName,communityId,code);
|
|
49
|
+ JSONObject jsonObject = JSONObject.parseObject(parameter);
|
|
50
|
+ ResponseBean responseBean = iTaUserService.login(jsonObject.getString("loginName"),communityId, jsonObject.getString("code"));
|
52
|
51
|
TaUserVO userVO = (TaUserVO) responseBean.getData();
|
53
|
52
|
|
54
|
53
|
if (null != userVO) {
|
|
@@ -63,7 +62,8 @@ public class UserController {
|
63
|
62
|
@ApiOperation(value = "修改手机号", notes = "修改手机号")
|
64
|
63
|
@ApiImplicitParams({
|
65
|
64
|
@ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "登陆(手机号)"),
|
66
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码")
|
|
65
|
+ @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码"),
|
|
66
|
+ @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
|
67
|
67
|
})
|
68
|
68
|
@RequestMapping(value = "/user/phone",method = RequestMethod.PUT)
|
69
|
69
|
public ResponseBean update(@RequestBody String paramets, HttpSession session){
|
|
@@ -86,16 +86,17 @@ public class UserController {
|
86
|
86
|
}
|
87
|
87
|
@ApiOperation(value = "修改用户名和性别", notes = "修改用户名和性别")
|
88
|
88
|
@ApiImplicitParams({
|
89
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "userName",value = "用户民"),
|
90
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "gender",value = "性别")
|
|
89
|
+ @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName用户民和gender性别"),
|
|
90
|
+ @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
|
91
|
91
|
})
|
92
|
92
|
@RequestMapping(value = "/user/update/info",method = RequestMethod.PUT)
|
93
|
|
- public ResponseBean updateUserNameAndGender(@RequestBody TaUser user,
|
|
93
|
+ public ResponseBean updateUserNameAndGender(@RequestBody String parameter,
|
94
|
94
|
HttpSession session){
|
95
|
95
|
ResponseBean response = new ResponseBean();
|
96
|
96
|
|
97
|
97
|
UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
|
98
|
98
|
|
|
99
|
+ TaUser user = JSONObject.parseObject(parameter,TaUser.class);
|
99
|
100
|
user.setId(userElement.getId());
|
100
|
101
|
|
101
|
102
|
response = iTaUserService.modifyUser(user);
|
|
@@ -105,8 +106,8 @@ public class UserController {
|
105
|
106
|
|
106
|
107
|
@ApiOperation(value = "租客或家属 启用或者停用", notes = "租客或家属 启用或者停用")
|
107
|
108
|
@ApiImplicitParams({
|
108
|
|
- @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "userId",value = "租客或者家属"),
|
109
|
|
- @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "type",value = "1启用 0停用")
|
|
109
|
+ @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userId(租客或者家属) type(1启用 0停用)"),
|
|
110
|
+ @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
|
110
|
111
|
})
|
111
|
112
|
@RequestMapping(value = "/user/update/dependentsOrTenants",method = RequestMethod.PUT)
|
112
|
113
|
public ResponseBean updateDependentsOrTenants(@RequestBody String parameter,
|
|
@@ -125,10 +126,11 @@ public class UserController {
|
125
|
126
|
|
126
|
127
|
@ApiOperation(value = "业主添加 租客或家属", notes = "业主添加 租客或家属")
|
127
|
128
|
@ApiImplicitParams({
|
128
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "userName",value = "租客或者家属 姓名"),
|
129
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "租客或者家属 手机号"),
|
130
|
|
- @ApiImplicitParam(paramType = "query",dataType = "String",name = "gender",value = "租客或者家属 性别 1男 2女"),
|
131
|
|
- @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "type",value = "1家属 0租客")
|
|
129
|
+ @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName(租客或者家属 姓名) " +
|
|
130
|
+ "phone(租客或者家属 手机号) " +
|
|
131
|
+ "gender(租客或者家属 性别 1男 2女) " +
|
|
132
|
+ "type(1家属 0租客)"),
|
|
133
|
+ @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
|
132
|
134
|
})
|
133
|
135
|
@RequestMapping(value = "/user/update/addTenantsOrDependents",method = RequestMethod.POST)
|
134
|
136
|
public ResponseBean addTenantsOrDependents(@RequestBody String parameter,
|
|
@@ -147,5 +149,36 @@ public class UserController {
|
147
|
149
|
}
|
148
|
150
|
|
149
|
151
|
|
|
152
|
+ @ApiOperation(value = "修改用户头像", notes = "修改用户头像")
|
|
153
|
+ @ApiImplicitParams({
|
|
154
|
+ @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "headPortrait(用户头像)"),
|
|
155
|
+ @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
|
|
156
|
+ })
|
|
157
|
+ @RequestMapping(value = "/user/update/modifyUserHeadPortrait",method = RequestMethod.PUT)
|
|
158
|
+ public ResponseBean modifyUserHeadPortrait(@RequestBody String parameter,
|
|
159
|
+ HttpSession session){
|
|
160
|
+
|
|
161
|
+ UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
|
|
162
|
+ JSONObject jsonObject = JSONObject.parseObject(parameter);
|
|
163
|
+ ResponseBean response = iTaUserService.modifyUserHeadPortrait(userElement.getId(),jsonObject.getString("headPortrait"));
|
|
164
|
+
|
|
165
|
+ return response;
|
|
166
|
+
|
|
167
|
+ }
|
|
168
|
+
|
|
169
|
+ @ApiOperation(value = "获取用户信息", notes = "获取用户信息")
|
|
170
|
+ @ApiImplicitParams({
|
|
171
|
+ @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
|
|
172
|
+ })
|
|
173
|
+ @RequestMapping(value = "/user/info",method = RequestMethod.GET)
|
|
174
|
+ public ResponseBean getUserInfo(HttpSession session){
|
|
175
|
+ ResponseBean response = new ResponseBean();
|
|
176
|
+
|
|
177
|
+ UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
|
|
178
|
+ response = iTaUserService.getUserInfo(userElement.getId());
|
|
179
|
+
|
|
180
|
+ return response;
|
|
181
|
+
|
|
182
|
+ }
|
150
|
183
|
|
151
|
184
|
}
|