This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Swagger를 통한 문서화 * refactor: openAPI v3 spec에 맞게 GET이 req body를 가지지 않도록 변경 * refactor: API description 작성 * refactor: query와 command URL 형식 통일 * refactor: query와 command URL 형식 통일 * fix: 반려식물 생성 시, `PlantInformation`이 제대로 설정되지 않던 문제 해결 * fix: 임시조치, 데일리 기록에 사진에 저장 가능하도록 수정 * doc: 문서 보강(tag, securityRequirement)
- Loading branch information
1 parent
6e6a3be
commit 87f93b6
Showing
19 changed files
with
152 additions
and
141 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
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/gdsc/plantory/common/config/SwaggerConfig.kt
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,20 @@ | ||
package gdsc.plantory.common.config | ||
|
||
import gdsc.plantory.common.support.AccessDeviceToken | ||
import gdsc.plantory.common.support.DEVICE_ID_HEADER | ||
import io.swagger.v3.oas.models.Operation | ||
import io.swagger.v3.oas.models.security.SecurityRequirement | ||
import org.springdoc.core.customizers.OperationCustomizer | ||
import org.springframework.stereotype.Component | ||
import org.springframework.web.method.HandlerMethod | ||
|
||
@Component | ||
class Operation : OperationCustomizer { | ||
override fun customize(operation: Operation?, handlerMethod: HandlerMethod?): Operation? { | ||
if (handlerMethod?.methodParameters?.find { it.hasParameterAnnotation(AccessDeviceToken::class.java) } != null) { | ||
operation?.addSecurityItem(SecurityRequirement().addList(DEVICE_ID_HEADER)) | ||
} | ||
|
||
return operation | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/kotlin/gdsc/plantory/common/support/AccessDeviceToken.kt
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
package gdsc.plantory.common.support | ||
|
||
import io.swagger.v3.oas.annotations.Parameter | ||
import io.swagger.v3.oas.annotations.enums.ParameterIn | ||
|
||
@Target(AnnotationTarget.VALUE_PARAMETER) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
@Parameter(`in` = ParameterIn.HEADER, name = DEVICE_ID_HEADER, description = "사용자 디바이스/인증 토큰") | ||
annotation class AccessDeviceToken |
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
5 changes: 0 additions & 5 deletions
5
src/main/kotlin/gdsc/plantory/plant/presentation/dto/CompanionPlantDeleteRequest.kt
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
src/main/kotlin/gdsc/plantory/plant/presentation/dto/CompanionPlantDto.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/main/kotlin/gdsc/plantory/plant/presentation/dto/PlantHistoriesLookupRequest.kt
This file was deleted.
Oops, something went wrong.
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
1 change: 0 additions & 1 deletion
1
src/main/kotlin/gdsc/plantory/plant/presentation/dto/PlantRecordCreateRequest.kt
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package gdsc.plantory.plant.presentation.dto | ||
|
||
data class PlantRecordCreateRequest( | ||
val companionPlantId: Long, | ||
val comment: String, | ||
) |
8 changes: 0 additions & 8 deletions
8
src/main/kotlin/gdsc/plantory/plant/presentation/dto/PlantRecordLookupRequest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.