Skip to content

Commit

Permalink
Merge pull request #214 from Gamegoo-repo/feat/213
Browse files Browse the repository at this point in the history
[Feat/213] ์ฆ๊ฒจ์ฐพ๊ธฐ ์„ค์ •/ํ•ด์ œ API ํƒˆํ‡ด์—ฌ๋ถ€ ๊ฒ€์ฆ ์ถ”๊ฐ€
  • Loading branch information
Eunjin3395 authored Sep 8, 2024
2 parents 8b819c1 + ae86894 commit 3ffda33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public enum ErrorStatus implements BaseErrorCode {
NOT_STAR_FRIEND(HttpStatus.BAD_REQUEST, "FRIEND410", "์ฆ๊ฒจ์ฐพ๊ธฐ ๋˜์–ด ์žˆ๋Š” ์นœ๊ตฌ๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค."),
FRIEND_SEARCH_QUERY_BAD_REQUEST(HttpStatus.BAD_REQUEST, "FRIEND411",
"์นœ๊ตฌ ๊ฒ€์ƒ‰ ์ฟผ๋ฆฌ๋Š” 100์ž ์ดํ•˜์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค."),
FRIEND_USER_DEACTIVATED(HttpStatus.NOT_FOUND, "FRIEND412", "์นœ๊ตฌ ํšŒ์›์ด ํƒˆํ‡ดํ–ˆ์Šต๋‹ˆ๋‹ค."),

// ์•Œ๋ฆผ ๊ด€๋ จ ์—๋Ÿฌ
NOTIFICATION_TYPE_NOT_FOUND(HttpStatus.NOT_FOUND, "NOTI401", "ํ•ด๋‹น ์•Œ๋ฆผ ํƒ€์ž… ๋ฐ์ดํ„ฐ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."),
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/gamegoo/service/member/FriendService.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ public Friend starFriend(Long memberId, Long friendMemberId) {
Optional<Friend> friend = friendRepository.findByFromMemberAndToMember(member,
friendMember);

// ์นœ๊ตฌ ํšŒ์›์˜ ํƒˆํ‡ด ์—ฌ๋ถ€ ๊ฒ€์ฆ
if (friendMember.getBlind()) {
throw new FriendHandler(ErrorStatus.FRIEND_USER_DEACTIVATED);
}

// ๋‘ ํšŒ์›์ด ์นœ๊ตฌ ๊ด€๊ณ„๊ฐ€ ๋งž๋Š”์ง€ ๊ฒ€์ฆ
if (friend.isEmpty()) {
throw new FriendHandler(ErrorStatus.MEMBERS_NOT_FRIEND);
Expand Down Expand Up @@ -316,6 +321,11 @@ public Friend unstarFriend(Long memberId, Long friendMemberId) {
Optional<Friend> friend = friendRepository.findByFromMemberAndToMember(member,
friendMember);

// ์นœ๊ตฌ ํšŒ์›์˜ ํƒˆํ‡ด ์—ฌ๋ถ€ ๊ฒ€์ฆ
if (friendMember.getBlind()) {
throw new FriendHandler(ErrorStatus.FRIEND_USER_DEACTIVATED);
}

// ๋‘ ํšŒ์›์ด ์นœ๊ตฌ ๊ด€๊ณ„๊ฐ€ ๋งž๋Š”์ง€ ๊ฒ€์ฆ
if (friend.isEmpty()) {
throw new FriendHandler(ErrorStatus.MEMBERS_NOT_FRIEND);
Expand Down

0 comments on commit 3ffda33

Please sign in to comment.