|
|
@@ -99,8 +99,10 @@ public class MetaUserFriendService {
|
|
|
return metaUserFriendApplyRecordService.apply(metaUserFriendApplyRecord);
|
|
|
}
|
|
|
|
|
|
- public MetaRestResult<Void> delApply(Long applyRecordId) {
|
|
|
- MetaUserFriendApplyRecord metaUserFriendApplyRecord = metaUserFriendApplyRecordRepo.findById(applyRecordId).orElse(null);
|
|
|
+ public MetaRestResult<Void> delApply(Long userId) {
|
|
|
+ Long friendId = SecurityUtils.getAuthenticatedUser().getId();
|
|
|
+ // 判断申请记录
|
|
|
+ MetaUserFriendApplyRecord metaUserFriendApplyRecord = metaUserFriendApplyRecordRepo.findByUserIdAndFriendIdAndDel(userId, friendId, false);
|
|
|
if (Objects.isNull(metaUserFriendApplyRecord)) {
|
|
|
return MetaRestResult.returnError("申请单不存在");
|
|
|
}
|
|
|
@@ -114,12 +116,13 @@ public class MetaUserFriendService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public MetaRestResult<Void> operatingApply(Long applyRecordId, MetaUserFriendOperateType operateType) {
|
|
|
- if (Objects.isNull(applyRecordId)) {
|
|
|
- return MetaRestResult.returnError("Illegal parameter : applyRecordId can not be null");
|
|
|
+ public MetaRestResult<Void> operatingApply(Long userId, MetaUserFriendOperateType operateType) {
|
|
|
+ if (Objects.isNull(userId)) {
|
|
|
+ return MetaRestResult.returnError("Illegal parameter : userId can not be null");
|
|
|
}
|
|
|
+ Long friendId = SecurityUtils.getAuthenticatedUser().getId();
|
|
|
// 判断申请记录
|
|
|
- MetaUserFriendApplyRecord metaUserFriendApplyRecord = metaUserFriendApplyRecordRepo.findById(applyRecordId).orElse(null);
|
|
|
+ MetaUserFriendApplyRecord metaUserFriendApplyRecord = metaUserFriendApplyRecordRepo.findByUserIdAndFriendIdAndDel(userId, friendId, false);
|
|
|
if (Objects.isNull(metaUserFriendApplyRecord)) {
|
|
|
return MetaRestResult.returnError("暂无申请信息");
|
|
|
}
|