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 ) { 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);