| | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateCollect(UserCollect userCollect) { |
| | | public String updateCollect(UserCollect userCollect) { |
| | | if (ObjectUtil.isEmpty(userCollect.getUserId())){ |
| | | userCollect.setUserId(AuthUtil.getUserId().toString()); |
| | | } |
| | |
| | | UserCollect detail = baseMapper.selectOne(Condition.getQueryWrapper(params)); |
| | | if (ObjectUtil.isEmpty(detail)){ |
| | | //库里不存在该数据就新增 |
| | | return save(userCollect); |
| | | save(userCollect); |
| | | }else { |
| | | //更新收藏状态 |
| | | detail.setStatus(userCollect.getStatus()); |
| | | return updateById(detail); |
| | | updateById(detail); |
| | | } |
| | | |
| | | return baseMapper.getMyCollect(userCollect.getUserId()); |
| | | } |
| | | |
| | | |