|
@@ -6,8 +6,10 @@ import com.xkl.authorization.annotation.Sign; |
|
@@ -6,8 +6,10 @@ import com.xkl.authorization.annotation.Sign; |
6
|
import com.xkl.authorization.manager.ITokenManager;
|
6
|
import com.xkl.authorization.manager.ITokenManager;
|
7
|
import com.xkl.config.ResultStatus;
|
7
|
import com.xkl.config.ResultStatus;
|
8
|
import com.xkl.domain.User;
|
8
|
import com.xkl.domain.User;
|
|
|
9
|
+import com.xkl.domain.XklMemberEntity;
|
9
|
import com.xkl.model.ResultModel;
|
10
|
import com.xkl.model.ResultModel;
|
10
|
import com.xkl.repository.UserRepository;
|
11
|
import com.xkl.repository.UserRepository;
|
|
|
12
|
+import com.xkl.repository.XklMemberRespository;
|
11
|
import com.xkl.security.AntiXSS;
|
13
|
import com.xkl.security.AntiXSS;
|
12
|
import com.wordnik.swagger.annotations.ApiImplicitParam;
|
14
|
import com.wordnik.swagger.annotations.ApiImplicitParam;
|
13
|
import com.wordnik.swagger.annotations.ApiImplicitParams;
|
15
|
import com.wordnik.swagger.annotations.ApiImplicitParams;
|
|
@@ -34,11 +36,13 @@ public class UserInfoController { |
|
@@ -34,11 +36,13 @@ public class UserInfoController { |
34
|
private UserRepository userRepository;
|
36
|
private UserRepository userRepository;
|
35
|
@Autowired
|
37
|
@Autowired
|
36
|
private ITokenManager tokenManager;
|
38
|
private ITokenManager tokenManager;
|
|
|
39
|
+ @Autowired
|
|
|
40
|
+ private XklMemberRespository xklMemberRespository;
|
37
|
|
41
|
|
38
|
@AntiXSS
|
42
|
@AntiXSS
|
39
|
//@Sign
|
43
|
//@Sign
|
40
|
@RequestMapping(method = RequestMethod.POST)
|
44
|
@RequestMapping(method = RequestMethod.POST)
|
41
|
- @ApiOperation(value = "注册")
|
45
|
+ @ApiOperation(value = "用户注册接口")
|
42
|
public ResponseEntity<ResultModel> register(HttpServletRequest request,@RequestParam String username, @RequestParam String password,
|
46
|
public ResponseEntity<ResultModel> register(HttpServletRequest request,@RequestParam String username, @RequestParam String password,
|
43
|
@RequestParam String sign,@RequestParam long t,@RequestParam int type) {
|
47
|
@RequestParam String sign,@RequestParam long t,@RequestParam int type) {
|
44
|
Assert.notNull(username, "username can not be empty");
|
48
|
Assert.notNull(username, "username can not be empty");
|
|
@@ -51,7 +55,10 @@ public class UserInfoController { |
|
@@ -51,7 +55,10 @@ public class UserInfoController { |
51
|
String salt= SecurityTool.genSalt();
|
55
|
String salt= SecurityTool.genSalt();
|
52
|
String pass=SecurityTool.getPassword(username,password,salt);
|
56
|
String pass=SecurityTool.getPassword(username,password,salt);
|
53
|
user = new User();
|
57
|
user = new User();
|
54
|
- user.setMember_id(123);
|
58
|
+ /**
|
|
|
59
|
+ * TODO:暂时都为1
|
|
|
60
|
+ */
|
|
|
61
|
+ user.setMember_id(1);
|
55
|
user.setUsername(username);
|
62
|
user.setUsername(username);
|
56
|
user.setPassword(pass);
|
63
|
user.setPassword(pass);
|
57
|
user.setSalt(salt);
|
64
|
user.setSalt(salt);
|
|
@@ -66,7 +73,7 @@ public class UserInfoController { |
|
@@ -66,7 +73,7 @@ public class UserInfoController { |
66
|
@AntiXSS
|
73
|
@AntiXSS
|
67
|
//@Sign
|
74
|
//@Sign
|
68
|
@RequestMapping(method = RequestMethod.PUT)
|
75
|
@RequestMapping(method = RequestMethod.PUT)
|
69
|
- @ApiOperation(value = "修改用户密码")
|
76
|
+ @ApiOperation(value = "用户密码修改接口")
|
70
|
@ApiImplicitParams({
|
77
|
@ApiImplicitParams({
|
71
|
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
|
78
|
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
|
72
|
})
|
79
|
})
|
|
@@ -84,13 +91,15 @@ public class UserInfoController { |
|
@@ -84,13 +91,15 @@ public class UserInfoController { |
84
|
|
91
|
|
85
|
@RequestMapping(method = RequestMethod.GET)
|
92
|
@RequestMapping(method = RequestMethod.GET)
|
86
|
@Authorization
|
93
|
@Authorization
|
87
|
- @ApiOperation(value = "获取用户id")
|
94
|
+ @ApiOperation(value = "个人信息查询接口")
|
88
|
@ApiImplicitParams({
|
95
|
@ApiImplicitParams({
|
89
|
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
|
96
|
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
|
90
|
})
|
97
|
})
|
91
|
- public ResponseEntity<ResultModel> getUserNickName(@CurrentUser User user) {
|
98
|
+ public ResponseEntity<ResultModel> getUserInfo(HttpServletRequest request,@CurrentUser User user,
|
|
|
99
|
+ @RequestParam String sign,@RequestParam long t,@RequestParam int type) {
|
92
|
long member_id=user.getMember_id();
|
100
|
long member_id=user.getMember_id();
|
93
|
- return new ResponseEntity<>(ResultModel.ok(member_id), HttpStatus.OK);
|
101
|
+ XklMemberEntity xklMemberEntity=xklMemberRespository.findOne(member_id);
|
|
|
102
|
+ return new ResponseEntity<>(ResultModel.ok(xklMemberEntity), HttpStatus.OK);
|
94
|
}
|
103
|
}
|
95
|
|
104
|
|
96
|
} |
105
|
} |