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
d387b71c
Commit
d387b71c
authored
Sep 12, 2023
by
唐峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息查询,增加微信头像和昵称信息
parent
d1b66469
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
UserBean.java
src/main/java/cn/quantgroup/xyqb/model/UserBean.java
+14
-6
No files found.
src/main/java/cn/quantgroup/xyqb/model/UserBean.java
View file @
d387b71c
...
...
@@ -42,10 +42,14 @@ public class UserBean {
private
String
openId
;
private
String
appId
;
private
String
unionId
;
//昵称
private
String
nickName
;
//头像
private
String
photo
;
}
@Data
public
static
class
UserAttachedInfo
{
public
static
class
UserAttachedInfo
{
private
Gender
gender
;
...
...
@@ -63,7 +67,7 @@ public class UserBean {
}
public
static
UserBean
from
(
User
user
,
List
<
WechatUserInfo
>
wechatUserInfoList
,
UserInfoEntity
userInfoEntity
)
{
public
static
UserBean
from
(
User
user
,
List
<
WechatUserInfo
>
wechatUserInfoList
,
UserInfoEntity
userInfoEntity
)
{
UserBean
userBean
=
new
UserBean
();
userBean
.
setUserId
(
user
.
getId
());
userBean
.
setPhoneNo
(
user
.
getPhoneNo
());
...
...
@@ -74,8 +78,10 @@ public class UserBean {
userBean
.
setCreatedAt
(
user
.
getCreatedAt
());
if
(
CollectionUtils
.
isNotEmpty
(
wechatUserInfoList
))
{
List
<
Wechat
>
wcList
=
Lists
.
newArrayList
();
wechatUserInfoList
.
stream
().
forEach
(
wechatUserInfo
->
{
wechatUserInfoList
.
stream
().
forEach
(
wechatUserInfo
->
{
Wechat
build
=
Wechat
.
builder
()
.
nickName
(
wechatUserInfo
.
getNickName
())
.
photo
(
wechatUserInfo
.
getHeadImgUrl
())
.
openId
(
wechatUserInfo
.
getOpenId
())
.
unionId
(
wechatUserInfo
.
getUnionId
())
.
appId
(
wechatUserInfo
.
getAppId
()).
build
();
...
...
@@ -86,13 +92,13 @@ public class UserBean {
}
if
(
userInfoEntity
!=
null
)
{
UserAttachedInfo
info
=
new
UserAttachedInfo
();
BeanUtils
.
copyProperties
(
userInfoEntity
,
info
);
BeanUtils
.
copyProperties
(
userInfoEntity
,
info
);
userBean
.
setUserAttachedInfo
(
info
);
}
return
userBean
;
}
public
static
List
<
UserBean
>
from
(
List
<
User
>
userList
,
List
<
WechatUserInfo
>
wechatUserInfoList
,
List
<
UserInfoEntity
>
userInfoEntityList
)
{
public
static
List
<
UserBean
>
from
(
List
<
User
>
userList
,
List
<
WechatUserInfo
>
wechatUserInfoList
,
List
<
UserInfoEntity
>
userInfoEntityList
)
{
Map
<
Long
,
UserInfoEntity
>
userIdEntityMap
=
Maps
.
newHashMap
();
if
(
CollectionUtils
.
isNotEmpty
(
userInfoEntityList
))
{
...
...
@@ -115,7 +121,7 @@ public class UserBean {
UserInfoEntity
userInfoEntity
=
userIdEntityMap
.
get
(
user
.
getId
());
if
(
userInfoEntity
!=
null
)
{
UserAttachedInfo
info
=
new
UserAttachedInfo
();
BeanUtils
.
copyProperties
(
userInfoEntity
,
info
);
BeanUtils
.
copyProperties
(
userInfoEntity
,
info
);
userBean
.
setUserAttachedInfo
(
info
);
}
...
...
@@ -126,6 +132,8 @@ public class UserBean {
if
(
optionalWechatUserInfo
.
isPresent
())
{
WechatUserInfo
wechatUserInfo
=
optionalWechatUserInfo
.
get
();
userBean
.
setWechatList
(
Collections
.
singletonList
(
Wechat
.
builder
()
.
nickName
(
wechatUserInfo
.
getNickName
())
.
photo
(
wechatUserInfo
.
getHeadImgUrl
())
.
openId
(
wechatUserInfo
.
getOpenId
())
.
unionId
(
wechatUserInfo
.
getUnionId
())
.
appId
(
wechatUserInfo
.
getAppId
()).
build
()));
...
...
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