From 9948488ded3e92e7d5162d186679394471da979a Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 29 Jul 2024 17:47:14 +0900 Subject: [PATCH 01/16] =?UTF-8?q?config:=20jwt=20=EC=86=8D=EC=84=B1?= =?UTF-8?q?=EC=9D=84=20yml=EC=97=90=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/resources/application.yml diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 00000000..f780b604 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,8 @@ + +jwt: + bearer: ${JWT_BEARER:Bearer} + secret: ${JWT_SECRET_KEY} + access-expiration: ${JWT_ACCESS_EXPIRE:3600000} # 1?? (??: ms) + access-header: ${JWT_ACCESS_HEADER:Authorization} # Access Token ?? + refresh-expiration: ${JWT_REFRESH_EXPIRE:86400000} # 1? (??: ms) + refresh-header: ${JWT_REFRESH_HEADER:Authorization-Refresh} # Refresh Token ?? From e75815cb80965ea8be100a373705b902a44f30bc Mon Sep 17 00:00:00 2001 From: hyeokson Date: Tue, 30 Jul 2024 15:43:20 +0900 Subject: [PATCH 02/16] =?UTF-8?q?rebase:=20=EC=9B=90=EB=B3=B8=20develop=20?= =?UTF-8?q?=EB=B8=8C=EB=9E=9C=EC=B9=98=EC=99=80=20=EB=B3=91=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 src/main/resources/application.yml diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index f780b604..00000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,8 +0,0 @@ - -jwt: - bearer: ${JWT_BEARER:Bearer} - secret: ${JWT_SECRET_KEY} - access-expiration: ${JWT_ACCESS_EXPIRE:3600000} # 1?? (??: ms) - access-header: ${JWT_ACCESS_HEADER:Authorization} # Access Token ?? - refresh-expiration: ${JWT_REFRESH_EXPIRE:86400000} # 1? (??: ms) - refresh-header: ${JWT_REFRESH_HEADER:Authorization-Refresh} # Refresh Token ?? From 5fb317939399ca73d56f5dba42bd62e567297ff2 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:04:57 +0900 Subject: [PATCH 03/16] =?UTF-8?q?feat:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20=EC=9A=94=EC=B2=AD=20dto?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/dto/login/AdminSignUpRequestDto.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminSignUpRequestDto.java diff --git a/src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminSignUpRequestDto.java b/src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminSignUpRequestDto.java new file mode 100644 index 00000000..c8ec7ea6 --- /dev/null +++ b/src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminSignUpRequestDto.java @@ -0,0 +1,18 @@ +package com.softeer.backend.bo_domain.admin.dto.login; + +import jakarta.validation.constraints.NotNull; +import lombok.*; + +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor(access = AccessLevel.PUBLIC) +@Builder +@Getter +public class AdminSignUpRequestDto { + + @NotNull + private String account; + + @NotNull + private String password; + +} From fd59180becacb69aab801768095de43b643341b2 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:05:10 +0900 Subject: [PATCH 04/16] =?UTF-8?q?feat:=20swagger=20controller=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/common/swagger/SwaggerController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main/java/com/softeer/backend/global/common/swagger/SwaggerController.java diff --git a/src/main/java/com/softeer/backend/global/common/swagger/SwaggerController.java b/src/main/java/com/softeer/backend/global/common/swagger/SwaggerController.java new file mode 100644 index 00000000..7cfbbc3b --- /dev/null +++ b/src/main/java/com/softeer/backend/global/common/swagger/SwaggerController.java @@ -0,0 +1,13 @@ +package com.softeer.backend.global.common.swagger; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class SwaggerController { + + @RequestMapping("/swagger") + public String getRedirectUrl() { + return "redirect:swagger-ui/index.html"; + } +} From a004d7de332644198b92efa8412a3c20c0d0424d Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:05:41 +0900 Subject: [PATCH 05/16] =?UTF-8?q?feat:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20controller=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo_domain/admin/controller/AdminLoginController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/softeer/backend/bo_domain/admin/controller/AdminLoginController.java b/src/main/java/com/softeer/backend/bo_domain/admin/controller/AdminLoginController.java index 08d04de1..6ac11892 100644 --- a/src/main/java/com/softeer/backend/bo_domain/admin/controller/AdminLoginController.java +++ b/src/main/java/com/softeer/backend/bo_domain/admin/controller/AdminLoginController.java @@ -1,6 +1,7 @@ package com.softeer.backend.bo_domain.admin.controller; import com.softeer.backend.bo_domain.admin.dto.login.AdminLoginRequestDto; +import com.softeer.backend.bo_domain.admin.dto.login.AdminSignUpRequestDto; import com.softeer.backend.bo_domain.admin.service.AdminLoginService; import com.softeer.backend.global.annotation.AuthInfo; import com.softeer.backend.global.common.dto.JwtTokenResponseDto; @@ -33,5 +34,13 @@ ResponseDto handleLogout(@AuthInfo Integer adminId) { return ResponseDto.onSuccess(); } + @PostMapping("/signup") + ResponseDto handleSignUp(@Valid @RequestBody AdminSignUpRequestDto adminSignUpRequestDto) { + + adminLoginService.handleSignUp(adminSignUpRequestDto); + + return ResponseDto.onSuccess(); + } + } From 1e301e6726695f5e426118031771c2b6adaaf60a Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:05:54 +0900 Subject: [PATCH 06/16] =?UTF-8?q?feat:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=9A=94=EC=B2=AD=20dto=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo_domain/admin/dto/login/AdminLoginRequestDto.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminLoginRequestDto.java b/src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminLoginRequestDto.java index 0f87a9f6..96f4cbf6 100644 --- a/src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminLoginRequestDto.java +++ b/src/main/java/com/softeer/backend/bo_domain/admin/dto/login/AdminLoginRequestDto.java @@ -1,6 +1,7 @@ package com.softeer.backend.bo_domain.admin.dto.login; import com.softeer.backend.global.common.constant.ValidationConstant; +import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; import lombok.*; @@ -10,11 +11,9 @@ @Getter public class AdminLoginRequestDto { - @Pattern(regexp = ValidationConstant.ADMIN_ACCOUNT_REGEX, - message = ValidationConstant.ADMIN_ACCOUNT_MSG) + @NotNull private String account; - @Pattern(regexp = ValidationConstant.ADMIN_PASSWORD_REGEX, - message = ValidationConstant.ADMIN_PASSWORD_MSG) + @NotNull private String password; } From 07d1059dc5d527ad87afc28f8f237c373fd87e28 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:06:06 +0900 Subject: [PATCH 07/16] =?UTF-8?q?feat:=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/service/AdminLoginService.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/softeer/backend/bo_domain/admin/service/AdminLoginService.java b/src/main/java/com/softeer/backend/bo_domain/admin/service/AdminLoginService.java index fde81f89..c0679b38 100644 --- a/src/main/java/com/softeer/backend/bo_domain/admin/service/AdminLoginService.java +++ b/src/main/java/com/softeer/backend/bo_domain/admin/service/AdminLoginService.java @@ -2,6 +2,7 @@ import com.softeer.backend.bo_domain.admin.domain.Admin; import com.softeer.backend.bo_domain.admin.dto.login.AdminLoginRequestDto; +import com.softeer.backend.bo_domain.admin.dto.login.AdminSignUpRequestDto; import com.softeer.backend.bo_domain.admin.exception.AdminException; import com.softeer.backend.bo_domain.admin.repository.AdminRepository; import com.softeer.backend.bo_domain.admin.util.PasswordEncoder; @@ -54,4 +55,18 @@ public void handleLogout(int adminId) { .roleType(RoleType.ROLE_ADMIN) .build()); } + + @Transactional + public void handleSignUp(AdminSignUpRequestDto adminSignUpRequestDto) { + + if(adminRepository.existsByAccount(adminSignUpRequestDto.getAccount())){ + log.error("Admin account already exist."); + throw new AdminException(ErrorStatus._BAD_REQUEST); + } + + adminRepository.save(Admin.builder() + .account(adminSignUpRequestDto.getAccount()) + .password(passwordEncoder.encode(adminSignUpRequestDto.getPassword())) + .build()); + } } From 43629c15bc7d1eb713df143011a99cf52165db99 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:06:47 +0900 Subject: [PATCH 08/16] =?UTF-8?q?feat:=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 특정 account에 대한 데이터가 admin 저장소에 있는지 확인하는 메서드 구현 --- .../backend/bo_domain/admin/repository/AdminRepository.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/softeer/backend/bo_domain/admin/repository/AdminRepository.java b/src/main/java/com/softeer/backend/bo_domain/admin/repository/AdminRepository.java index b0bfb7d8..6a9cbca7 100644 --- a/src/main/java/com/softeer/backend/bo_domain/admin/repository/AdminRepository.java +++ b/src/main/java/com/softeer/backend/bo_domain/admin/repository/AdminRepository.java @@ -9,4 +9,6 @@ @Repository public interface AdminRepository extends JpaRepository { Optional findByAccount(String account); + + boolean existsByAccount(String account); } From 60fabc2a986d28ef06906929911c30be02a4147d Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:07:03 +0900 Subject: [PATCH 09/16] =?UTF-8?q?feat:=20swagger,=20admin=20url=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/global/filter/JwtAuthenticationFilter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/softeer/backend/global/filter/JwtAuthenticationFilter.java b/src/main/java/com/softeer/backend/global/filter/JwtAuthenticationFilter.java index 4a92da78..4fcc3eae 100644 --- a/src/main/java/com/softeer/backend/global/filter/JwtAuthenticationFilter.java +++ b/src/main/java/com/softeer/backend/global/filter/JwtAuthenticationFilter.java @@ -34,10 +34,11 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { // 인증검사를 하지 않는 url 설정 private final String[] whiteListUrls = { - "/swagger-ui/**", "/swagger", "/error/**", + "/swagger-ui/**", "/swagger", "/v3/**", "/error/**", "/verification/send", "/verification/confirm", "/login", - "/main/event", "/main/car" + "/main/event", "/main/car", + "/admin/login", "/admin/signup" }; // Access Token이 header에 있으면 인증하고 없으면 인증하지 않는 url 설정 From 4681d8d04ff39068ee009271a3e3461c379eb5c4 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:07:19 +0900 Subject: [PATCH 10/16] =?UTF-8?q?feat:=20swagger=20=EC=84=9C=EB=B2=84=20?= =?UTF-8?q?=EC=A3=BC=EC=86=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/global/config/docs/SwaggerConfig.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/softeer/backend/global/config/docs/SwaggerConfig.java b/src/main/java/com/softeer/backend/global/config/docs/SwaggerConfig.java index 98676316..3b3192e4 100644 --- a/src/main/java/com/softeer/backend/global/config/docs/SwaggerConfig.java +++ b/src/main/java/com/softeer/backend/global/config/docs/SwaggerConfig.java @@ -21,7 +21,7 @@ description = "T라미숙해 api명세", version = "v1"), servers = { - @Server(url = "https://vec-to.net"), + @Server(url = "https://softeer.shop"), @Server(url = "http://localhost:5000") } ) @@ -44,11 +44,11 @@ public GroupedOpenApi chatOpenApi() { @Bean public OpenAPI getOpenApi() { Components components = new Components() - .addSecuritySchemes("bearerAuth", getJwtSecurityScheme()) - .addSecuritySchemes("refreshAuth", getJwtRefreshSecurityScheme()); + .addSecuritySchemes("AccessToken", getJwtSecurityScheme()) + .addSecuritySchemes("RefreshToken", getJwtRefreshSecurityScheme()); SecurityRequirement securityItem = new SecurityRequirement() - .addList("bearerAuth") - .addList("refreshAuth"); + .addList("AccessToken") + .addList("RefreshToken"); return new OpenAPI() .components(components) From 336fc682ef1b83edcfb15fcb5fa6e76ccbbb62f7 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:07:27 +0900 Subject: [PATCH 11/16] =?UTF-8?q?feat:=20cors=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/softeer/backend/global/config/web/WebMvcConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java b/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java index aebbbd41..526f3e2a 100644 --- a/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java +++ b/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java @@ -48,7 +48,7 @@ public void addArgumentResolvers(List resolvers) public void addCorsMappings(CorsRegistry registry) { // TODO: Origin 도메인 수정 및 헤더값 설정 registry.addMapping("/**") - .allowedOrigins("https://softeer.site", "http://localhost:5173") // 허용할 도메인 설정 + .allowedOrigins("https://softeer.site", "http://localhost:5173", "https://softeer.shop") // 허용할 도메인 설정 .allowedMethods("OPTIONS", "GET", "POST", "PUT", "DELETE") // 허용할 HTTP 메서드 설정 .allowedHeaders("Content-Type", "Authorization", "Authorization-Refresh") // 허용할 헤더 설정 .exposedHeaders("Authorization", "Authorization-Refresh") // 클라이언트에 노출할 헤더 설정 From 3ba439a508c59216d8c120e66054394a5f561802 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 04:24:43 +0900 Subject: [PATCH 12/16] =?UTF-8?q?feat:=20=ED=8A=B9=EC=A0=95=20url=EC=97=90?= =?UTF-8?q?=20=EB=8C=80=ED=95=B4=EC=84=9C=20=EC=9D=B8=EA=B0=80=20=EA=B2=80?= =?UTF-8?q?=EC=82=AC=20=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/filter/JwtAuthorizationFilter.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/com/softeer/backend/global/filter/JwtAuthorizationFilter.java b/src/main/java/com/softeer/backend/global/filter/JwtAuthorizationFilter.java index 76850168..0f35d2dd 100644 --- a/src/main/java/com/softeer/backend/global/filter/JwtAuthorizationFilter.java +++ b/src/main/java/com/softeer/backend/global/filter/JwtAuthorizationFilter.java @@ -10,6 +10,8 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.util.PatternMatchUtils; +import org.springframework.web.cors.CorsUtils; import org.springframework.web.filter.OncePerRequestFilter; import java.io.IOException; @@ -20,9 +22,21 @@ @Slf4j @NoArgsConstructor public class JwtAuthorizationFilter extends OncePerRequestFilter { + + // 인가검사를 하지 않는 url 설정 + private final String[] whiteListUrls = { + "/admin/login", "/admin/signup" + }; + @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + if(CorsUtils.isPreFlightRequest(request) || isUriInWhiteList(request.getRequestURI())){ + filterChain.doFilter(request, response); + return; + } + + JwtClaimsDto jwtClaimsDto = (JwtClaimsDto) request.getAttribute("jwtClaims"); if (jwtClaimsDto == null || jwtClaimsDto.getRoleType() != RoleType.ROLE_ADMIN) { @@ -34,4 +48,8 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse filterChain.doFilter(request, response); } + private boolean isUriInWhiteList(String url) { + return PatternMatchUtils.simpleMatch(whiteListUrls, url); + } + } From d721ebcf52646c9ccef39decf2f99114de34ddcd Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 13:55:45 +0900 Subject: [PATCH 13/16] =?UTF-8?q?refactor:=20CarVideoInfo=20=EB=82=B4?= =?UTF-8?q?=EB=B6=80=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainpage/dto/MainPageCarResponseDto.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/main/java/com/softeer/backend/fo_domain/mainpage/dto/MainPageCarResponseDto.java b/src/main/java/com/softeer/backend/fo_domain/mainpage/dto/MainPageCarResponseDto.java index bf89cb56..ad8aef6e 100644 --- a/src/main/java/com/softeer/backend/fo_domain/mainpage/dto/MainPageCarResponseDto.java +++ b/src/main/java/com/softeer/backend/fo_domain/mainpage/dto/MainPageCarResponseDto.java @@ -10,25 +10,8 @@ @Getter public class MainPageCarResponseDto { - private CarVideoInfo carVideoInfo; - private List carInfoList; - - @Getter - @AllArgsConstructor - @Builder - public static class CarVideoInfo{ - - private String title; - - private String subTitle; - - private String videoUrl; - - private String backgroundImgUrl; - } - @Getter @AllArgsConstructor @Builder From 6b5d3a1b4fdd216896c3f01099138b504480b9aa Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 13:56:04 +0900 Subject: [PATCH 14/16] =?UTF-8?q?refactor:=20CarVideoInfo=EB=A5=BC=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainpage/service/MainPageService.java | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java b/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java index fdc230de..b18e20cd 100644 --- a/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java +++ b/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java @@ -44,7 +44,15 @@ public MainPageEventResponseDto getEventPage(){ public MainPageCarResponseDto getCarPage(){ - MainPageCarResponseDto.CarDetailInfo carDetailInfo1_1 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarInfo carInfo1 = MainPageCarResponseDto.CarInfo.builder() + .id(1) + .title(staticResourcesUtil.getData("MAIN_TITLE")) + .subTitle(staticResourcesUtil.getData("MAIN_SUBTITLE")) + .imgUrl(staticResourcesUtil.getData("ioniq_video")) + .backgroundImgUrl(staticResourcesUtil.getData("main_background_image")) + .build(); + + MainPageCarResponseDto.CarDetailInfo carDetailInfo2_1 = MainPageCarResponseDto.CarDetailInfo.builder() .id(1) .title(staticResourcesUtil.getData("INTERIOR_OPENNESS_TITLE")) .subTitle(staticResourcesUtil.getData("INTERIOR_OPENNESS_SUBTITLE")) @@ -52,7 +60,7 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("interior_openness_image")) .build(); - MainPageCarResponseDto.CarDetailInfo carDetailInfo1_2 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarDetailInfo carDetailInfo2_2 = MainPageCarResponseDto.CarDetailInfo.builder() .id(2) .title(staticResourcesUtil.getData("INTERIOR_WELLNESS_TITLE")) .subTitle(staticResourcesUtil.getData("INTERIOR_WELLNESS_SUBTITLE")) @@ -60,18 +68,18 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("interior_wellness_image")) .build(); - MainPageCarResponseDto.CarInfo carInfo1 = MainPageCarResponseDto.CarInfo.builder() - .id(1) + MainPageCarResponseDto.CarInfo carInfo2 = MainPageCarResponseDto.CarInfo.builder() + .id(2) .title(staticResourcesUtil.getData("INTERIOR_TITLE")) .subTitle(staticResourcesUtil.getData("INTERIOR_SUBTITLE")) .imgTitle(staticResourcesUtil.getData("INTERIOR_IMAGE_TITLE")) .imgContent(staticResourcesUtil.getData("INTERIOR_IMAGE_CONTENT")) .imgUrl(staticResourcesUtil.getData("interior_thumbnail_image")) .backgroundImgUrl(staticResourcesUtil.getData("interior_background_image")) - .carDetailInfoList(Arrays.asList(carDetailInfo1_1, carDetailInfo1_2)) + .carDetailInfoList(Arrays.asList(carDetailInfo2_1, carDetailInfo2_2)) .build(); - MainPageCarResponseDto.CarDetailInfo carDetailInfo2_1 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarDetailInfo carDetailInfo3_1 = MainPageCarResponseDto.CarDetailInfo.builder() .id(1) .title(staticResourcesUtil.getData("PERFORMANCE_BRAKING_TITLE")) .subTitle(staticResourcesUtil.getData("PERFORMANCE_BRAKING_SUBTITLE")) @@ -79,7 +87,7 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("performance_braking_image")) .build(); - MainPageCarResponseDto.CarDetailInfo carDetailInfo2_2 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarDetailInfo carDetailInfo3_2 = MainPageCarResponseDto.CarDetailInfo.builder() .id(2) .title(staticResourcesUtil.getData("PERFORMANCE_DRIVING_TITLE")) .subTitle(staticResourcesUtil.getData("PERFORMANCE_DRIVING_SUBTITLE")) @@ -87,18 +95,18 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("performance_driving_image")) .build(); - MainPageCarResponseDto.CarInfo carInfo2 = MainPageCarResponseDto.CarInfo.builder() - .id(2) + MainPageCarResponseDto.CarInfo carInfo3 = MainPageCarResponseDto.CarInfo.builder() + .id(3) .title(staticResourcesUtil.getData("PERFORMANCE_TITLE")) .subTitle(staticResourcesUtil.getData("PERFORMANCE_SUBTITLE")) .imgTitle(staticResourcesUtil.getData("PERFORMANCE_IMAGE_TITLE")) .imgContent(staticResourcesUtil.getData("PERFORMANCE_IMAGE_CONTENT")) .imgUrl(staticResourcesUtil.getData("performance_thumbnail_image")) .backgroundImgUrl(staticResourcesUtil.getData("performance_background_image")) - .carDetailInfoList(Arrays.asList(carDetailInfo2_1, carDetailInfo2_2)) + .carDetailInfoList(Arrays.asList(carDetailInfo3_1, carDetailInfo3_2)) .build(); - MainPageCarResponseDto.CarDetailInfo carDetailInfo3_1 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarDetailInfo carDetailInfo4_1 = MainPageCarResponseDto.CarDetailInfo.builder() .id(1) .title(staticResourcesUtil.getData("CHARGING_FAST_TITLE")) .subTitle(staticResourcesUtil.getData("CHARGING_FAST_SUBTITLE")) @@ -106,7 +114,7 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("charging_fast_image")) .build(); - MainPageCarResponseDto.CarDetailInfo carDetailInfo3_2 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarDetailInfo carDetailInfo4_2 = MainPageCarResponseDto.CarDetailInfo.builder() .id(2) .title(staticResourcesUtil.getData("CHARGING_V2L_TITLE")) .subTitle(staticResourcesUtil.getData("CHARGING_V2L_SUBTITLE")) @@ -114,8 +122,8 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("charging_v2l_image")) .build(); - MainPageCarResponseDto.CarInfo carInfo3 = MainPageCarResponseDto.CarInfo.builder() - .id(3) + MainPageCarResponseDto.CarInfo carInfo4 = MainPageCarResponseDto.CarInfo.builder() + .id(4) .title(staticResourcesUtil.getData("CHARGING_TITLE")) .subTitle(staticResourcesUtil.getData("CHARGING_SUBTITLE")) .imgTitle(staticResourcesUtil.getData("CHARGING_IMAGE_TITLE")) @@ -125,7 +133,7 @@ public MainPageCarResponseDto getCarPage(){ .carDetailInfoList(Arrays.asList(carDetailInfo3_1, carDetailInfo3_2)) .build(); - MainPageCarResponseDto.CarDetailInfo carDetailInfo4_1 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarDetailInfo carDetailInfo5_1 = MainPageCarResponseDto.CarDetailInfo.builder() .id(1) .title(staticResourcesUtil.getData("SAFE_DRIVING_TITLE")) .subTitle(staticResourcesUtil.getData("SAFE_DRIVING_SUBTITLE")) @@ -133,7 +141,7 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("safe_driving_image")) .build(); - MainPageCarResponseDto.CarDetailInfo carDetailInfo4_2 = MainPageCarResponseDto.CarDetailInfo.builder() + MainPageCarResponseDto.CarDetailInfo carDetailInfo5_2 = MainPageCarResponseDto.CarDetailInfo.builder() .id(2) .title(staticResourcesUtil.getData("SAFE_ADVANCED_TITLE")) .subTitle(staticResourcesUtil.getData("SAFE_ADVANCED_SUBTITLE")) @@ -141,8 +149,8 @@ public MainPageCarResponseDto getCarPage(){ .imgUrl(staticResourcesUtil.getData("safe_advanced_image")) .build(); - MainPageCarResponseDto.CarInfo carInfo4 = MainPageCarResponseDto.CarInfo.builder() - .id(4) + MainPageCarResponseDto.CarInfo carInfo5 = MainPageCarResponseDto.CarInfo.builder() + .id(5) .title(staticResourcesUtil.getData("SAFE_TITLE")) .subTitle(staticResourcesUtil.getData("SAFE_SUBTITLE")) .imgTitle(staticResourcesUtil.getData("SAFE_IMAGE_TITLE")) @@ -152,19 +160,8 @@ public MainPageCarResponseDto getCarPage(){ .carDetailInfoList(Arrays.asList(carDetailInfo4_1, carDetailInfo4_2)) .build(); - - - - MainPageCarResponseDto.CarVideoInfo carVideoInfo = MainPageCarResponseDto.CarVideoInfo.builder() - .title(staticResourcesUtil.getData("MAIN_TITLE")) - .subTitle(staticResourcesUtil.getData("MAIN_SUBTITLE")) - .videoUrl(staticResourcesUtil.getData("ioniq_video")) - .backgroundImgUrl(staticResourcesUtil.getData("main_background_image")) - .build(); - return MainPageCarResponseDto.builder() - .carVideoInfo(carVideoInfo) - .carInfoList(Arrays.asList(carInfo1, carInfo2, carInfo3, carInfo4)) + .carInfoList(Arrays.asList(carInfo1, carInfo2, carInfo3, carInfo4, carInfo5)) .build(); } } From a3cbe12256fc97b4a487e1da450e43da48712f07 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 13:56:22 +0900 Subject: [PATCH 15/16] =?UTF-8?q?refactor:=20TODO=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/softeer/backend/global/config/web/WebMvcConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java b/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java index 526f3e2a..0420fecc 100644 --- a/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java +++ b/src/main/java/com/softeer/backend/global/config/web/WebMvcConfig.java @@ -46,7 +46,7 @@ public void addArgumentResolvers(List resolvers) */ @Override public void addCorsMappings(CorsRegistry registry) { - // TODO: Origin 도메인 수정 및 헤더값 설정 + registry.addMapping("/**") .allowedOrigins("https://softeer.site", "http://localhost:5173", "https://softeer.shop") // 허용할 도메인 설정 .allowedMethods("OPTIONS", "GET", "POST", "PUT", "DELETE") // 허용할 HTTP 메서드 설정 From 9367e08fdbd7854aa6b86725c04f0bdf70a43623 Mon Sep 17 00:00:00 2001 From: hyeokson Date: Mon, 12 Aug 2024 14:20:04 +0900 Subject: [PATCH 16/16] =?UTF-8?q?fix:=20=EB=B3=80=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/fo_domain/mainpage/service/MainPageService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java b/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java index b18e20cd..a06afb4b 100644 --- a/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java +++ b/src/main/java/com/softeer/backend/fo_domain/mainpage/service/MainPageService.java @@ -130,7 +130,7 @@ public MainPageCarResponseDto getCarPage(){ .imgContent(staticResourcesUtil.getData("CHARGING_IMAGE_CONTENT")) .imgUrl(staticResourcesUtil.getData("charging_thumbnail_image")) .backgroundImgUrl(staticResourcesUtil.getData("charging_background_image")) - .carDetailInfoList(Arrays.asList(carDetailInfo3_1, carDetailInfo3_2)) + .carDetailInfoList(Arrays.asList(carDetailInfo4_1, carDetailInfo4_2)) .build(); MainPageCarResponseDto.CarDetailInfo carDetailInfo5_1 = MainPageCarResponseDto.CarDetailInfo.builder() @@ -157,7 +157,7 @@ public MainPageCarResponseDto getCarPage(){ .imgContent(staticResourcesUtil.getData("SAFE_IMAGE_CONTENT")) .imgUrl(staticResourcesUtil.getData("safe_thumbnail_image")) .backgroundImgUrl(staticResourcesUtil.getData("safe_background_image")) - .carDetailInfoList(Arrays.asList(carDetailInfo4_1, carDetailInfo4_2)) + .carDetailInfoList(Arrays.asList(carDetailInfo5_1, carDetailInfo5_2)) .build(); return MainPageCarResponseDto.builder()