-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEAT] 데모데이 시연을 위한 테스트용 API
- Loading branch information
Showing
8 changed files
with
136 additions
and
9 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
47 changes: 47 additions & 0 deletions
47
src/main/java/sopt/org/umbbaServer/global/common/DemoController.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,47 @@ | ||
package sopt.org.umbbaServer.global.common; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.*; | ||
import sopt.org.umbbaServer.domain.qna.service.QnAService; | ||
import sopt.org.umbbaServer.global.common.dto.ApiResponse; | ||
import sopt.org.umbbaServer.global.exception.SuccessType; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
public class DemoController { | ||
|
||
private final QnAService qnAService; | ||
|
||
/** | ||
* 데모데이 테스트용 QnA리스트 세팅 API | ||
* - API 호출 시 4일차까지 일일문답을 완료했고, 5일차 답변을 할 차례로 만들기 | ||
* - 5일차로 변경되는 시점에서 푸시메시지 전송 | ||
* - 4일차까지의 is**Answer, **Answer 필드가 채워진 상태 | ||
* | ||
* - 최대한 User 테이블만 보고 테스트할 수 있도록 설계 | ||
*/ | ||
@PatchMapping("/demo/list/{userId}") | ||
@ResponseStatus(HttpStatus.OK) | ||
public ApiResponse demoList(@PathVariable final Long userId) { | ||
|
||
qnAService.updateDemoList(userId); | ||
return ApiResponse.success(SuccessType.TEST_SUCCESS); | ||
} | ||
|
||
|
||
/** | ||
* 데모데이 테스트용 QnA 세팅 API | ||
* - API 호출할 때마다 일수가 증가하며 새로운 질문으로 업데이트 | ||
* - 오늘의 질문 알림 푸시 함께 전송 | ||
* | ||
*/ | ||
@PatchMapping("/demo/qna/{userId}") | ||
@ResponseStatus(HttpStatus.OK) | ||
public ApiResponse demoQnA(@PathVariable final Long userId) { | ||
|
||
qnAService.todayUpdate(userId); | ||
return ApiResponse.success(SuccessType.TEST_SUCCESS); | ||
} | ||
|
||
} |
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