diff --git a/interface/share.json b/interface/share.json index 6329f33b..938b3bca 100644 --- a/interface/share.json +++ b/interface/share.json @@ -1,6 +1,6 @@ [ { - "url": "http://81.69.8.95:8080/share/usershare/create", + "url": "http://43.135.22.107:8080/share/usershare/create", "method": "POST", "body": { "theme": "主题", @@ -11,7 +11,8 @@ "org": "所属组织", "twitter": "分享人推特", "sharingDoc": "分享链接", - "label": "标签类别" + "label": "标签类别", + "memberId": "分享人id" }, "response": { @@ -43,7 +44,7 @@ } }, { - "url": "http://81.69.8.95:8080/share/usershare/delete?shareId=111", + "url": "http://43.135.22.107:8080/share/usershare/delete?shareId=111", "method": "POST", "response": { @@ -53,7 +54,7 @@ } }, { - "url": "http://81.69.8.95:8080/share/usershare/all?pageNo=1&pageSize=10", + "url": "http://43.135.22.107:8080/share/usershare/all?pageNo=1&pageSize=10", "method": "GET", "response": { @@ -89,7 +90,7 @@ } }, { - "url": "http://81.69.8.95:8080/share/usershare/byUser?memberId=1?pageNo=1&pageSize=10", + "url": "http://43.135.22.107:8080/share/usershare/byUser?memberId=1?pageNo=1&pageSize=10", "method": "GET", "response": { @@ -125,7 +126,7 @@ } }, { - "url": "http://81.69.8.95:8080/share/usershare/queryByShareId?shareId=111", + "url": "http://43.135.22.107:8080/share/usershare/queryByShareId?shareId=111", "method": "GET", "response": { diff --git a/src/main/java/com/dl/officialsite/sharing/controller/UserSharingController.java b/src/main/java/com/dl/officialsite/sharing/controller/UserSharingController.java index d4dc2d57..75bf6c89 100644 --- a/src/main/java/com/dl/officialsite/sharing/controller/UserSharingController.java +++ b/src/main/java/com/dl/officialsite/sharing/controller/UserSharingController.java @@ -30,7 +30,7 @@ public class UserSharingController { * @return */ @PostMapping("create") - public BaseResponse createSharing(CreateSharingReq req){ + public BaseResponse createSharing(@RequestBody CreateSharingReq req){ return BaseResponse.successWithData(this.userSharingService.createSharing(req)); } @@ -38,7 +38,7 @@ public BaseResponse createSharing(CreateSharingReq req){ * 修改分享 */ @PostMapping("update") - public BaseResponse updateSharing(UpdateSharingReq req){ + public BaseResponse updateSharing(@RequestBody UpdateSharingReq req){ this.userSharingService.updateSharing(req); return BaseResponse.success(); } @@ -47,8 +47,8 @@ public BaseResponse updateSharing(UpdateSharingReq req){ * 删除分享 */ @PostMapping("delete") - public BaseResponse deleteSharing(@RequestParam("shareId") long shareId, @RequestParam("memberId") long memberId){ - this.userSharingService.deleteSharing(shareId, memberId); + public BaseResponse deleteSharing(@RequestParam("shareId") long shareId){ + this.userSharingService.deleteSharing(shareId); return BaseResponse.success(); } diff --git a/src/main/java/com/dl/officialsite/sharing/model/req/UpdateSharingReq.java b/src/main/java/com/dl/officialsite/sharing/model/req/UpdateSharingReq.java index a191adc7..0f6a96a3 100644 --- a/src/main/java/com/dl/officialsite/sharing/model/req/UpdateSharingReq.java +++ b/src/main/java/com/dl/officialsite/sharing/model/req/UpdateSharingReq.java @@ -65,9 +65,4 @@ public class UpdateSharingReq { */ @ApiModelProperty("分享标签") private String label; - - /** - * 修改人id - */ - private String memberId; } diff --git a/src/main/java/com/dl/officialsite/sharing/service/IUserSharingService.java b/src/main/java/com/dl/officialsite/sharing/service/IUserSharingService.java index 26e5beea..de38d9ca 100644 --- a/src/main/java/com/dl/officialsite/sharing/service/IUserSharingService.java +++ b/src/main/java/com/dl/officialsite/sharing/service/IUserSharingService.java @@ -26,7 +26,7 @@ public interface IUserSharingService { /** * 删除分享 */ - void deleteSharing(long shareId, long memberId); + void deleteSharing(long shareId); /** diff --git a/src/main/java/com/dl/officialsite/sharing/service/impl/DefaultSharingServiceImpl.java b/src/main/java/com/dl/officialsite/sharing/service/impl/DefaultSharingServiceImpl.java index af43f383..eee1258a 100644 --- a/src/main/java/com/dl/officialsite/sharing/service/impl/DefaultSharingServiceImpl.java +++ b/src/main/java/com/dl/officialsite/sharing/service/impl/DefaultSharingServiceImpl.java @@ -85,9 +85,9 @@ public void updateSharing(UpdateSharingReq req) { // throw new BizException(CodeEnums.SHARING_NOT_FOUND); // } - if(!Objects.equals(sharing.getMemberId(), req.getMemberId())){ - throw new BizException(CodeEnums.SHARING_NOT_OWNER); - } +// if(!Objects.equals(sharing.getMemberId(), req.getMemberId())){ +// throw new BizException(CodeEnums.SHARING_NOT_OWNER); +// } if(sharing.getLockStatus() == SharingLockStatus.LOCKED.getCode()){ throw new BizException(CodeEnums.SHARING_LOCKED); } @@ -105,7 +105,7 @@ public void updateSharing(UpdateSharingReq req) { } @Override - public void deleteSharing(long shareId, long memberId) { + public void deleteSharing(long shareId) { //Verify Optional existed = this.sharingRepository.findById(shareId); if(!existed.isPresent()){ @@ -114,9 +114,9 @@ public void deleteSharing(long shareId, long memberId) { TbShare sharing = existed.get(); // SessionUserInfo userInfo = HttpSessionUtils.getMember(request.getSession()); // Member member = this.memberRepository.findByAddress(userInfo.getAddress()).get(); - if(!Objects.equals(sharing.getMemberId(), memberId)){ - throw new BizException(CodeEnums.SHARING_NOT_OWNER); - } +// if(!Objects.equals(sharing.getMemberId(), memberId)){ +// throw new BizException(CodeEnums.SHARING_NOT_OWNER); +// } //Delete this.sharingRepository.deleteById(shareId); }