Commit ecbd13ed authored by muhong's avatar muhong

新增 藏品详情增加用户昵称

parent ac2b1cf7
...@@ -8,4 +8,5 @@ public interface UserItemsRelationDao { ...@@ -8,4 +8,5 @@ public interface UserItemsRelationDao {
int insert(UserItemsRelation record); int insert(UserItemsRelation record);
List<UserItemsRelation> listByUserIds(Long userId, List<Long> userIds); List<UserItemsRelation> listByUserIds(Long userId, List<Long> userIds);
boolean isExisted(Long userId, Long itemId); boolean isExisted(Long userId, Long itemId);
UserItemsRelation find(Long itemId);
} }
...@@ -37,4 +37,12 @@ public class UserItemsRelationDaoImpl implements UserItemsRelationDao { ...@@ -37,4 +37,12 @@ public class UserItemsRelationDaoImpl implements UserItemsRelationDao {
criteria.andItemIdEqualTo(itemId); criteria.andItemIdEqualTo(itemId);
return usersItemsRelationMapper.countByExample(example) > 0; return usersItemsRelationMapper.countByExample(example) > 0;
} }
@Override
public UserItemsRelation find (Long itemId) {
UserItemsRelationExample example = new UserItemsRelationExample();
UserItemsRelationExample.Criteria criteria = example.createCriteria();
criteria.andItemIdEqualTo(itemId);
return usersItemsRelationMapper.selectOneByExample(example);
}
} }
...@@ -24,4 +24,5 @@ public class ItemResponseVo implements Entity { ...@@ -24,4 +24,5 @@ public class ItemResponseVo implements Entity {
private String videos; private String videos;
private Map<String, Object> homePageImage; private Map<String, Object> homePageImage;
private Integer isDeleted; private Integer isDeleted;
private String itemNickname;
} }
...@@ -59,6 +59,8 @@ public class ItemServiceImpl implements ItemService { ...@@ -59,6 +59,8 @@ public class ItemServiceImpl implements ItemService {
private WxLoginService wxLoginService; private WxLoginService wxLoginService;
@Autowired @Autowired
private QiniuStorage qiniuStorage; private QiniuStorage qiniuStorage;
@Autowired
private UserDao userDao;
@Override @Override
public Result nameList(ItemRequestDto dto) { public Result nameList(ItemRequestDto dto) {
...@@ -277,6 +279,16 @@ public class ItemServiceImpl implements ItemService { ...@@ -277,6 +279,16 @@ public class ItemServiceImpl implements ItemService {
footPrintDao.upateTime(footprint); footPrintDao.upateTime(footprint);
} }
} }
// 设置藏品的发布用户昵称
String itemNickname = "";
UserItemsRelation userItemsRelation = userItemsRelationDao.find(item.getId());
if (Objects.nonNull(userItemsRelation)) {
User user = userDao.queryById(userItemsRelation.getUserId());
if (Objects.nonNull(user)) {
itemNickname = user.getNickname();
}
}
itemResponseVo.setItemNickname(itemNickname);
logger.info("【请求结束】查看藏品详情成功"); logger.info("【请求结束】查看藏品详情成功");
return Result.success(itemResponseVo); return Result.success(itemResponseVo);
} catch (Exception e) { } catch (Exception 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