-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from KTB16Team/feature/88-feat-implement-point
Feature:feat implement point(#88)
- Loading branch information
Showing
22 changed files
with
331 additions
and
26 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
backend/src/main/java/aimo/backend/common/scheduler/SchedulingConfig.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,9 @@ | ||
package aimo.backend.common.scheduler; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
|
||
@EnableScheduling | ||
@Configuration | ||
public class SchedulingConfig { | ||
} |
24 changes: 24 additions & 0 deletions
24
backend/src/main/java/aimo/backend/common/scheduler/SchedulingService.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,24 @@ | ||
package aimo.backend.common.scheduler; | ||
|
||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import aimo.backend.domains.member.repository.MemberAttemptCountRepository; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class SchedulingService { | ||
|
||
private final MemberAttemptCountRepository memberAttemptCountRepository; | ||
|
||
@Transactional | ||
@Async | ||
@Scheduled(cron = "0 0 0 * * ?") //매일 자정에 초기화 | ||
public void deleteAllMemberPointLimitCount() { | ||
memberAttemptCountRepository.deleteAll(); | ||
} | ||
} |
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
6 changes: 0 additions & 6 deletions
6
backend/src/main/java/aimo/backend/common/util/memberLoader/MemberLoader.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
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
backend/src/main/java/aimo/backend/domains/member/controller/MemberPointController.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 aimo.backend.domains.member.controller; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import aimo.backend.common.dto.DataResponse; | ||
import aimo.backend.common.util.memberLoader.MemberLoader; | ||
import aimo.backend.domains.member.dto.response.FindMemberPointResponse; | ||
import aimo.backend.domains.member.service.MemberPointService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequestMapping("/api/v1/members/points") | ||
@RequiredArgsConstructor | ||
public class MemberPointController { | ||
|
||
private final MemberPointService memberPointService; | ||
|
||
// 멤버 포인트 조회 | ||
@GetMapping | ||
public ResponseEntity<DataResponse<FindMemberPointResponse>> findMemberPoint() { | ||
Long memberId = MemberLoader.getMemberId(); | ||
|
||
FindMemberPointResponse response = memberPointService.findMemberPoint(memberId); | ||
|
||
return ResponseEntity.ok(DataResponse.from(response)); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
backend/src/main/java/aimo/backend/domains/member/dto/response/FindMemberPointResponse.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,6 @@ | ||
package aimo.backend.domains.member.dto.response; | ||
|
||
public record FindMemberPointResponse( | ||
Integer memberPoint | ||
) { | ||
} |
Oops, something went wrong.