Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.kernel360.product.dto;

import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;

import java.time.LocalDate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.kernel360.product.dto.ProductUpdateRequest;
import com.kernel360.product.dto.RecommendProductsDto;
import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;
import com.kernel360.product.repository.ProductRepositoryJpa;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
Expand Down
2 changes: 2 additions & 0 deletions module-admin/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spring:
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
ddl-auto: validate
naming:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hibernate 가 자동으로 이름 붙여주는 부분 확인하였습니다

physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

jasypt:
encryptor:
Expand Down
4 changes: 4 additions & 0 deletions module-admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ spring:
multipart:
max-file-size: 50MB
max-request-size: 500MB
jpa:
hibernate:
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

server:
port: 8082
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.kernel360.likes.dto.LikeSearchDto;
import com.kernel360.likes.entity.Like;
import com.kernel360.likes.service.LikeService;
import com.kernel360.main.controller.Sort;
import com.kernel360.main.enumset.Sort;
import com.kernel360.product.dto.ProductResponse;
import com.kernel360.product.service.ProductService;
import com.kernel360.response.ApiResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.kernel360.likes.dto;

import com.kernel360.main.controller.Sort;
import com.kernel360.main.enumset.Sort;

public record LikeSearchDto(
String token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.kernel360.main.code.BannerBusinessCode;
import com.kernel360.main.dto.BannerDto;
import com.kernel360.main.dto.RecommendProductsDto;
import com.kernel360.main.enumset.Sort;
import com.kernel360.main.service.MainService;
import com.kernel360.product.code.ProductsBusinessCode;
import com.kernel360.product.dto.ProductResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.kernel360.exception.BusinessException;
import com.kernel360.main.code.ConverterErrorCode;
import com.kernel360.main.controller.Sort;
import com.kernel360.main.enumset.Sort;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kernel360.main.controller;
package com.kernel360.main.enumset;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum 타입 패키지 이동 후 메서드 public 부여 확인 했습니다.


import com.kernel360.product.dto.ProductResponse;
import com.kernel360.product.dto.ProductSearchDto;
Expand All @@ -10,7 +10,7 @@ public enum Sort {

VIEW_COUNT_PRODUCT_ORDER("viewCnt-order") {
@Override
Page<ProductResponse> sort(ProductService productService, Pageable pageable) {
public Page<ProductResponse> sort(ProductService productService, Pageable pageable) {

return productService.getProductListOrderByViewCount(pageable);
}
Expand All @@ -25,7 +25,7 @@ public Page<ProductResponse> withKeywordSort(ProductService productService, Stri

VIOLATION_PRODUCT_LIST("violation-products") {
@Override
Page<ProductResponse> sort(ProductService productService, Pageable pageable) {
public Page<ProductResponse> sort(ProductService productService, Pageable pageable) {

return productService.getViolationProducts(pageable);
}
Expand All @@ -39,7 +39,7 @@ public Page<ProductResponse> withKeywordSort(ProductService productService, Stri

RECOMMENDATION_PRODUCT_ORDER("recommend-order") {
@Override
Page<ProductResponse> sort(ProductService productService, Pageable pageable) {
public Page<ProductResponse> sort(ProductService productService, Pageable pageable) {

return productService.getFavoriteProducts(pageable);
}
Expand All @@ -53,7 +53,7 @@ public Page<ProductResponse> withKeywordSort(ProductService productService, Stri

RECENT_PRODUCT_ORDER("recent-order") {
@Override
Page<ProductResponse> sort(ProductService productService, Pageable pageable) {
public Page<ProductResponse> sort(ProductService productService, Pageable pageable) {

return productService.getRecentProducts(pageable);
}
Expand All @@ -75,7 +75,7 @@ public String getOrderType() {
return orderType;
}

abstract Page<ProductResponse> sort(ProductService productService, Pageable pageable);
public abstract Page<ProductResponse> sort(ProductService productService, Pageable pageable);

public abstract Page<ProductResponse> withKeywordSort(ProductService productService, String keyword, Pageable pageable);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
package com.kernel360.member.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

public record PasswordDto(
@NotBlank(message = "비밀번호는 비어 있을수 없습니다.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 저희 로그상에서만 확인 가능한 메세지를 내보내주는 역할인가 보네요

@Size(min = 8, max = 16, message = "비밀번호는 8~16글자입니다.")
@Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=\\S+$).{8,20}$", message = "8~16자의 영문 대/소문자, 숫자, 특수문자를 사용해 주세요.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

// @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\\W).{8,16}$", message = "8~16자의 영문자(대/소문자 구분 없음), 숫자, 특수문자를 사용해 주세요.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Size에 대한 내용과 대소문자 구분을 보면 아래 주석을 한 부분의 패턴이 맞는 것 같은데 아래 패턴을 주석처리하고 위 패턴으로 적용하신 이유가 있으실까요?

String password
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public boolean idDuplicationCheck(String id) {
public boolean emailDuplicationCheck(String email) {
Member member = memberRepository.findOneByEmailForAccountTypeByPlatform(email);

return member != null;
return Objects.nonNull(member);
}

public MemberDto findMemberByToken(String token) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.kernel360.product.controller;

import com.kernel360.main.controller.Sort;
import com.kernel360.main.enumset.Sort;
import com.kernel360.product.code.ProductsBusinessCode;
import com.kernel360.product.dto.ProductDetailDto;
import com.kernel360.product.dto.ProductDto;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.kernel360.product.dto;

import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;

import java.time.LocalDate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.kernel360.product.dto;

import com.kernel360.main.controller.Sort;
import com.kernel360.main.enumset.Sort;

public record ProductSearchDto(
String token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.kernel360.product.dto.ProductResponse;
import com.kernel360.product.dto.ProductSearchDto;
import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;
import com.kernel360.product.repository.ProductRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
Expand Down
2 changes: 2 additions & 0 deletions module-api/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spring:
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
ddl-auto: validate
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
flyway:
enabled: true
baseline-on-migrate: true
Expand Down
2 changes: 2 additions & 0 deletions module-api/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spring:
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
ddl-auto: validate
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
flyway:
enabled: true
baseline-on-migrate: true
Expand Down
2 changes: 2 additions & 0 deletions module-api/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spring:
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
ddl-auto: validate
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@column 애노테이션 제거 후 자동 매핑 처리를 위한 옵션 확인 했습니다.

flyway:
enabled: true
baseline-on-migrate: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//import com.kernel360.main.dto.BannerDto;
//import com.kernel360.main.dto.RecommendProductsDto;
//import com.kernel360.product.dto.ProductDto;
//import com.kernel360.product.entity.SafetyStatus;
//import com.kernel360.product.enumset.SafetyStatus;
//import com.navercorp.fixturemonkey.FixtureMonkey;
//import com.navercorp.fixturemonkey.api.introspector.*;
//import org.junit.jupiter.api.BeforeEach;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,20 @@
import com.kernel360.product.dto.ProductDetailDto;
import com.kernel360.product.dto.ProductDto;
import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.navercorp.fixturemonkey.FixtureMonkey;
import com.navercorp.fixturemonkey.api.introspector.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;

import static org.mockito.ArgumentMatchers.any;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.hamcrest.Matchers.*;
import static org.springframework.restdocs.payload.PayloadDocumentation.*;
import static org.springframework.restdocs.request.RequestDocumentation.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.kernel360.modulebatch.product.dto;

import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;
import java.time.LocalDate;

public record ProductDto(String productName, String barcode, String imageSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.kernel360.ecolife.repository.ConcernedProductRepository;
import com.kernel360.modulebatch.product.dto.ProductDto;
import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;

import java.time.LocalDate;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.kernel360.ecolife.entity.ReportedProduct;
import com.kernel360.modulebatch.product.dto.ProductDto;
import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;

import java.time.LocalDate;
import java.util.List;
Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔끔해지겠군요 ㅎㅎ
저도 이후에 만드는 건 일단 이렇게 해봐야겠어요

Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,17 @@ public class CarInfo extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "car_info_id_gen")
@SequenceGenerator(name = "car_info_id_gen", sequenceName = "car_info_car_no_seq")
@Column(name = "car_no", nullable = false)
@Column(nullable = false)
private Long carNo;

@OneToOne
@JoinColumn(name = "member_no")
private Member member;

@Column(name = "car_type")
private Integer carType;

@Column(name = "car_size")
private Integer carSize;

@Column(name = "car_color")
private Integer carColor;

@Column(name = "driving_env")
private Integer drivingEnv;

@Column(name = "parking_env")
private Integer parkingEnv;

public CarInfo(Integer carType, Integer carSize, Integer carColor, Integer drivingEnv, Integer parkingEnv) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kernel360.product.entity;

import com.kernel360.base.BaseEntity;
import com.kernel360.product.enumset.SafetyStatus;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.kernel360.product.entity;

import com.kernel360.product.enumset.SafetyStatus;
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;
import java.util.stream.Stream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kernel360.product.entity;
package com.kernel360.product.enumset;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.kernel360.product.repository;

import com.kernel360.product.entity.Product;
import com.kernel360.product.entity.SafetyStatus;
import com.kernel360.product.enumset.SafetyStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -12,7 +12,7 @@
import java.util.List;
import java.util.Optional;

public interface ProductRepositoryJpa extends JpaRepository<Product, Long> {
public interface ProductRepositoryJpa extends JpaRepository<Product, Long> {

Page<Product> findAllByOrderByViewCountDesc(Pageable pageable);

Expand Down Expand Up @@ -75,6 +75,6 @@ Page<Product> findByProductWithKeywordAndSafetyStatus(@Param("keyword") String k
@Param("safetyStatus") SafetyStatus safetyStatus,
Pageable pageable);

Page<Product> findByProductNameContaining(String keyword, Pageable pageable);
Page<Product> findByProductNameContaining(String keyword, Pageable pageable);

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,15 @@ public class WashInfo extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "wash_info_id_gen")
@SequenceGenerator(name = "wash_info_id_gen", sequenceName = "wash_info_wash_no_seq", allocationSize = 50)
@Column(name = "wash_no", nullable = false)
@Column(nullable = false)
private Integer washNo;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_no", nullable = false)
private Member member;

@Column(name = "wash_count")
private Integer washCount;

@Column(name = "monthly_expense")
private Integer monthlyExpense;

@Column(name = "interest")
private Integer interest;

private WashInfo(Integer washCount, Integer monthlyExpense, Integer interest) {
Expand Down