Commit d7962f65 authored by shiyu's avatar shiyu

抵用玩物得志社区接口获取用户签名

parent 168e0ed8
......@@ -209,6 +209,7 @@ dubbo:
timeout: 3000
retries: -1
server:
servlet:
session:
......
......@@ -12,6 +12,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<user-api.version>1.9.33</user-api.version>
<content-center-api.version>3.0.41</content-center-api.version>
</properties>
<dependencies>
......@@ -222,6 +223,13 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.wwdz.mall</groupId>
<artifactId>content-center-api</artifactId>
<version>${content-center-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
......
package com.wwdz.ch.wx.impl;
import com.alibaba.dubbo.config.annotation.Reference;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.consts.FollowFansEnum;
import com.wwdz.ch.core.consts.MessageEnum;
......@@ -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.MessageService;
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.EntityMapper;
import com.xxdxxs.utils.JsonUtils;
......@@ -49,6 +53,9 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
@Autowired
RedisUtils redisUtils;
@Reference
CommunityAttributeReadService communityAttributeReadService;
@Override
@Transactional(rollbackFor = Exception.class)
public Result follow(FollowFansRecordRequestDto dto) {
......@@ -173,7 +180,15 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
EntityMapper.copyAttribute(f, followFansRecordVo);
followFansRecordVo.setFollowerName(cacheUtil.getAppletUserNameById(f.getFollowerId()));
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())) {
followFansRecordVo.setRelation("互相关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.BOTH_FOLLOWED.getCode());
......@@ -213,7 +228,14 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
EntityMapper.copyAttribute(f, followFansRecordVo);
followFansRecordVo.setFansName(cacheUtil.getAppletUserNameById(f.getFansId()));
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())) {
followFansRecordVo.setRelation("互相关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.BOTH_FOLLOWED.getCode());
......
package com.wwdz.ch.wx.impl;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.qiniu.storage.model.FileInfo;
......@@ -38,6 +39,9 @@ import com.wwdz.ch.wx.service.ItemService;
import com.wwdz.ch.wx.service.MessageService;
import com.wwdz.ch.wx.util.RedisUtil;
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.DateUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -144,6 +148,9 @@ public class ItemServiceImpl implements ItemService {
@Autowired
ConsignSaleDao consignSaleDao;
@Reference
CommunityAttributeReadService communityAttributeReadService;
@Override
public Result nameList(ItemRequestDto dto) {
try {
......@@ -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());
......
......@@ -38,6 +38,8 @@ import com.wwdz.ch.wx.util.RedisUtil;
import com.wwdz.ch.wx.util.StringUtil;
import com.wwdz.ch.wx.util.WxResponseCode;
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.UserWriteService;
import com.xxdxxs.utils.JsonUtils;
......@@ -124,6 +126,9 @@ public class UserServiceImpl implements UserService {
@Reference
UserWriteService userWriteService;
@Reference
CommunityAttributeReadService communityAttributeReadService;
@Override
public Result finishLogin(UserRequestDto dto) {
......@@ -491,6 +496,15 @@ public class UserServiceImpl implements UserService {
// 缓存用户信息
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("【请求结束】查询用户信息成功");
return Result.success(user);
} catch (Exception e) {
......@@ -504,6 +518,14 @@ public class UserServiceImpl implements UserService {
public Result queryUserInfo(UserRequestDto dto) {
try {
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);
} catch (Exception e) {
logger.error("查询用户信息失败", e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment