Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

메인 브랜치로 merge 24.03.04 #249

Merged
merged 82 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
156efea
feat: member 테이블 권한 추가
linglong67 Feb 29, 2024
5c15c2a
feat: review 관련 interceptor 내용 추가
linglong67 Feb 29, 2024
f50bcd6
feat: review paging 및 log 추가
linglong67 Feb 29, 2024
637b360
refactor:: like 리턴변경
HyunJunSon Feb 29, 2024
901adad
Update cicd-dev.yml
linglong67 Feb 29, 2024
48f70b2
refactor : .yml 파일에 jwt-expiring-time 지정하여 profile 별로 다르게 설정하여 사용하도록 수정
chan99k Feb 29, 2024
2c8bc2c
Update cicd-dev.yml
linglong67 Feb 29, 2024
9614bd1
Merge pull request #222 from cgk95/hotfix/configure_jwt_expiring
chan99k Feb 29, 2024
6e261b8
Merge pull request #221 from HyunJunSon/refator/like
linglong67 Feb 29, 2024
0ec3b72
Merge pull request #223 from linglong67/feature/modify-cicd-dev-yml
linglong67 Feb 29, 2024
5bce046
* 쿼리 파일 수정 (계정분류 추가)
Feb 29, 2024
1129ed9
* 계정 분류 Enum 클래스 추가
Feb 29, 2024
d558b8f
* 계정 분류 Entity Field 추가
Feb 29, 2024
580db55
feat :: admin 모듈에서 사용하는 Brand 의 Code 추가
chan99k Feb 29, 2024
f2930c6
feat :: BrandDto 와 그와 관련된 로직 추가
chan99k Feb 29, 2024
b06a0c2
feat :: Admin 모듈 Brand CRUD 기능 구현
chan99k Feb 29, 2024
f933a98
feat :: Admin 모듈 auditor 추가
chan99k Feb 29, 2024
7702973
* Entity에 accountType 추가로 인한 null 추가 (dto엔 accountType가 필요해질 경우에만 넣는걸로)
Feb 29, 2024
7e69ab6
chore :: 오타 수정, Authorization 헤더 삭제
chan99k Feb 29, 2024
0ce9306
feat: 리뷰번호순 정렬 추가
linglong67 Feb 29, 2024
cff8dbc
* AccountType enum 클래스 추가로 인한 코드 수정
Feb 29, 2024
9ca40f4
feat: flyway sql 수정
linglong67 Feb 29, 2024
a19ee50
feat :: 세차정보가 없는 경우 400 메시지를 핸들링하도록 변경
chan99k Feb 29, 2024
232e911
Merge branch 'develop' into hotfix/wash_excetion_handling
chan99k Feb 29, 2024
68bfa3a
* 빌드에러 방지를 위한 테스트코드 추가
Feb 29, 2024
51239ee
Merge pull request #227 from cgk95/hotfix/wash_exception_handling
chan99k Feb 29, 2024
f350c16
Merge pull request #226 from gunsight1/feature_add_account_type
gunsight1 Feb 29, 2024
6f3760d
Update MemberController.java
gunsight1 Feb 29, 2024
a0d0872
feat: 등록/수정에 try-catch 추가
linglong67 Feb 29, 2024
8b65787
* 테이블 컬럼 추가시 존재여부를 판단 한 후 수행하도록 PLSQL로 작성
Feb 29, 2024
d00e2cf
Revert "* 테이블 컬럼 추가시 존재여부를 판단 한 후 수행하도록 PLSQL로 작성"
Feb 29, 2024
0b97e8b
Merge pull request #228 from gunsight1/hotfix_modify_v109_query
gunsight1 Feb 29, 2024
2a87260
Merge branch 'develop' of https://github.com/gunsight1/F1-WashPedia-B…
Feb 29, 2024
290d11e
feat :: GlobalExceptionHandler 에 처리할 예외 추가
chan99k Feb 29, 2024
bed7ed1
feat :: GlobalExceptionHandler 에 MissingRequestHeaderException 처리 추가
chan99k Feb 29, 2024
ffde7a6
* 프론트 로컬 개발 환경용 localhost:3000 추가
Feb 29, 2024
1696657
* 이력 불일치로 인한 sql파일 재추가
Feb 29, 2024
1f075ac
Merge pull request #232 from gunsight1/test_add_webconfig_cors_frontend
gunsight1 Feb 29, 2024
4da697d
squash & merge
chan99k Feb 29, 2024
bfb971e
squash&merge
chan99k Feb 29, 2024
8cdb760
Merge pull request #231 from cgk95/feat/#224
chan99k Feb 29, 2024
fbe1f5c
Merge pull request #229 from linglong67/feature/review-api-update
linglong67 Feb 29, 2024
2b98a24
chore:: interceptor 경로추가
HyunJunSon Feb 29, 2024
07bf0d2
Merge pull request #234 from HyunJunSon/refator/like
HyunJunSon Feb 29, 2024
2e2bab5
develop 브랜치 최신 변경사항 squash
chan99k Mar 1, 2024
c848a05
chore :: json 파라미터 명 변경
chan99k Mar 1, 2024
448abf8
chore :: 에러 코드 메시지, 비즈니스 코드 메시지 변경
chan99k Mar 1, 2024
ba0064f
feat :: IllegalArgumentException 에 대한 핸들러, 에러코드 추가 (주로 요청-응답 간 Json 파…
chan99k Mar 1, 2024
270e7c6
refactor : 비밀번호 재설정 로직 변경
chan99k Mar 1, 2024
ce13f62
Merge branch 'develop' into refactor/change_password_reset_logic
chan99k Mar 1, 2024
1687855
feat :: HttpRequestMethodNotSupportedException 에 대한 핸들러 추가, 주석 제거
chan99k Mar 1, 2024
e7d73cd
fix :: 요청 파라미터 명 명시적으로 지정
chan99k Mar 1, 2024
4156430
fix :: 변경사항을 테스트 코드에 반영
chan99k Mar 1, 2024
42bdb75
fix :: 변수명 명시적으로 수정 (value -> memberId)
chan99k Mar 1, 2024
088840c
resolve conflict
chan99k Mar 1, 2024
9be715b
chore :: 의도하지 않은 줄바꿈 등을 되돌리기
chan99k Mar 2, 2024
8c8409d
Merge pull request #235 from cgk95/refactor/change_password_reset_logic
chan99k Mar 2, 2024
7cc5920
fix :: 내 세차 정보 조회 시, 선택할 수 있는 세차정보 옵션을 함께 반환하도록 변경
chan99k Mar 2, 2024
3dc31aa
Merge pull request #236 from cgk95/fix/washInfo_response
chan99k Mar 2, 2024
8dde2e9
* 프론트 개발 배포서버 추가
Mar 3, 2024
9f3aa6c
Merge pull request #238 from gunsight1/hotfix_add_cors_domain
gunsight1 Mar 3, 2024
74088fd
* 추천제품 20개 발송
Mar 3, 2024
7d66118
Merge pull request #239 from gunsight1/develop
gunsight1 Mar 3, 2024
6a64843
* 테스트코드 에노테이션 생략
Mar 3, 2024
9597d2a
Merge pull request #240 from gunsight1/hotfix_maincontroller_testcode…
gunsight1 Mar 3, 2024
d1f7e1b
setting: querydsl 기본 세팅
linglong67 Mar 3, 2024
d5a5b39
feat: querydsl 적용을 위한 repo 변경 및 추가 (리뷰)
linglong67 Mar 3, 2024
5b8e31b
feat: querydsl 적용을 위한 코드 변경 및 추가 (리뷰)
linglong67 Mar 3, 2024
c3de00b
feat: cf> GlobalException 추가
linglong67 Mar 3, 2024
4f06edc
* 깃허브 장애시(?) 발생 된 merge 코드 누락 조치
Mar 3, 2024
d3c91bf
Merge pull request #241 from gunsight1/hotfix_add_to_product_service_…
gunsight1 Mar 3, 2024
b43762c
* 플랫폼 회원만 이용이 가능한 기능들에 대해 플랫폼 조건을 추가하였습니다.
Mar 3, 2024
66205f4
* 프론트엔드 버셀서버명 변경
Mar 3, 2024
4574b21
Merge pull request #243 from gunsight1/hotfix_config_frontend_cors_do…
gunsight1 Mar 3, 2024
eb02695
Merge pull request #242 from gunsight1/find_member_add_account_type_P…
gunsight1 Mar 4, 2024
878d819
Merge pull request #225 from cgk95/feat/#206
chan99k Mar 4, 2024
ff44b50
feat: 파일명 변경 (~Domain -> ~Jpa, ~Custom -> ~dsl)
linglong67 Mar 4, 2024
89c459c
Merge pull request #245 from linglong67/feature/setting-querydsl
linglong67 Mar 4, 2024
71826c7
* 프론트엔드 버셀서버명 / 제거
Mar 4, 2024
ceb27ef
Merge pull request #246 from gunsight1/hotfix_modified_frontend_origins
gunsight1 Mar 4, 2024
7eeb13f
* 프론트엔드 버셀서버 CORS 추가
Mar 4, 2024
2342840
Merge pull request #247 from gunsight1/hotfix_modified_frontend_origins
gunsight1 Mar 4, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/cicd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ jobs:
echo "${{ secrets.DB_INIT_SQL }}" > init.sql
echo "${{ secrets.DEV_REDIS_CONF }}" > ./redis/redis.conf
echo "${{ secrets.DOCKER_COMPOSE }}" > docker-compose.yml

echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin

docker image prune -af

docker-compose pull
docker-compose down
docker-compose up -d
docker-compose up -d
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.kernel360.brand.code;

import com.kernel360.code.BusinessCode;
import org.springframework.http.HttpStatus;

public enum BrandBusinessCode implements BusinessCode {

SUCCESS_FOUND_BRAND_LIST(HttpStatus.OK.value(),"BMB001","브랜드 목록 조회 성공"),
SUCCESS_FOUND_EXACT_BRAND(HttpStatus.OK.value(),"BMB002","브랜드 상세 조회 성공"),
SUCCESS_CREATED_BRAND(HttpStatus.CREATED.value(), "BMB003","브랜드 추가 성공" ),
SUCCESS_DELETED_BRAND(HttpStatus.OK.value(), "BMB004","브랜드 삭제 성공"),
SUCCESS_UPDATED_BRAND(HttpStatus.OK.value(), "BMB005","브랜드 업데이트 성공" );


private final int status;
private final String code;
private final String message;

BrandBusinessCode(int status, String code, String message) {
this.status = status;
this.code = code;
this.message = message;
}

@Override
public int getStatus() {
return status;
}

@Override
public String getCode() {
return code;
}

@Override
public String getMessage() {
return message;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.kernel360.brand.code;

import com.kernel360.code.ErrorCode;
import org.springframework.http.HttpStatus;

public enum BrandErrorCode implements ErrorCode {
FAILED_CANNOT_FOUND_ANY_BRAND(HttpStatus.NOT_FOUND.value(), "EBC001", "브랜드 목록이 비어있음"),
FAILED_ALREADY_EXISTS_BRAND(HttpStatus.BAD_REQUEST.value(), "EBC002", "생성하려는 브랜드가 이미 존재함"),
FAILED_CANNOT_FOUND_EXACT_BRAND(HttpStatus.NOT_FOUND.value(), "EBC003", "변경하려는 브랜드가 존재하지 않음");
private final int status;
private final String code;
private final String message;

BrandErrorCode(int status, String code, String message) {
this.status = status;
this.code = code;
this.message = message;
}

@Override
public int getStatus() {
return status;
}

@Override
public String getCode() {
return code;
}

@Override
public String getMessage() {
return message;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
package com.kernel360.brand.controller;

import com.kernel360.brand.code.BrandBusinessCode;
import com.kernel360.brand.dto.BrandDto;
import com.kernel360.brand.service.BrandServiceImpl;
import com.kernel360.response.ApiResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/admin/brands")
@RequiredArgsConstructor
public class BrandController {

private final BrandServiceImpl brandService;

@GetMapping
public ResponseEntity<ApiResponse<Object>> getBrandList() {

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_FOUND_BRAND_LIST, brandService.findAllBrand());
}

@GetMapping("/brand")
public ResponseEntity<ApiResponse<Object>> findBrandById(@RequestBody BrandDto brandDto) {

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_FOUND_EXACT_BRAND,
brandService.findBrandByBrandId(brandDto.brandNo()));
}

@GetMapping("/brandName")
public ResponseEntity<ApiResponse<BrandDto>> findBrandByBrandName(@RequestBody BrandDto brandDto) {

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_FOUND_EXACT_BRAND,
brandService.findBrandByBrandName(brandDto.brandName()));
}


@PostMapping("/brand")
public ResponseEntity<ApiResponse<Object>> createBrand(@RequestBody BrandDto brandDto) {
brandService.createBrand(brandDto);

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_CREATED_BRAND);
}

@DeleteMapping("/brand")
public ResponseEntity<ApiResponse<BrandDto>> deleteBrand(@RequestBody BrandDto brandDto) {
brandService.deleteBrand(brandDto.brandNo());

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_DELETED_BRAND);
}

@PutMapping("/brand")
public ResponseEntity<ApiResponse<BrandDto>> updateAll(@RequestBody BrandDto brandDto) {
brandService.updateBrand(brandDto);

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_UPDATED_BRAND);
}

@PatchMapping("/description")
public ResponseEntity<ApiResponse<BrandDto>> updateBrandDescription(@RequestBody BrandDto brandDto) {
brandService.updateBrandDescription(brandDto.brandNo(), brandDto.description());

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_UPDATED_BRAND);
}

@PatchMapping("/brandName")
public ResponseEntity<ApiResponse<BrandDto>> updateBrandName(@RequestBody BrandDto brandDto) {
brandService.updateBrandName(brandDto.brandNo(), brandDto.brandName());

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_UPDATED_BRAND);
}

@PatchMapping("/companyName")
public ResponseEntity<ApiResponse<BrandDto>> updateBrandCompanyName(@RequestBody BrandDto brandDto) {
brandService.updateBrandCompanyName(brandDto.brandNo(), brandDto.companyName());

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_UPDATED_BRAND);
}

@PatchMapping("/nationName")
public ResponseEntity<ApiResponse<BrandDto>> updateBrandNationName(@RequestBody BrandDto brandDto) {
brandService.updateBrandNationName(brandDto.brandNo(), brandDto.nationName());

return ApiResponse.toResponseEntity(BrandBusinessCode.SUCCESS_UPDATED_BRAND);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.kernel360.brand.dto;

import com.kernel360.brand.entity.Brand;

public record BrandDto(Long brandNo, String brandName, String companyName, String description, String nationName) {

public static BrandDto of(Long brandNo, String brandName, String companyName, String description, String nationName) {
return new BrandDto(brandNo, brandName, companyName, description, nationName);
}

public static BrandDto of(String brandName, String companyName, String description, String nationName) {
return new BrandDto(null, brandName, companyName, description, nationName);
}

public static BrandDto fromEntity(Brand brand) {
return new BrandDto(brand.getBrandNo(), brand.getBrandName(), brand.getCompanyName(), brand.getDescription(),
brand.getNationName());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.kernel360.brand.service;

import com.kernel360.brand.dto.BrandDto;
import java.util.List;
import org.springframework.data.crossstore.ChangeSetPersister.NotFoundException;

public interface BrandService {

List<BrandDto> findAllBrand();

BrandDto findBrandByBrandId(Long brandNo);

BrandDto findBrandByBrandName(String brandName);

void createBrand(BrandDto brandDto);

void deleteBrand(final Long brandNo);

void updateBrand(BrandDto brandDto);

void updateBrandDescription(final Long brandNo, final String description);

void updateBrandName(final Long brandNo, final String brandName);

void updateBrandCompanyName(final Long brandNo, final String companyName);

void updateBrandNationName(final Long brandNo, final String nationName);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
package com.kernel360.brand.service;

import com.kernel360.brand.code.BrandErrorCode;
import com.kernel360.brand.dto.BrandDto;
import com.kernel360.brand.entity.Brand;
import com.kernel360.brand.repository.BrandRepository;
import com.kernel360.exception.BusinessException;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
@RequiredArgsConstructor
public class BrandServiceImpl implements BrandService {

private final BrandRepository brandRepository;

@Override
public List<BrandDto> findAllBrand() {
List<Brand> brandList = brandRepository.findAll();
if (brandList.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_ANY_BRAND);
}

return brandList.stream()
.map(BrandDto::fromEntity)
.collect(Collectors.toList());
}

@Override
public BrandDto findBrandByBrandId(Long brandNo) {
Optional<Brand> brand = brandRepository.findBrandByBrandNo(brandNo);
if (brand.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND);
}

return BrandDto.fromEntity(brand.get());
}

@Override
public BrandDto findBrandByBrandName(String brandName) {
Brand brand = brandRepository.findBrandByBrandName(brandName)
.orElseThrow(() -> new BusinessException(
BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND));

return BrandDto.fromEntity(brand);
}

@Override
@Transactional
public void createBrand(BrandDto brandDto) {
Optional<Brand> brand = brandRepository.findBrandByBrandName(brandDto.brandName());
if (brand.isPresent()) {
throw new BusinessException(BrandErrorCode.FAILED_ALREADY_EXISTS_BRAND);
}

brandRepository.save(Brand.toEntity(brandDto.brandName(), brandDto.companyName(), brandDto.description(), brandDto.nationName()));
}

@Override
@Transactional
public void deleteBrand(Long brandNo) {
Optional<Brand> brand = brandRepository.findBrandByBrandNo(brandNo);
if (brand.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND);
}

brandRepository.delete(brand.get());
}

@Override
@Transactional
public void updateBrand(BrandDto brandDto) {
Optional<Brand> brand = brandRepository.findBrandByBrandNo(brandDto.brandNo());
if (brand.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND);
}

brand.get()
.updateAll(brandDto.brandName(), brandDto.companyName(), brandDto.description(), brandDto.nationName());
}

@Override
@Transactional
public void updateBrandDescription(Long brandNo,String description) {
Optional<Brand> brand = brandRepository.findBrandByBrandNo(brandNo);
if (brand.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND);
}

brand.get().updateDescription(description);
}

@Override
@Transactional
public void updateBrandName(Long brandNo, String brandName) {
Optional<Brand> brand = brandRepository.findBrandByBrandNo(brandNo);
if (brand.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND);
}

brand.get().updateBrandName(brandName);
}

@Override
@Transactional
public void updateBrandCompanyName(Long brandNo, String companyName) {
Optional<Brand> brand = brandRepository.findBrandByBrandNo(brandNo);
if (brand.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND);
}

brand.get().updateBrandCompanyName(companyName);
}

@Override
@Transactional
public void updateBrandNationName(Long brandNo, String nationName) {
Optional<Brand> brand = brandRepository.findBrandByBrandNo(brandNo);
if (brand.isEmpty()) {
throw new BusinessException(BrandErrorCode.FAILED_CANNOT_FOUND_EXACT_BRAND);
}

brand.get().updateBrandNationName(nationName);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.kernel360.config;

import jakarta.servlet.http.HttpServletRequest;
import java.util.Optional;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@Configuration
public class AdminAuditConfig implements AuditorAware<String> {
@Override
public Optional<String> getCurrentAuditor() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
String createId = Optional.ofNullable(request.getParameter("id")).orElse("module-admin");

return Optional.of(createId);
}
}
Loading
Loading