From 58e464d49bc82f6751263601c4a9a8da67a58821 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Fri, 2 Aug 2024 00:29:24 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20localhost:8080=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=8A=A4=EC=9B=A8=EA=B1=B0=20=EB=AA=BB=EB=B3=B4=EB=8A=94=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../farmusspring/global/common/security/SecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/global/common/security/SecurityConfig.java b/src/main/java/com/modernfarmer/farmusspring/global/common/security/SecurityConfig.java index 73ce8ba5..42471968 100644 --- a/src/main/java/com/modernfarmer/farmusspring/global/common/security/SecurityConfig.java +++ b/src/main/java/com/modernfarmer/farmusspring/global/common/security/SecurityConfig.java @@ -29,7 +29,7 @@ public class SecurityConfig { @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(List.of("http://locahost:8080")); + configuration.setAllowedOrigins(List.of("http://localhost:8080")); configuration.setAllowedMethods(Arrays.asList("GET", "POST")); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", configuration); From f7d918b88eaf42840118dd37b16ed351c3d6b119 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Fri, 2 Aug 2024 00:29:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[feat]=20=EC=8A=A4=EC=9B=A8=EA=B1=B0=20?= =?UTF-8?q?=ED=99=9C=EC=9A=A9=20=EC=98=88=EC=8B=9C=20=EC=BD=94=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/history/controller/HistoryController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/history/controller/HistoryController.java b/src/main/java/com/modernfarmer/farmusspring/domain/history/controller/HistoryController.java index 4fe1cca2..baf0565d 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/history/controller/HistoryController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/history/controller/HistoryController.java @@ -1,9 +1,13 @@ package com.modernfarmer.farmusspring.domain.history.controller; import com.modernfarmer.farmusspring.domain.auth.entity.CustomUser; +import com.modernfarmer.farmusspring.domain.history.dto.res.*; import com.modernfarmer.farmusspring.domain.history.service.HistoryService; import com.modernfarmer.farmusspring.global.response.BaseResponseDto; import com.modernfarmer.farmusspring.global.response.SuccessCode; +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 lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.annotation.AuthenticationPrincipal; @@ -18,6 +22,7 @@ public class HistoryController { private final HistoryService historyService; @GetMapping("/{id}") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = HistoryResponseDto.class))) public BaseResponseDto getUserHistory( @PathVariable Long id ) { @@ -25,6 +30,7 @@ public BaseResponseDto getUserHistory( } @GetMapping("/farmclub") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = FarmClubHistoryListResponseDto.class))) public BaseResponseDto getFarmClubHistories( @AuthenticationPrincipal CustomUser user ) { @@ -32,6 +38,7 @@ public BaseResponseDto getFarmClubHistories( } @GetMapping("/farmclub/{detailId}") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = FarmClubHistoryDetailResponseDto.class))) public BaseResponseDto getFarmClubHistoryDetail( @PathVariable String detailId ) { @@ -39,6 +46,7 @@ public BaseResponseDto getFarmClubHistoryDetail( } @GetMapping("/veggie") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = VeggieHistoryListResponseDto.class))) public BaseResponseDto getVeggieHistories( @AuthenticationPrincipal CustomUser user ) { @@ -46,6 +54,7 @@ public BaseResponseDto getVeggieHistories( } @GetMapping("/veggie/{detailId}") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = VeggieHistoryDetailResponseDto.class))) public BaseResponseDto getVeggieHistoryDetail( @PathVariable String detailId ) {