diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/admin/presentation/AdminController.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/admin/presentation/AdminController.kt index 0089ded6..c060b19f 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/admin/presentation/AdminController.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/admin/presentation/AdminController.kt @@ -7,6 +7,7 @@ import hs.kr.entrydsm.application.domain.admin.presentation.dto.response.CreateA import hs.kr.entrydsm.application.domain.admin.presentation.dto.response.CreateEducationalStatusResponse import hs.kr.entrydsm.application.domain.admin.presentation.dto.response.CreatePrototypeResponse import hs.kr.entrydsm.application.domain.admin.usecase.AdminUseCase +import hs.kr.entrydsm.application.global.document.admin.AdminApiDocument import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody @@ -17,9 +18,9 @@ import org.springframework.web.bind.annotation.RestController @RequestMapping("/api/v1/admin") class AdminController( private val adminUseCase: AdminUseCase, -) { +) : AdminApiDocument { @PostMapping("/application-types") - fun createApplicationType( + override fun createApplicationType( @RequestBody request: CreateApplicationTypeRequest, ): ResponseEntity { val result = adminUseCase.createApplicationType(request.code, request.name) @@ -37,7 +38,7 @@ class AdminController( } @PostMapping("/educational-statuses") - fun createEducationalStatus( + override fun createEducationalStatus( @RequestBody request: CreateEducationalStatusRequest, ): ResponseEntity { val result = adminUseCase.createEducationalStatus(request.code, request.name) @@ -55,7 +56,7 @@ class AdminController( } @PostMapping("/prototypes") - fun createPrototype( + override fun createPrototype( @RequestBody request: CreatePrototypeRequest, ): ResponseEntity { val result = diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationQueryController.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationQueryController.kt index 15a6a968..013feafd 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationQueryController.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationQueryController.kt @@ -6,6 +6,7 @@ import hs.kr.entrydsm.application.domain.application.presentation.dto.response.A import hs.kr.entrydsm.application.domain.application.presentation.dto.response.CalculationHistoryResponse import hs.kr.entrydsm.application.domain.application.presentation.dto.response.CalculationResponse import hs.kr.entrydsm.application.domain.application.usecase.ApplicationQueryUseCase +import hs.kr.entrydsm.application.global.document.application.ApplicationQueryApiDocument import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.GetMapping @@ -18,9 +19,9 @@ import org.springframework.web.bind.annotation.RestController @RequestMapping("/api/v1") class ApplicationQueryController( private val applicationQueryUseCase: ApplicationQueryUseCase, -) { +) : ApplicationQueryApiDocument { @GetMapping("/applications/{applicationId}") - fun getApplication( + override fun getApplication( @PathVariable applicationId: String?, ): ResponseEntity { return try { @@ -46,7 +47,7 @@ class ApplicationQueryController( } @GetMapping("/applications") - fun getApplications( + override fun getApplications( @RequestParam(required = false) applicationType: String?, @RequestParam(required = false) educationalStatus: String?, @RequestParam(defaultValue = "0") page: Int, @@ -70,7 +71,7 @@ class ApplicationQueryController( } @GetMapping("/users/{userId}/applications") - fun getUserApplications( + override fun getUserApplications( @PathVariable userId: String?, ): ResponseEntity { return try { @@ -96,7 +97,7 @@ class ApplicationQueryController( } @GetMapping("/applications/{applicationId}/scores") - fun getApplicationScores( + override fun getApplicationScores( @PathVariable applicationId: String?, ): ResponseEntity { return try { @@ -122,7 +123,7 @@ class ApplicationQueryController( } @GetMapping("/applications/{applicationId}/calculations") - fun getCalculationResult( + override fun getCalculationResult( @PathVariable applicationId: String?, ): ResponseEntity { return try { @@ -148,7 +149,7 @@ class ApplicationQueryController( } @GetMapping("/applications/{applicationId}/calculations/history") - fun getCalculationHistory( + override fun getCalculationHistory( @PathVariable applicationId: String?, ): ResponseEntity { return try { diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationSubmissionController.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationSubmissionController.kt index b5abaca1..be0eef0e 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationSubmissionController.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/ApplicationSubmissionController.kt @@ -3,6 +3,7 @@ package hs.kr.entrydsm.application.domain.application.presentation import hs.kr.entrydsm.application.domain.application.presentation.dto.request.ApplicationSubmissionRequest import hs.kr.entrydsm.application.domain.application.presentation.dto.response.ApplicationSubmissionResponse import hs.kr.entrydsm.application.domain.application.usecase.CompleteApplicationUseCase +import hs.kr.entrydsm.application.global.document.application.ApplicationSubmissionApiDocument import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.PostMapping @@ -15,9 +16,9 @@ import java.time.LocalDateTime @RequestMapping("/api/v1") class ApplicationSubmissionController( private val completeApplicationUseCase: CompleteApplicationUseCase, -) { +) : ApplicationSubmissionApiDocument { @PostMapping("/applications") - fun submitApplication( + override fun submitApplication( @RequestBody request: ApplicationSubmissionRequest?, ): ResponseEntity { return try { diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt index 69bcf524..f7b00fc7 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt @@ -5,6 +5,7 @@ import hs.kr.entrydsm.application.domain.application.presentation.dto.response.P import hs.kr.entrydsm.application.domain.application.presentation.dto.response.SupportedTypesResponse import hs.kr.entrydsm.application.domain.application.presentation.dto.response.ValidationResponse import hs.kr.entrydsm.application.domain.application.usecase.ApplicationUseCase +import hs.kr.entrydsm.application.global.document.application.WebApplicationApiDocument import hs.kr.entrydsm.domain.application.values.ApplicationTypeFilter import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.GetMapping @@ -18,9 +19,9 @@ import org.springframework.web.bind.annotation.RestController @RequestMapping("/api/v1") class WebApplicationAdapter( private val applicationUseCase: ApplicationUseCase, -) { +) : WebApplicationApiDocument { @GetMapping("/prototypes") - fun getPrototype( + override fun getPrototype( @RequestParam applicationType: String, @RequestParam educationalStatus: String, @RequestParam(required = false) region: String?, @@ -73,7 +74,7 @@ class WebApplicationAdapter( } @GetMapping("/types") - fun getSupportedTypes(): ResponseEntity { + override fun getSupportedTypes(): ResponseEntity { val supportedTypes = applicationUseCase.getSupportedTypes() val response = @@ -102,7 +103,7 @@ class WebApplicationAdapter( } @PostMapping("/validate") - fun validateScoreData( + override fun validateScoreData( @RequestBody request: ValidateScoreDataRequest, ): ResponseEntity { val filter = diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/formula/presentation/FormulaSetController.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/formula/presentation/FormulaSetController.kt index 51d2e464..ab1764eb 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/formula/presentation/FormulaSetController.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/formula/presentation/FormulaSetController.kt @@ -8,6 +8,7 @@ import hs.kr.entrydsm.application.domain.formula.presentation.dto.response.Formu import hs.kr.entrydsm.application.domain.formula.presentation.dto.response.FormulaSetListResponse import hs.kr.entrydsm.application.domain.formula.presentation.dto.response.FormulaSetResponse import hs.kr.entrydsm.application.domain.formula.usecase.FormulaSetUseCase +import hs.kr.entrydsm.application.global.document.formula.FormulaSetApiDocument import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.DeleteMapping @@ -24,9 +25,9 @@ import java.util.UUID @RequestMapping("/api/v1") class FormulaSetController( private val formulaSetUseCase: FormulaSetUseCase, -) { +) : FormulaSetApiDocument { @PostMapping("/formulas") - fun createFormulaSet( + override fun createFormulaSet( @RequestBody request: CreateFormulaSetRequest?, ): ResponseEntity { return try { @@ -60,7 +61,7 @@ class FormulaSetController( } @PutMapping("/formulas/{formulaSetId}") - fun updateFormulaSet( + override fun updateFormulaSet( @PathVariable formulaSetId: String?, @RequestBody request: UpdateFormulaSetRequest?, ): ResponseEntity { @@ -99,7 +100,7 @@ class FormulaSetController( } @GetMapping("/formulas") - fun getFormulaSetList(): ResponseEntity { + override fun getFormulaSetList(): ResponseEntity { return try { val response = formulaSetUseCase.getFormulaSetList() ResponseEntity.ok(response) @@ -109,7 +110,7 @@ class FormulaSetController( } @GetMapping("/formulas/{formulaSetId}") - fun getFormulaSetDetail( + override fun getFormulaSetDetail( @PathVariable formulaSetId: String?, ): ResponseEntity { return try { @@ -135,7 +136,7 @@ class FormulaSetController( } @DeleteMapping("/formulas/{formulaSetId}") - fun deleteFormulaSet( + override fun deleteFormulaSet( @PathVariable formulaSetId: String?, ): ResponseEntity { return try { @@ -161,7 +162,7 @@ class FormulaSetController( } @PostMapping("/formulas/{formulaSetId}/execute") - fun executeFormulas( + override fun executeFormulas( @PathVariable formulaSetId: String?, @RequestBody request: FormulaExecutionRequest?, ): ResponseEntity { diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/user/presentation/UserController.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/user/presentation/UserController.kt index d5835490..35f0b0bb 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/user/presentation/UserController.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/user/presentation/UserController.kt @@ -5,6 +5,7 @@ import hs.kr.entrydsm.application.domain.user.presentation.dto.response.CreateUs import hs.kr.entrydsm.application.domain.user.presentation.dto.response.UserDetailResponse import hs.kr.entrydsm.application.domain.user.presentation.dto.response.UsersListResponse import hs.kr.entrydsm.application.domain.user.usecase.UserUseCase +import hs.kr.entrydsm.application.global.document.user.UserApiDocument import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.GetMapping @@ -18,9 +19,9 @@ import org.springframework.web.bind.annotation.RestController @RequestMapping("/api/v1/users") class UserController( private val userUseCase: UserUseCase, -) { +) : UserApiDocument { @PostMapping - fun createUser( + override fun createUser( @RequestBody request: CreateUserRequest?, ): ResponseEntity { return try { @@ -71,7 +72,7 @@ class UserController( } @GetMapping("/{userId}") - fun getUserById( + override fun getUserById( @PathVariable userId: String?, ): ResponseEntity { return try { @@ -115,7 +116,7 @@ class UserController( } @GetMapping - fun getAllUsers(): ResponseEntity { + override fun getAllUsers(): ResponseEntity { return try { val results = userUseCase.getAllUsers() diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/admin/AdminApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/admin/AdminApiDocument.kt new file mode 100644 index 00000000..b4a29665 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/admin/AdminApiDocument.kt @@ -0,0 +1,92 @@ +package hs.kr.entrydsm.application.global.document.admin + +import hs.kr.entrydsm.application.domain.admin.presentation.dto.request.CreateApplicationTypeRequest +import hs.kr.entrydsm.application.domain.admin.presentation.dto.request.CreateEducationalStatusRequest +import hs.kr.entrydsm.application.domain.admin.presentation.dto.request.CreatePrototypeRequest +import hs.kr.entrydsm.application.domain.admin.presentation.dto.response.CreateApplicationTypeResponse +import hs.kr.entrydsm.application.domain.admin.presentation.dto.response.CreateEducationalStatusResponse +import hs.kr.entrydsm.application.domain.admin.presentation.dto.response.CreatePrototypeResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +import io.swagger.v3.oas.annotations.tags.Tag +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.RequestBody + +@Tag(name = "어드민 API", description = "어드민 관련 API") +interface AdminApiDocument { + + @Operation(summary = "전형 타입 생성", description = "새로운 전형 타입을 생성합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "전형 타입 생성 성공", + content = [Content(schema = Schema(implementation = CreateApplicationTypeResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun createApplicationType( + @RequestBody request: CreateApplicationTypeRequest, + ): ResponseEntity + + @Operation(summary = "학력 상태 생성", description = "새로운 학력 상태를 생성합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "학력 상태 생성 성공", + content = [Content(schema = Schema(implementation = CreateEducationalStatusResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun createEducationalStatus( + @RequestBody request: CreateEducationalStatusRequest, + ): ResponseEntity + + @Operation(summary = "프로토타입 생성", description = "새로운 프로토타입을 생성합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "프로토타입 생성 성공", + content = [Content(schema = Schema(implementation = CreatePrototypeResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun createPrototype( + @RequestBody request: CreatePrototypeRequest, + ): ResponseEntity +} \ No newline at end of file diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/ApplicationQueryApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/ApplicationQueryApiDocument.kt new file mode 100644 index 00000000..a6f78571 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/ApplicationQueryApiDocument.kt @@ -0,0 +1,192 @@ +package hs.kr.entrydsm.application.global.document.application + +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.ApplicationDetailResponse +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.ApplicationListResponse +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.ApplicationScoresResponse +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.CalculationHistoryResponse +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.CalculationResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +import io.swagger.v3.oas.annotations.tags.Tag +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.RequestParam + +@Tag(name = "원서 조회 API", description = "원서 조회 관련 API") +interface ApplicationQueryApiDocument { + + @Operation(summary = "원서 상세 조회", description = "특정 원서의 상세 정보를 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "원서 상세 조회 성공", + content = [Content(schema = Schema(implementation = ApplicationDetailResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "원서를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getApplication( + @PathVariable applicationId: String?, + ): ResponseEntity + + @Operation(summary = "원서 목록 조회", description = "필터링 조건에 따라 원서 목록을 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "원서 목록 조회 성공", + content = [Content(schema = Schema(implementation = ApplicationListResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getApplications( + @RequestParam(required = false) applicationType: String?, + @RequestParam(required = false) educationalStatus: String?, + @RequestParam(defaultValue = "0") page: Int, + @RequestParam(defaultValue = "20") size: Int, + ): ResponseEntity + + @Operation(summary = "사용자별 원서 목록 조회", description = "특정 사용자가 제출한 원서 목록을 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "사용자별 원서 목록 조회 성공", + content = [Content(schema = Schema(implementation = ApplicationListResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "사용자를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getUserApplications( + @PathVariable userId: String?, + ): ResponseEntity + + @Operation(summary = "원서 성적 조회", description = "특정 원서의 성적 정보를 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "원서 성적 조회 성공", + content = [Content(schema = Schema(implementation = ApplicationScoresResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "원서를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getApplicationScores( + @PathVariable applicationId: String?, + ): ResponseEntity + + @Operation(summary = "원서 계산 결과 조회", description = "특정 원서의 점수 계산 결과를 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "원서 계산 결과 조회 성공", + content = [Content(schema = Schema(implementation = CalculationResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "원서를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getCalculationResult( + @PathVariable applicationId: String?, + ): ResponseEntity + + @Operation(summary = "원서 계산 이력 조회", description = "특정 원서의 점수 계산 이력을 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "원서 계산 이력 조회 성공", + content = [Content(schema = Schema(implementation = CalculationHistoryResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "원서를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getCalculationHistory( + @PathVariable applicationId: String?, + ): ResponseEntity +} \ No newline at end of file diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/ApplicationSubmissionApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/ApplicationSubmissionApiDocument.kt new file mode 100644 index 00000000..3e6a8c1b --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/ApplicationSubmissionApiDocument.kt @@ -0,0 +1,45 @@ +package hs.kr.entrydsm.application.global.document.application + +import hs.kr.entrydsm.application.domain.application.presentation.dto.request.ApplicationSubmissionRequest +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.ApplicationSubmissionResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +import io.swagger.v3.oas.annotations.tags.Tag +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.RequestBody + +@Tag(name = "원서 제출 API", description = "원서 제출 관련 API") +interface ApplicationSubmissionApiDocument { + + @Operation(summary = "원서 제출", description = "새로운 원서를 제출합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "201", + description = "원서 제출 성공", + content = [Content(schema = Schema(implementation = ApplicationSubmissionResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "요청한 리소스를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun submitApplication( + @RequestBody request: ApplicationSubmissionRequest?, + ): ResponseEntity +} \ No newline at end of file diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/WebApplicationApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/WebApplicationApiDocument.kt new file mode 100644 index 00000000..dd30c64c --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/WebApplicationApiDocument.kt @@ -0,0 +1,91 @@ +package hs.kr.entrydsm.application.global.document.application + +import hs.kr.entrydsm.application.domain.application.presentation.dto.request.ValidateScoreDataRequest +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.PrototypeResponse +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.SupportedTypesResponse +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.ValidationResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +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.RequestParam + +@Tag(name = "웹 애플리케이션 API", description = "웹 애플리케이션 관련 API") +interface WebApplicationApiDocument { + + @Operation(summary = "프로토타입 조회", description = "지정된 전형 타입, 학력 상태, 지역에 해당하는 프로토타입을 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "프로토타입 조회 성공", + content = [Content(schema = Schema(implementation = PrototypeResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "프로토타입을 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getPrototype( + @RequestParam applicationType: String, + @RequestParam educationalStatus: String, + @RequestParam(required = false) region: String?, + ): ResponseEntity + + @Operation(summary = "지원 가능한 타입 조회", description = "지원 가능한 전형 타입과 학력 상태 목록을 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "지원 가능한 타입 조회 성공", + content = [Content(schema = Schema(implementation = SupportedTypesResponse::class))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getSupportedTypes(): ResponseEntity + + @Operation(summary = "성적 데이터 유효성 검사", description = "제출된 성적 데이터의 유효성을 검사합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "성적 데이터 유효성 검사 성공", + content = [Content(schema = Schema(implementation = ValidationResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun validateScoreData( + @RequestBody request: ValidateScoreDataRequest, + ): ResponseEntity +} \ No newline at end of file diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/formula/FormulaSetApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/formula/FormulaSetApiDocument.kt new file mode 100644 index 00000000..2fae2b15 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/formula/FormulaSetApiDocument.kt @@ -0,0 +1,181 @@ +package hs.kr.entrydsm.application.global.document.formula + +import hs.kr.entrydsm.application.domain.formula.presentation.dto.request.CreateFormulaSetRequest +import hs.kr.entrydsm.application.domain.formula.presentation.dto.request.FormulaExecutionRequest +import hs.kr.entrydsm.application.domain.formula.presentation.dto.request.UpdateFormulaSetRequest +import hs.kr.entrydsm.application.domain.formula.presentation.dto.response.FormulaExecutionResponse +import hs.kr.entrydsm.application.domain.formula.presentation.dto.response.FormulaSetDetailResponse +import hs.kr.entrydsm.application.domain.formula.presentation.dto.response.FormulaSetListResponse +import hs.kr.entrydsm.application.domain.formula.presentation.dto.response.FormulaSetResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +import io.swagger.v3.oas.annotations.tags.Tag +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.RequestBody + +@Tag(name = "수식 집합 API", description = "수식 집합 관련 API") +interface FormulaSetApiDocument { + + @Operation(summary = "수식 집합 생성", description = "새로운 수식 집합을 생성합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "201", + description = "수식 집합 생성 성공", + content = [Content(schema = Schema(implementation = FormulaSetResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun createFormulaSet( + @RequestBody request: CreateFormulaSetRequest?, + ): ResponseEntity + + @Operation(summary = "수식 집합 수정", description = "기존 수식 집합을 수정합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "수식 집합 수정 성공", + content = [Content(schema = Schema(implementation = FormulaSetResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "수식 집합을 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun updateFormulaSet( + @PathVariable formulaSetId: String?, + @RequestBody request: UpdateFormulaSetRequest?, + ): ResponseEntity + + @Operation(summary = "수식 집합 목록 조회", description = "모든 수식 집합 목록을 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "수식 집합 목록 조회 성공", + content = [Content(schema = Schema(implementation = FormulaSetListResponse::class))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getFormulaSetList(): ResponseEntity + + @Operation(summary = "수식 집합 상세 조회", description = "특정 수식 집합의 상세 정보를 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "수식 집합 상세 조회 성공", + content = [Content(schema = Schema(implementation = FormulaSetDetailResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "수식 집합을 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getFormulaSetDetail( + @PathVariable formulaSetId: String?, + ): ResponseEntity + + @Operation(summary = "수식 집합 삭제", description = "특정 수식 집합을 삭제합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "204", + description = "수식 집합 삭제 성공", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "수식 집합을 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun deleteFormulaSet( + @PathVariable formulaSetId: String?, + ): ResponseEntity + + @Operation(summary = "수식 실행", description = "특정 수식 집합에 대해 변수들을 사용하여 수식을 실행합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "수식 실행 성공", + content = [Content(schema = Schema(implementation = FormulaExecutionResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "수식 집합을 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun executeFormulas( + @PathVariable formulaSetId: String?, + @RequestBody request: FormulaExecutionRequest?, + ): ResponseEntity +} diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/user/UserApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/user/UserApiDocument.kt new file mode 100644 index 00000000..25c7f663 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/user/UserApiDocument.kt @@ -0,0 +1,89 @@ +package hs.kr.entrydsm.application.global.document.user + +import hs.kr.entrydsm.application.domain.user.presentation.dto.request.CreateUserRequest +import hs.kr.entrydsm.application.domain.user.presentation.dto.response.CreateUserResponse +import hs.kr.entrydsm.application.domain.user.presentation.dto.response.UserDetailResponse +import hs.kr.entrydsm.application.domain.user.presentation.dto.response.UsersListResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +import io.swagger.v3.oas.annotations.tags.Tag +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.RequestBody + +@Tag(name = "사용자 API", description = "사용자 관련 API") +interface UserApiDocument { + + @Operation(summary = "사용자 생성", description = "새로운 사용자를 생성합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "201", + description = "사용자 생성 성공", + content = [Content(schema = Schema(implementation = CreateUserResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun createUser( + @RequestBody request: CreateUserRequest?, + ): ResponseEntity + + @Operation(summary = "사용자 상세 조회", description = "특정 사용자의 상세 정보를 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "사용자 상세 조회 성공", + content = [Content(schema = Schema(implementation = UserDetailResponse::class))] + ), + ApiResponse( + responseCode = "400", + description = "잘못된 요청 데이터", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "404", + description = "사용자를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getUserById( + @PathVariable userId: String?, + ): ResponseEntity + + @Operation(summary = "모든 사용자 조회", description = "모든 사용자 목록을 조회합니다.") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "모든 사용자 조회 성공", + content = [Content(schema = Schema(implementation = UsersListResponse::class))] + ), + ApiResponse( + responseCode = "500", + description = "서버 내부 오류", + content = [Content(schema = Schema(hidden = true))] + ) + ] + ) + fun getAllUsers(): ResponseEntity +}