Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
d7962f65
Commit
d7962f65
authored
Dec 12, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抵用玩物得志社区接口获取用户签名
parent
168e0ed8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
2 deletions
+71
-2
ch-core/src/main/resources/application-dev.yml
ch-core/src/main/resources/application-dev.yml
+1
-0
ch-dao/pom.xml
ch-dao/pom.xml
+8
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
...java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
+24
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+16
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
+22
-0
No files found.
ch-core/src/main/resources/application-dev.yml
View file @
d7962f65
...
@@ -209,6 +209,7 @@ dubbo:
...
@@ -209,6 +209,7 @@ dubbo:
timeout
:
3000
timeout
:
3000
retries
:
-1
retries
:
-1
server
:
server
:
servlet
:
servlet
:
session
:
session
:
...
...
ch-dao/pom.xml
View file @
d7962f65
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<user-api.version>
1.9.33
</user-api.version>
<user-api.version>
1.9.33
</user-api.version>
<content-center-api.version>
3.0.41
</content-center-api.version>
</properties>
</properties>
<dependencies>
<dependencies>
...
@@ -222,6 +223,13 @@
...
@@ -222,6 +223,13 @@
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>
com.wwdz.mall
</groupId>
<artifactId>
content-center-api
</artifactId>
<version>
${content-center-api.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.dubbo
</groupId>
<groupId>
org.apache.dubbo
</groupId>
<artifactId>
dubbo
</artifactId>
<artifactId>
dubbo
</artifactId>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
View file @
d7962f65
package
com.wwdz.ch.wx.impl
;
package
com.wwdz.ch.wx.impl
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.consts.FollowFansEnum
;
import
com.wwdz.ch.core.consts.FollowFansEnum
;
import
com.wwdz.ch.core.consts.MessageEnum
;
import
com.wwdz.ch.core.consts.MessageEnum
;
...
@@ -17,6 +18,9 @@ import com.wwdz.ch.wx.entity.vo.FollowFansRecordVo;
...
@@ -17,6 +18,9 @@ import com.wwdz.ch.wx.entity.vo.FollowFansRecordVo;
import
com.wwdz.ch.wx.service.FollowFansRecordService
;
import
com.wwdz.ch.wx.service.FollowFansRecordService
;
import
com.wwdz.ch.wx.service.MessageService
;
import
com.wwdz.ch.wx.service.MessageService
;
import
com.wwdz.ch.wx.util.StringUtil
;
import
com.wwdz.ch.wx.util.StringUtil
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.wwdz.mall.contentcenter.api.CommunityAttributeReadService
;
import
com.wwdz.mall.contentcenter.domain.result.attribute.CommunityUserAttributeDO
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.EntityMapper
;
import
com.xxdxxs.utils.EntityMapper
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.JsonUtils
;
...
@@ -49,6 +53,9 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -49,6 +53,9 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Reference
CommunityAttributeReadService
communityAttributeReadService
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
follow
(
FollowFansRecordRequestDto
dto
)
{
public
Result
follow
(
FollowFansRecordRequestDto
dto
)
{
...
@@ -173,7 +180,15 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -173,7 +180,15 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
EntityMapper
.
copyAttribute
(
f
,
followFansRecordVo
);
EntityMapper
.
copyAttribute
(
f
,
followFansRecordVo
);
followFansRecordVo
.
setFollowerName
(
cacheUtil
.
getAppletUserNameById
(
f
.
getFollowerId
()));
followFansRecordVo
.
setFollowerName
(
cacheUtil
.
getAppletUserNameById
(
f
.
getFollowerId
()));
followFansRecordVo
.
setFollowerIcon
(
cacheUtil
.
getAppletUsers
(
f
.
getFollowerId
()).
getAvatar
());
followFansRecordVo
.
setFollowerIcon
(
cacheUtil
.
getAppletUsers
(
f
.
getFollowerId
()).
getAvatar
());
followFansRecordVo
.
setFollowerProfile
(
cacheUtil
.
getAppletUsers
(
f
.
getFollowerId
()).
getProfile
());
try
{
CloudServerResponse
<
CommunityUserAttributeDO
>
response
=
communityAttributeReadService
.
getCommunityUserAttributeByUserId
(
f
.
getFollowerId
());
if
(
response
.
isSuccess
())
{
followFansRecordVo
.
setFollowerProfile
(
response
.
getResult
().
getSignature
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}"
,
e
);
}
if
(
fansIdList
.
contains
(
f
.
getFollowerId
().
longValue
()))
{
if
(
fansIdList
.
contains
(
f
.
getFollowerId
().
longValue
()))
{
followFansRecordVo
.
setRelation
(
"互相关注"
);
followFansRecordVo
.
setRelation
(
"互相关注"
);
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BOTH_FOLLOWED
.
getCode
());
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BOTH_FOLLOWED
.
getCode
());
...
@@ -213,7 +228,14 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -213,7 +228,14 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
EntityMapper
.
copyAttribute
(
f
,
followFansRecordVo
);
EntityMapper
.
copyAttribute
(
f
,
followFansRecordVo
);
followFansRecordVo
.
setFansName
(
cacheUtil
.
getAppletUserNameById
(
f
.
getFansId
()));
followFansRecordVo
.
setFansName
(
cacheUtil
.
getAppletUserNameById
(
f
.
getFansId
()));
followFansRecordVo
.
setFansIcon
(
cacheUtil
.
getAppletUsers
(
f
.
getFansId
()).
getAvatar
());
followFansRecordVo
.
setFansIcon
(
cacheUtil
.
getAppletUsers
(
f
.
getFansId
()).
getAvatar
());
followFansRecordVo
.
setFansProfile
(
cacheUtil
.
getAppletUsers
(
f
.
getFansId
()).
getProfile
());
try
{
CloudServerResponse
<
CommunityUserAttributeDO
>
response
=
communityAttributeReadService
.
getCommunityUserAttributeByUserId
(
f
.
getFansId
());
if
(
response
.
isSuccess
())
{
followFansRecordVo
.
setFansProfile
(
response
.
getResult
().
getSignature
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}"
,
e
);
}
if
(
followerIdList
.
contains
(
f
.
getFansId
().
longValue
()))
{
if
(
followerIdList
.
contains
(
f
.
getFansId
().
longValue
()))
{
followFansRecordVo
.
setRelation
(
"互相关注"
);
followFansRecordVo
.
setRelation
(
"互相关注"
);
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BOTH_FOLLOWED
.
getCode
());
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BOTH_FOLLOWED
.
getCode
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
d7962f65
package
com.wwdz.ch.wx.impl
;
package
com.wwdz.ch.wx.impl
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.qiniu.storage.model.FileInfo
;
import
com.qiniu.storage.model.FileInfo
;
...
@@ -38,6 +39,9 @@ import com.wwdz.ch.wx.service.ItemService;
...
@@ -38,6 +39,9 @@ import com.wwdz.ch.wx.service.ItemService;
import
com.wwdz.ch.wx.service.MessageService
;
import
com.wwdz.ch.wx.service.MessageService
;
import
com.wwdz.ch.wx.util.RedisUtil
;
import
com.wwdz.ch.wx.util.RedisUtil
;
import
com.wwdz.ch.wx.util.StringUtil
;
import
com.wwdz.ch.wx.util.StringUtil
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.wwdz.mall.contentcenter.api.CommunityAttributeReadService
;
import
com.wwdz.mall.contentcenter.domain.result.attribute.CommunityUserAttributeDO
;
import
com.xxdxxs.utils.CommonUtils
;
import
com.xxdxxs.utils.CommonUtils
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.DateUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -144,6 +148,9 @@ public class ItemServiceImpl implements ItemService {
...
@@ -144,6 +148,9 @@ public class ItemServiceImpl implements ItemService {
@Autowired
@Autowired
ConsignSaleDao
consignSaleDao
;
ConsignSaleDao
consignSaleDao
;
@Reference
CommunityAttributeReadService
communityAttributeReadService
;
@Override
@Override
public
Result
nameList
(
ItemRequestDto
dto
)
{
public
Result
nameList
(
ItemRequestDto
dto
)
{
try
{
try
{
...
@@ -786,6 +793,15 @@ public class ItemServiceImpl implements ItemService {
...
@@ -786,6 +793,15 @@ public class ItemServiceImpl implements ItemService {
}
}
}
}
}
}
//获取用户签名
try
{
CloudServerResponse
<
CommunityUserAttributeDO
>
response
=
communityAttributeReadService
.
getCommunityUserAttributeByUserId
(
dto
.
getUserId
());
if
(
response
.
isSuccess
())
{
itemResponseVo
.
setProfile
(
response
.
getResult
().
getSignature
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}"
,
e
);
}
// 添加或更新用户足迹
// 添加或更新用户足迹
Footprint
footprint
=
footPrintDao
.
selectByUserIdItem
(
dto
.
getUserId
(),
item
.
getId
());
Footprint
footprint
=
footPrintDao
.
selectByUserIdItem
(
dto
.
getUserId
(),
item
.
getId
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
View file @
d7962f65
...
@@ -38,6 +38,8 @@ import com.wwdz.ch.wx.util.RedisUtil;
...
@@ -38,6 +38,8 @@ import com.wwdz.ch.wx.util.RedisUtil;
import
com.wwdz.ch.wx.util.StringUtil
;
import
com.wwdz.ch.wx.util.StringUtil
;
import
com.wwdz.ch.wx.util.WxResponseCode
;
import
com.wwdz.ch.wx.util.WxResponseCode
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.wwdz.mall.contentcenter.api.CommunityAttributeReadService
;
import
com.wwdz.mall.contentcenter.domain.result.attribute.CommunityUserAttributeDO
;
import
com.wwdz.user.api.service.user.UserReadService
;
import
com.wwdz.user.api.service.user.UserReadService
;
import
com.wwdz.user.api.service.user.UserWriteService
;
import
com.wwdz.user.api.service.user.UserWriteService
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.JsonUtils
;
...
@@ -124,6 +126,9 @@ public class UserServiceImpl implements UserService {
...
@@ -124,6 +126,9 @@ public class UserServiceImpl implements UserService {
@Reference
@Reference
UserWriteService
userWriteService
;
UserWriteService
userWriteService
;
@Reference
CommunityAttributeReadService
communityAttributeReadService
;
@Override
@Override
public
Result
finishLogin
(
UserRequestDto
dto
)
{
public
Result
finishLogin
(
UserRequestDto
dto
)
{
...
@@ -491,6 +496,15 @@ public class UserServiceImpl implements UserService {
...
@@ -491,6 +496,15 @@ public class UserServiceImpl implements UserService {
// 缓存用户信息
// 缓存用户信息
redisUtil
.
set
(
key
,
user
,
2
*
60
*
60
);
redisUtil
.
set
(
key
,
user
,
2
*
60
*
60
);
}
}
try
{
CloudServerResponse
<
CommunityUserAttributeDO
>
response
=
communityAttributeReadService
.
getCommunityUserAttributeByUserId
(
userId
);
if
(
response
.
isSuccess
())
{
user
.
setProfile
(
response
.
getResult
().
getSignature
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}"
,
e
);
}
logger
.
info
(
"【请求结束】查询用户信息成功"
);
logger
.
info
(
"【请求结束】查询用户信息成功"
);
return
Result
.
success
(
user
);
return
Result
.
success
(
user
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -504,6 +518,14 @@ public class UserServiceImpl implements UserService {
...
@@ -504,6 +518,14 @@ public class UserServiceImpl implements UserService {
public
Result
queryUserInfo
(
UserRequestDto
dto
)
{
public
Result
queryUserInfo
(
UserRequestDto
dto
)
{
try
{
try
{
User
user
=
userDao
.
queryById
(
dto
.
getUserId
());
User
user
=
userDao
.
queryById
(
dto
.
getUserId
());
try
{
CloudServerResponse
<
CommunityUserAttributeDO
>
response
=
communityAttributeReadService
.
getCommunityUserAttributeByUserId
(
dto
.
getUserId
());
if
(
response
.
isSuccess
())
{
user
.
setProfile
(
response
.
getResult
().
getSignature
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}"
,
e
);
}
return
Result
.
success
(
user
);
return
Result
.
success
(
user
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询用户信息失败"
,
e
);
logger
.
error
(
"查询用户信息失败"
,
e
);
...
...
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