-
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.
Browse files
Browse the repository at this point in the history
feat - 챌린지 관련 컨트롤러들 swagger 연결
- Loading branch information
Showing
12 changed files
with
272 additions
and
86 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
src/main/java/sopt/org/HMH/domain/app/controller/AppApi.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,57 @@ | ||
package sopt.org.HMH.domain.app.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import sopt.org.HMH.domain.app.dto.request.AppArrayGoalTimeRequest; | ||
import sopt.org.HMH.domain.app.dto.request.AppDeleteRequest; | ||
import sopt.org.HMH.global.auth.UserId; | ||
import sopt.org.HMH.global.common.response.BaseResponse; | ||
|
||
@Tag(name = "스크린타임 앱 관련 API") | ||
@SecurityRequirement(name = "Authorization") | ||
public interface AppApi { | ||
@Operation( | ||
summary = "스크린타임 제한 앱 추가 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "앱이 성공적으로 추가되었습니다."), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청입니다.", | ||
content = @Content), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류입니다.", | ||
content = @Content)}) | ||
ResponseEntity<BaseResponse<?>> orderAddApp( | ||
@UserId @Parameter(hidden = true) final Long userId, | ||
@RequestHeader("OS") final String os, | ||
@RequestBody final AppArrayGoalTimeRequest request); | ||
|
||
@Operation( | ||
summary = "스크린타임 제한 앱 삭제 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "앱이 성공적으로 삭제되었습니다."), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청입니다.", | ||
content = @Content), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류입니다.", | ||
content = @Content)}) | ||
ResponseEntity<BaseResponse<?>> orderRemoveApp( | ||
@UserId @Parameter(hidden = true) final Long userId, | ||
@RequestHeader("OS") final String os, | ||
@RequestBody final AppDeleteRequest request); | ||
} |
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
57 changes: 57 additions & 0 deletions
57
src/main/java/sopt/org/HMH/domain/challenge/controller/ChallengeApi.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,57 @@ | ||
package sopt.org.HMH.domain.challenge.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import sopt.org.HMH.domain.challenge.dto.request.ChallengeRequest; | ||
import sopt.org.HMH.domain.challenge.dto.response.ChallengeResponse; | ||
import sopt.org.HMH.global.auth.UserId; | ||
import sopt.org.HMH.global.common.response.BaseResponse; | ||
|
||
@Tag(name = "챌린지 관련 API") | ||
@SecurityRequirement(name = "Authorization") | ||
public interface ChallengeApi { | ||
@Operation( | ||
summary = "챌린지가 끝난 후 새 챌린지 생성하는 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "챌린지가 성공적으로 추가되었습니다."), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청입니다.", | ||
content = @Content), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류입니다.", | ||
content = @Content)}) | ||
ResponseEntity<BaseResponse<?>> orderAddChallenge( | ||
@UserId @Parameter(hidden = true) final Long userId, | ||
@RequestHeader("OS") final String os, | ||
@RequestBody final ChallengeRequest request); | ||
|
||
@Operation( | ||
summary = "달성현황뷰 챌린지 정보를 불러오는 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "챌린지 정보 조회에 성공했습니다."), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청입니다.", | ||
content = @Content), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류입니다.", | ||
content = @Content)}) | ||
ResponseEntity<BaseResponse<ChallengeResponse>> orderGetChallenge( | ||
@UserId @Parameter(hidden = true) final Long userId, | ||
@RequestHeader("OS") final String os); | ||
} | ||
|
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
74 changes: 74 additions & 0 deletions
74
src/main/java/sopt/org/HMH/domain/dailychallenge/controller/DailyChallengeApi.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,74 @@ | ||
package sopt.org.HMH.domain.dailychallenge.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import sopt.org.HMH.domain.app.dto.request.AppArrayUsageTimeRequest; | ||
import sopt.org.HMH.domain.dailychallenge.dto.response.DailyChallengeResponse; | ||
import sopt.org.HMH.global.auth.UserId; | ||
import sopt.org.HMH.global.common.response.BaseResponse; | ||
|
||
@Tag(name = "일별챌린지 관련 API") | ||
@SecurityRequirement(name = "Authorization") | ||
public interface DailyChallengeApi { | ||
@Operation( | ||
summary = "홈뷰 일별 챌린지 정보 조회하는 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "일별 챌린지 정보 조회에 성공했습니다."), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청입니다.", | ||
content = @Content), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류입니다.", | ||
content = @Content)}) | ||
ResponseEntity<BaseResponse<DailyChallengeResponse>> orderDetailDailyChallenge( | ||
@UserId @Parameter(hidden = true) final Long userId, | ||
@RequestHeader("OS") final String os); | ||
|
||
@Operation( | ||
summary = "사용시간과 함께 일별챌린지 정보 업데이트 요청하는 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "일별 챌린지 정보 업데이트에 성공했습니다."), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청입니다.", | ||
content = @Content), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류입니다.", | ||
content = @Content)}) | ||
ResponseEntity<BaseResponse<?>> orderModifyDailyChallenge( | ||
@UserId @Parameter(hidden = true) final Long userId, | ||
@RequestHeader("OS") final String os, | ||
@RequestBody final AppArrayUsageTimeRequest request); | ||
|
||
@Operation( | ||
summary = "스크린타임 연장 시 챌린지 실패 처리하는 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "챌린지 실패 요청 성공했습니다."), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청입니다.", | ||
content = @Content), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류입니다.", | ||
content = @Content)}) | ||
ResponseEntity<BaseResponse<?>> orderModifyDailyChallengeStatusFailure( | ||
@UserId @Parameter(hidden = true) final Long userId); | ||
} | ||
|
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
Oops, something went wrong.