-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature: 뱃지 보상 받기 구현 * refactor: 게시물 등록 시 퀘스트 링크를 검증
- Loading branch information
Showing
10 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package daybyquest.badge.domain; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class Ownings { | ||
|
||
private final OwningRepository owningRepository; | ||
|
||
private final Badges badges; | ||
|
||
Ownings(final OwningRepository owningRepository, final Badges badges) { | ||
this.owningRepository = owningRepository; | ||
this.badges = badges; | ||
} | ||
|
||
public void save(final Owning owning) { | ||
owningRepository.save(owning); | ||
} | ||
|
||
public void saveByUserIdAndBadgeId(final Long userId, final Long badgeId) { | ||
save(new Owning(userId, badges.getById(badgeId))); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/daybyquest/global/error/exception/NotExistBadgeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package daybyquest.global.error.exception; | ||
|
||
import daybyquest.global.error.ExceptionCode; | ||
|
||
public class NotExistBadgeException extends CustomException { | ||
|
||
public NotExistBadgeException() { | ||
super(ExceptionCode.NOT_EXIST_BADGE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters