-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 회원의 랭킹 redis에 추가 및 삭제, 업데이트 기능 추가 * test: 회원 정보 변경 및 삭제 추가에 따른 랭킹 참여, 제외 테스트 코드 추가 * feat: 랭킹시스템 API 추가 및 랭킹 조회 기능 추가 * feat: 랭킹 조회 테스트 코드 추가 및 랭킹 업데이트 로직 각 업데이트 -> 스케쥴러 * style: checkstyle 에러 fix * refactor: 응답 객체명 변경 TopRankingInfoResponse -> TopRankingInfo * fix: 랭킹 업데이트 시간 15분 매초마다 동작하는 방식 -> 15분에 한 번만 실행되도록 변경 * refactor: 랭킹 응답 반환 객체 변수면 s 제거 Co-authored-by: Kim Heebin <blowhuiee@gmail.com> * refactor: ToprankingResponses 응답 객체 반환명 TopRankingResponse로 변경 * fix: ObjectMapper에러 수정 * fix: objectMapper 삭제 추가 * feat: 어드민 서비스 로그인 기능 추가 * refactor: 어드민 config 업데이트 * fix: test application.yml 수정 * test: stub에서의 타입 오류 해결 * style: 변수면 변경 * feat: 어드민과 일반 유저간 토큰 생성, 검증 분리 및 로그인 분리 * feat: 회원 인증시 뱃지 생성기능 추가 * refactor: config 수정 * refactor: 코딩 스타일 재적용 --------- Co-authored-by: Kim Heebin <blowhuiee@gmail.com>
- Loading branch information
Showing
42 changed files
with
416 additions
and
185 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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/moabam/api/application/member/BadgeService.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,32 @@ | ||
package com.moabam.api.application.member; | ||
|
||
import java.util.Optional; | ||
|
||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.moabam.api.domain.member.Badge; | ||
import com.moabam.api.domain.member.BadgeType; | ||
import com.moabam.api.domain.member.repository.BadgeRepository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class BadgeService { | ||
|
||
private final BadgeRepository badgeRepository; | ||
|
||
public void createBadge(Long memberId, long certifyCount) { | ||
Optional<BadgeType> badgeType = BadgeType.getBadgeFrom(certifyCount); | ||
|
||
if (badgeType.isEmpty() | ||
|| badgeRepository.existsByMemberIdAndType(memberId, badgeType.get())) { | ||
return; | ||
} | ||
|
||
Badge badge = MemberMapper.toBadge(memberId, badgeType.get()); | ||
badgeRepository.save(badge); | ||
} | ||
} |
Oops, something went wrong.