Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
c9491965
Commit
c9491965
authored
Aug 02, 2019
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户中心首页方法迁移到工网URL
parent
5dd96fd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
33 deletions
+30
-33
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+30
-4
UserCenterController.java
...controller/internal/user/center/UserCenterController.java
+0
-29
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
c9491965
...
...
@@ -9,6 +9,7 @@ import cn.quantgroup.xyqb.aspect.lock.PasswordErrorFiniteValidator;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.entity.Merchant
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.UserAttached
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.exception.UserNotExistException
;
import
cn.quantgroup.xyqb.exception.VerificationCodeErrorException
;
...
...
@@ -22,6 +23,7 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
import
cn.quantgroup.xyqb.service.user.ILockIpv4Service
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.service.user.UserCenterService
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.util.IPUtil
;
import
cn.quantgroup.xyqb.util.MqUtils
;
...
...
@@ -43,10 +45,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.UnsupportedEncodingException
;
import
java.nio.charset.Charset
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.*
;
/**
* Http服务接口:用户注册、登录、重置密码
...
...
@@ -60,6 +59,8 @@ public class UserController implements IBaseController {
@Autowired
private
IUserService
userService
;
@Autowired
private
UserCenterService
userCenterService
;
@Autowired
private
ILockIpv4Service
lockIpv4Service
;
@Autowired
@Qualifier
(
"stringRedisTemplate"
)
...
...
@@ -413,6 +414,31 @@ public class UserController implements IBaseController {
return
JsonResult
.
buildSuccessResult
(
"token valid"
,
exist
);
}
/**
* 用户中心首页,显示用户头像、昵称、姓名
*
* @return
*/
@PasswordFreeAccessValidator
@RequestMapping
(
"/center/index"
)
@ApiOperation
(
value
=
"用户中心首页"
,
notes
=
"用户中心首页显示头像, 昵称, 姓名"
,
httpMethod
=
"POST"
)
public
JsonResult
userCenterIndex
()
{
Long
userId
=
getCurrentUserFromRedis
().
getId
();
UserAttached
userAttached
=
userCenterService
.
searchUserAttachedByUserId
(
userId
);
Map
<
String
,
String
>
result
=
new
HashMap
<>();
if
(
userAttached
!=
null
)
{
result
.
put
(
"avatar"
,
userAttached
.
getAvatar
());
result
.
put
(
"nick"
,
userAttached
.
getNick
());
}
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
if
(
userDetail
!=
null
)
{
result
.
put
(
"name"
,
userDetail
.
getName
());
result
.
put
(
"sex"
,
Optional
.
ofNullable
(
userDetail
.
getGender
()).
orElse
(
cn
.
quantgroup
.
xyqb
.
model
.
Gender
.
UNKNOWN
).
ordinal
()
+
""
);
result
.
put
(
Constants
.
PHONE_NO
,
userDetail
.
getPhoneNo
().
substring
(
0
,
3
)
+
"****"
+
userDetail
.
getPhoneNo
().
substring
(
7
,
11
));
}
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
}
@RequestMapping
(
"/syncUserInfo"
)
public
JsonResult
syncUserInfo
(
HttpServletRequest
request
)
{
log
.
error
(
"[监控][UserController][syncUserInfo] request-Header:{}"
,
JSON
.
toJSONString
(
getRequestHeaderMap
(
request
)));
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/center/UserCenterController.java
View file @
c9491965
...
...
@@ -48,35 +48,6 @@ public class UserCenterController {
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
UserCenterController
.
class
);
/**
* 用户中心首页,显示用户头像、昵称、姓名
*
* @param phoneNo
* @return
*/
@PasswordFreeAccessValidator
@RequestMapping
(
"/index"
)
@ApiOperation
(
value
=
"用户中心首页"
,
notes
=
"用户中心首页显示头像, 昵称, 姓名"
,
httpMethod
=
"POST"
)
public
JsonResult
userCenterIndex
(
String
phoneNo
)
{
Long
userId
=
queryUserId
(
phoneNo
);
if
(
null
==
userId
||
userId
==
0L
)
{
return
JsonResult
.
buildErrorStateResult
(
"该用户不存在"
,
null
);
}
UserAttached
userAttached
=
userCenterService
.
searchUserAttachedByUserId
(
userId
);
Map
<
String
,
String
>
result
=
new
HashMap
<>();
if
(
userAttached
!=
null
)
{
result
.
put
(
"avatar"
,
userAttached
.
getAvatar
());
result
.
put
(
"nick"
,
userAttached
.
getNick
());
}
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
if
(
userDetail
!=
null
)
{
result
.
put
(
"name"
,
userDetail
.
getName
());
result
.
put
(
"sex"
,
Optional
.
ofNullable
(
userDetail
.
getGender
()).
orElse
(
cn
.
quantgroup
.
xyqb
.
model
.
Gender
.
UNKNOWN
).
ordinal
()
+
""
);
result
.
put
(
Constants
.
PHONE_NO
,
userDetail
.
getPhoneNo
().
substring
(
0
,
3
)
+
"****"
+
userDetail
.
getPhoneNo
().
substring
(
7
,
11
));
}
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
}
/**
* 根据用户手机号查询昵称.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment