Skip to content

Commit

Permalink
백엔드 배포 작업 (#209)
Browse files Browse the repository at this point in the history
* 깃허브 액션 CI 워크플로 작성 (#6)

feat: 깃허브 액션 CI 워크플로 작성

* feat: 프로젝트 생성 및 의존성 추가

* chore: logging 설정

* feat: Member Entity 생성

* refactor: Member 패키지 변경

* feat: Runner Entity 생성

* refactor: 모든 entity 에서 embeddedId 제거

* feat: Company null 예외 검증 구현

* feat: Email null 예외 검증 구현

* feat: GithubUrl null 예외 검증 구현

* feat: Name null 예외 검증 구현

* feat: OauthId null 예외 검증 구현

* feat: Member null 예외 검증 구현

* refactor: Grade 패키지 위치 변경

* refactor: TotalRating 매직 넘버 설정

* feat: Supporter 의 VO 객체 생성

* feat: Supporter 생성 기능 구현

* feat: Runner null 예외 검증 구현

* refactor: Runner, Supporter 외래키 nullable = false 로 설정

* feat: Title VO 구현

* feat: Contents VO 구현

* feat: PullRequestUrl VO 구현

* refactor: Contents 타입 varchar 에서 text로 변경

* feat: Deadline VO 구현

* feat: WatchedCount VO 구현

* feat: ChattingRoomCount VO 구현

* fix: 예외 메시지 분리

* style: 클래스 명과 변수 사이 개행

* feat: RunnerPost entity 생성

* refactor: Member 이름 변수명 변경

* feat: TagName VO 구현

* feat: TagCount VO 구현

* feat: Tag entity 생성

* feat: RunnerPostTag entity 생성

* feat: BaseEntity 적용

* feat: Entity JPA repository 구현

* feat: Cascade persist 옵션과 orphanRemoval 옵션 추가

* feat: RunnerPost Controller 및 Service 뼈대 코드 작성

* test: RunnerPostTag 테스트 수정

* refactor: gradle 빌드 파일 삭제

* docs: CI 스크립트 수정

* refactor: gradle 빌드 파일 재생성

* refactor: gradle 빌드 파일 재생성

* docs: CI 스크립트 내의 프로젝트 빌드 파일 경로 수정

* docs: CI 오류 확인

* docs: CI gradlew 경로로 이동

* docs: CI 경로 한 run에 설정

* docs: CI 성공

* 스프링 기본 구조 설계 (#18)

* feat: 프로젝트 생성 및 의존성 추가

* chore: logging 설정

* feat: Member Entity 생성

* refactor: Member 패키지 변경

* feat: Runner Entity 생성

* refactor: 모든 entity 에서 embeddedId 제거

* feat: Company null 예외 검증 구현

* feat: Email null 예외 검증 구현

* feat: GithubUrl null 예외 검증 구현

* feat: Name null 예외 검증 구현

* feat: OauthId null 예외 검증 구현

* feat: Member null 예외 검증 구현

* refactor: Grade 패키지 위치 변경

* refactor: TotalRating 매직 넘버 설정

* feat: Supporter 의 VO 객체 생성

* feat: Supporter 생성 기능 구현

* feat: Runner null 예외 검증 구현

* refactor: Runner, Supporter 외래키 nullable = false 로 설정

* feat: Title VO 구현

* feat: Contents VO 구현

* feat: PullRequestUrl VO 구현

* refactor: Contents 타입 varchar 에서 text로 변경

* feat: Deadline VO 구현

* feat: WatchedCount VO 구현

* feat: ChattingRoomCount VO 구현

* fix: 예외 메시지 분리

* style: 클래스 명과 변수 사이 개행

* feat: RunnerPost entity 생성

* refactor: Member 이름 변수명 변경

* feat: TagName VO 구현

* feat: TagCount VO 구현

* feat: Tag entity 생성

* feat: RunnerPostTag entity 생성

* feat: BaseEntity 적용

* feat: Entity JPA repository 구현

* feat: Cascade persist 옵션과 orphanRemoval 옵션 추가

* feat: RunnerPost Controller 및 Service 뼈대 코드 작성

* test: RunnerPostTag 테스트 수정

* refactor: gradle 빌드 파일 삭제

* refactor: gradle 빌드 파일 재생성

* refactor: gradle 빌드 파일 재생성

* feat: request dto 생성

* feat: service 레이어 구현

* style: 주석 추가

* feat: Controller 레이어 구현

* refactor: update 한 후에 id 받아오도록 수정

* test: update 성공 테스트 작성

* refactor: Tag 에서 BaseEntity 제거

* feat: Tag 개수 증가 및 감소, 비교 로직 추가

* test: 테스트 displayName 변경

* feat: 초기 tag 생성 기능 구현

* feat: 필드 update 기능 구현

* feat: request dto 에 LocalDateTime getter 생성

* feat: tag 이름으로 tag 조회 기능 구현

* feat: id 로 RunnerPostTag 목록 조회 기능 구현

* feat: 러너 게시글 수정 service 구현

* refactor: dto 이름 변경

* refactor: equalsAndHashCode 적용

* test: service 테스트 작성

* Revert "러너 게시글 수정 API 구현" (#36)

* 러너 게시글 등록 API 구현 (#30)

* feat: RunnerPost VO에 Equals&Hashcode 추가

* feat: TagRepository 에 Tag 이름으로 조회하는 로직 추가

* feat: TagName name 컬럼 unique 제약 조건 추가

* feat: Tag 기본 생성 기능 및 count 증가 기능 추가

* feat: RunnerPostTag 추가 기능 구현

* refactor: RunnerPostTag create 메서드 삭제

* feat: WatchedCount 기본 생성 기능 구현

* feat: ChattingRoomCount 기본 생성 기능 구현

* feat: RunnerPost 기본 생성 기능 구현

* feat: RunnerRepository에서 Runner와 Member를 조인해서 가져오는 기능 구현

* feat: RunnerService에서 Runner와 Member를 조인해서 가져오는 기능 구현

* refactor: TagCount method 이름 변경

* feat: RunnerPost 생성 API 구현

* feat: RunnerPost 에 Tag 를 전체 추가하는 기능 구현

* style: RunnerPostService 줄바꿈 제거

* fix: Join fetch 조건 오류 해결

* feat: RunnerPostController createRunnerPost 에서 create 반환 변수 명 변경

* refactor: create 메서드 명을 createRunnerPost 로 변경

* style: 공백 정리

* refactor: findByIdJoinMember 를 joinMemberByRunnerId 로 변경

* refactor: TagCount 의 기본값을 항상 새로운 객체로 반환 하도록 수정

* refactor: WatchedCount 의 기본값을 항상 새로운 값으로 반환하도록 변경

* refactor: ChattingRoomCount 의 기본값을 항상 새로운 값으로 변경하도록 변경

* 러너 게시글 상세 조회 및 삭제 API 구현 (#28)

* feat: 러너 게시글에 러너 게시글 태그 추가 기능 구현

* feat: RunnerPost 상세 조회 및 삭제 기능 추가

* feat: Tag 레포지터리에 TagCount 감소 기능 구현

* feat: RunnerPost 식별자값으로 RunnerPostTag 목록 조회 기능 구현

* feat: RunnerPost 서비스 상세 조회 및 삭제 기능 구현

* feat: Member 에 ImageUrl 필드 추가

* feat: RunnerPost 컨트롤러 상세 조회 및 삭제 API 구현

* test: ImageUrl null 예외 검증 테스트 구현

* test: DisplayName 내용 수정

* fix: Tag 의 TagCount 수가 줄어든 후 영속성 컨텍스트가 비어지지 않도록 수정

* refactor: Tag 의 TagCount 감소 기능을 변경 감지로 리팩터링

* test: RunnerPost 레포지터리 상세 조회 및 삭제 테스트 분리

* refactor: JPQL 에 사용할 변수명을 @param 으로 표기하도록 리팩터링

* test: RestAssured 에 @transactional 제거

* test: RestAssured 응답 객체 변환 기능 수정

* test: 인수테스트 @disable

* fix: RunnerPost 의 deadline 응답 반환 타입 수정

* test: Non Ascii 어노테이션 추가

* refactor: RunnerPostResponse Single 레코드명 리팩터링

* refactor: 레포지터리 Tag 조인 메서드명 리팩터링

* test: 사용하지 않는 인자 삭제

* 러너 게시글 수정 API 구현 (#41)

* refactor: id -> runnerPostId 변경

* refactor: UriComponentsBuilder 적용

* refactor: String -> LocalDateTime 으로 변경

* test: 변수에 final 키워드 적용

* refactor: service 에 final 키워드 적용

* refactor: Getter 와 EqualsAndHashCode 어노테이션 위치 변경

* refactor: tag 관련 네이밍 변경

* style: 개행 닫기

* refactor: tagCount 수정

* refactor: import 적용

* refactor: 변수명 변경

* refactor: 어노테이션 위치 조정

* refactor: Tag 는 TimeStamp 저장 안하도록 설정

* refactor: id 로 runnerPost 조회 시 검색되지 않으면 예외 던지도록 설정

* refactor: 메소드명 변경

* test: display name 변경

* refactor: TagCount init 시에 parseInt 하는 방식으로 변경

* 러너 게시글 조회 API 구현 (#32)

* feat: 리뷰 요청 글 도메인 구현

* feat: 리뷰 요청 글 컨트롤러 구현

* feat: 리뷰 요청 글 레포지토리 구현

* feat: 리뷰 요청 글 서비스 구현

* feat: VO equals and hashcode 재정의

* test: 리뷰 요청글 작성 테스트 작성

* feat: imageUrl 생성

* refactor: 리뷰 반영

* refactor: 모든 리뷰 요청 글 조회외에 모두 삭제

* fix: 충돌 해결

---------

Co-authored-by: jeonghoon <[email protected]>

* 리뷰 요청 글 전체 조회 API 수정, Tag이름 조회 수정 (#47)

* feat: 리뷰 요청 글 도메인 구현

* feat: 리뷰 요청 글 컨트롤러 구현

* feat: 리뷰 요청 글 레포지토리 구현

* feat: 리뷰 요청 글 서비스 구현

* feat: VO equals and hashcode 재정의

* test: 리뷰 요청글 작성 테스트 작성

* feat: imageUrl 생성

* refactor: 리뷰 반영

* refactor: 모든 리뷰 요청 글 조회외에 모두 삭제

* fix: 충돌 해결

* fix: 리뷰 요청 글 전체 조회 API path 수정

* fix: Tag 이름 조회 수정

* fix: API 수정에 따른 테스트 코드 수정

* sytle: 사용하지 않는 () 삭제

---------

Co-authored-by: jeonghoon <[email protected]>

* 러너 포스트 중복 저장 시 발생하는 오류 해결 (#48)

* chore: docker 외부 포트 고정

* fix: 중복되어서 저장이 안되는 문제 수정

* 러너 게시글 태그 중복 조회 오류 해결 (#51)

fix: 영속성 컨텍스트에 RunnerPostTag가 기존에 존재하고 있으므로 중복되지 않도록 RunnerPost에 RunnerPostTag를 add하는 기능 삭제

* 예외 메시지 반환을 위한 ErrorResponse 객체 생성 (#62)

* feat: 새로운 커스텀 Exception 추가 및 이전 버전의 Exception 클래스 수정

* feat: 새로운 커스텀 Exception 도메인별 구현체 및 도메인별 에러 코드 enum 구현

* feat: 베이스 커스텀 Exception 에 HttpStatus 가져오기 기능 구현

* feat: 베이스 에러 응답 객체 구현

* fix: 아직 구현되지 않은 러너 게시글 조회수 증가 기능 삭제

* test: 러너 게시글 마감일 검증 테스트 수정

* feat: 클라이언트 요청 커스텀 Exception 추가 및 병합된 에러 코드 구현

* 러너 게시글 조회 객체 이름 수정 (#63)

* feat: 리뷰 요청 글 도메인 구현

* test: 리뷰 요청글 작성 테스트 작성

* feat: imageUrl 생성

* refactor: 리뷰 반영

* refactor: 모든 리뷰 요청 글 조회외에 모두 삭제

* refactor: 명세에 맞게 변수명 수정

* 테스트 코드를 위한 Fixture 생성 및 RunnerPost 테이블에 status 칼럼 추가 (#74)

* refactor: Runner 와 Supporter 에 Grade 를 nullable=false로 설정

* feat: RunnerPost 에 ReviewStatus 추가

* test: MemberFixture 구현

* test: RunnerFixture 구현

* test: SupporterFixture 구현

* test: TagFixture 구현

* test: Fixture 추상클래스로 변경

* test: Fixture 정적 팩토리 메서드 파라미터 이름 변경

* test: Fixture 검증

* RunnerPostTag에 FK 제약 조건 이름 수정  (#66)

* feat: RunnerPostTag에 fk 제약조건 이름 변경

* refactor: RunnerPost fk 제약 조건 이름 변경

* refactor: Runner fk 제약 조건 이름 변경

* refactor: Supporter fk 제약 조건 이름 변경

* refactor: RunnerPostTag fk 제약 조건 이름 변경

* 나누어져있는 RunnerPostResponse 통합 (#78)

* refactor: dto 통합

* refactor: Profile dto 통합

* 서포터 목록 조회 API 구현 version-test (#93)

* feat: Runner 와 Supporter 에 introduction 칼럼 추가

* feat: SupporterService 구현

* feat: Supporter Response 구현

* feat: 서포터 전체 조회 controller 구현

* feat: 서포터 전체 조회 Response 에 회사 추가 구현

* 서포터 목록 조회 API 에서 별점 제거 (#96)

* feat: Runner 와 Supporter 에 introduction 칼럼 추가

* feat: SupporterService 구현

* feat: Supporter Response 구현

* feat: 서포터 전체 조회 controller 구현

* feat: 서포터 전체 조회 Response 에 회사 추가 구현

* fix: supporter response 에 별점 제거

* fix: supporter response 에 별점 제거

* 러너 리뷰 요청 게시글 생성 version-test (#94)

* feat: RunnerPostService 에서 testversion 저장하는 기능 구현

* feat: RunnerPostController 서포터 식별자를 받아 글을 생성하는 메서드 구현

* refactor: RunnerPost 와 Runner 의 관계를 ManyToOne 으로 변경

* test: 테스트에 SupporterRepository 의존성 추가

* refactor: RunnerPost 변수에 final 키워드 추가

* refactor: CreateReqeustDto 에 timezone 추가

* feat: 러너 게시글 조회 API 구현 version-test

* style: 주석 제거

* Profile에 isOwner 삭제하고 RunnerPostResponse에 isOwner 추가 (#104)

* feat: 러너 게시글 조회 API 구현 version-test

* style: 주석 제거

* refactor: ProfileResponse에 isOwner 삭제

* refactor: RunnerPostResponse에 isOwner 추가

* test: Response 변경에 따른 테스트 수정

* refactor:isOwner VO 추가

* refactor: 유지보수를 위해 true를 기본값으로 설정

* refactor: ProfileResponse 수정에 의한 변경

* Docker Hub와 GitHub self hosted runner를 이용한 CD 설정  (#106)

* docs: Docker 를 이용한 CD 설정

* docs: CD 타겟 브랜치 수정

* 러너 게시글 상세 조회 API 구현 version-test (#109)

* Test Fixture 파라미터 타입 수정 (#110)

* test: Domain Fixture 메서드 파라미터 타입 수정

* test: 테스트 Fixture 사용 수정

* test: Runner Test Fixture 수정

* 클라이언트 예외를 위한 Validator 추가 (#117)

* refactor: ClientRequestException 일반 클래스로 변경

* refactor: ErrorResponse 에서 httpStatus 제거

* refactor: RunnerPostUpdateRequest record로 변경

* refactor: ClientErrorCode 내용 추가

* refactor: record로 생긴 변화 적용

* feat: NotNullValid 어노테이션 추가

* refactor: ErrorResponse 에 getter 추가

* feat: Controller valid 추가

* feat: ValidFuture 어노테이션 추가

* feat: 어노테이션 이름 변경

* feat: Max validator 추가

* feat: request dto에 validation 적용

* refactor: 어노테이션 target 조정

* refactor: tag 값이 없을 때 Bad Request 보내도록 수정

* CORS 설정 및 Profile을 RunnerProfile로 변경 (#120)

* feat: cors 설정

* refactor: MemberProfile 을 RunnerProfile 로 수정

* feat: cors HttpMethod 에 PATCH 추가

* 환경 변수 보호를 위한 서브 모듈 연결 (#125)

* feat: 서브 모듈 추가

* feat: 서브 모듈 환경 설정

* fix: 실험을 위해 현재 브랜치로 CD 실행하도록 변경

* refactor: Dockerfile 경로 변경

* refactor: 실험을 위해 공백 푸시

* refactor: 실험을 성공 후 공백 다시 추가

* refactor: CD 브랜치 dev/BE로 변경

* refactor: CI/CD 파일명 변경

* String 으로 된 Date 값을 LocalDateTime 으로 변경하는 컨버터 구현 (#127)

* feat: String 으로 된 Date 값을 LocalDateTime 으로 변경하는 컨버터 구현

* refactor: RunnerPostCreateTestRequest 에서 컨버터를 사용하도록 변경

* feat: Json으로 직렬화될 때 custom 날짜 형식으로 변경되도록 수정

* refactor: RunnerPostresponse 에서 JsonFormat을 사용하지 않도록 변경

* test: StringDateToLocalDateTime 테스트 방식 변경

* test: ConverterConfigTest를 SpringBootTest 에서 WebMvcTest 로 변경

* test: StringDateToLocalDateTimeConverter 실패 테스트 추가

* feat: DateTimeConverter desiralizer 구현

* test: ConverterConfigTest 실패 테스트 수정

* Merge pull request #130

* test: Restdocs Test Config 설정 및 러너 게시글 전체 조회 api test 추가

* 백엔드 프로덕션 컨테이너 세팅 (#132)

* chore: Dockerfile 실행 환경 dev, prod 분리 및 사용하지 않는 Docker Image 삭제 명령어 추가

* chore: ci/cd deploy 환경 분리

* Merge pull request #130

* test: Restdocs Test Config 설정 및 러너 게시글 전체 조회 api test 추가

* secret 파일 pull (#139)

fix: secret 파일 pull

* secret 파일 pull (#141)

fix: secret 파일 pull

* secret 파일 pull (#142)

fix: secret 파일 pull

* dev 환경에 방언 추가 (#143)

* fix: secret 파일 pull

* refactor: secret 변경

* dev에 prod db 적용해보기 (#144)

* fix: secret 파일 pull

* refactor: secret 변경

* fix: cicd 스크립트에 prod db 적용

* cicd 파일 및 환경 변수 원상복구 (#145)

* fix: secret 파일 pull

* refactor: secret 변경

* fix: cicd 스크립트에 prod db 적용

* refactor: secret, cicd 원상복귀

* secret 변경 (#146)

* fix: secret 파일 pull

* refactor: secret 변경

* fix: cicd 스크립트에 prod db 적용

* refactor: secret, cicd 원상복귀

* refactor: secret 수정

* 도커 secret 수정 (#147)

* fix: secret 파일 pull

* refactor: secret 변경

* fix: cicd 스크립트에 prod db 적용

* refactor: secret, cicd 원상복귀

* refactor: secret 수정

* refactor: secret 수정

* 서포터 기술 태그 table 추가 (#151)

* feat: TechnicalTag entity 생성

* feat: SupporterTechnicalTag entity 생성

* fix: 터지는 테스트 수정

* 러너 게시글 조회할 때 조회수 증가 기능 구현 (#148)

* feat: 러너 게시글 조회수 증가 기능 구현

* 서포터 기술 태그 table 추가 (#151)

* feat: TechnicalTag entity 생성

* feat: SupporterTechnicalTag entity 생성

* fix: 터지는 테스트 수정

* feat: 러너 게시글 조회수 증가 기능 구현

---------

Co-authored-by: Jeonghoon Park <[email protected]>

* docker network 설정 (#156)

fix: docker network 설정

* fix: docker network 설정 (#158)

* cd 파일 재설정 (#160)

fix: cd 파일 재설정

* 프론트엔드 코드 삭제 (#167)

fix: 프론트엔드 코드 삭제

* 서포터 전체 조회 기술 태그 목록 추가 version-test (#162)

* feat: 서포터 전체 조회 기술 태그 목록 추가 version-test

* fix: 서포터 태그 목록 List 로 변환

* test: supporterTechnicalTags 조회 테스트 수정

* test: supporterTechnicalTags 조회 테스트 assertAll 사용

* CORS 환경별로 allowed origin 변경 (#169)

* feat: submodule 업데이트

* feat: gitignore 에 application.yml 추가

* feat: application.yml 중요 환경 변수 숨기기

* 테스트 코드 Fixture 통일 (#172)

* test: assure 패키지의 MemberFixture 삭제

* test: assure 패키지의 RunnerFixture 삭제

* test: assure 패키지의 RunnerPostFixture 삭제

* test: domain 에 있는 RunnerFixture 삭제

* test: domain 에 있는 RunnerPostData 삭제

* test: RunnerRepositoryTest 가 RepositoryTestConfig 를 상속 받도록 변경

* test: TagRepositoryTest 가 RepositoryTestConfig 를 상속 받도록 변경

* domain exception이 server exception을 상속받도록 수정 (#177)

* refactor: domain exception을 server exception을 상속받도록 수정

* refactor: 사용하지 않는 MemberException 제거

* dev 환경 변수 수정 (#188)

fix: 환경 변수 수정

* Github Social Login 4차 구현 (#164)

* chore: HttpInterface 사용을 위한 의존성 추가

* feat: 소셜 타입 구분을 위한 OauthType 추가

* feat: AuthCode 를 받아오기 위한 인터페이스와 확장성을 고려한 컴포시트 패턴 추가

* feat: Oauth 정보를 받아올 인터페이스와 확장성을 위한 컴포시트 패턴 구현

* feat: 외부 변수를 받아올 GithubOauthConfig 구현 및 최상단 애플리케이션에 읽어올 수 있도록 스캔 어노테이션 적용

* feat: Github Oauth 요청을 위한 구현체 및 스프링 컨테이너에 빈 등록을 위한 HttpInterfaceConfig 설정 구현

* feat: Oauth 로그인을 받을 컨트롤러와 저장 및 조회를 위한 Oauth 레포지터리, Oauth 서비스 구현

* chore: gradle 에 auth0 jwt 의존성 추가

* feat: AccessToken dto 구현 추가 및 OauthInformation 내부 회사 정보 삭제

* feat: OauthType enum 컨버터 구현

* feat: Jwt 인코더, Jwt 디코더 구현

* feat: Oauth 전용 Runner, Supporter 레포지터리 구현

* feat: Runner, Supporter Principal 어노테이션 및 Runner, Supporter ArgumentResolver 구현

* feat: Oauth 서비스 Jwt 인코드 기능 및 Member, Runner, Supporter 신규 사용자 자동 회원가입 추가, Oauth 컨트롤러 Jwt 헤더 반환 구현

* test: WebMvcTest 시 bean 스캔 문제 해결을 위한 커스텀 MockMvcTest 어노테이션 구현 및 RestdocsConfig 수정

* test: Oauth Api 테스트 및 기존 Api Test 를 MockMvcTest 로 수정

* refactor: auth0 의존성을 삭제하고 jjwt 추가 후 HS256 를 이용하도록 JWT 설정 변경

* refactor: AccessToken JWT 내부 Claim 에서 삭제

* refactor: oauth 패키지 이동

* refactor: JWT 디코더 내부 검증 변경

* refactor: Oauth 사용자 정의 예외로 변경

* chore: 서브 모듈 최신화

* fix: 외부 환경 변수 자바 객체 주입을 문자열로 수정

* refactor: cors origin 외부 환경 변수 주입하도록 변경

* refactor: JWT Signature 클라이언트 요청 예외 에러 코드 변경

* refactor: Oauth Email 에러 코드 JWT 로 변경

* feat: Jwt 디코더 에러 코드 추가

* style: 문자열 상수화 및 메서드 파라미터 컨벤션 적용

* dev 환경 변수 수정 (#188)

fix: 환경 변수 수정

* refactor: AccessToken 명 SocialToken 으로 변경 및 Auth 관련 패키지 분리

---------

Co-authored-by: Jeonghoon Park <[email protected]>

* Oauth API prefix 수정 및 깃허브 소셜 로그인 Http Method 수정 (#193)

* fix: Oauth API prefix 수정 및 깃허브 소셜 로그인 Http Method 수정

* test: Oauth Api Test prefix 수정

* 서포터 피드백 등록 API 구현 (#186)

* feat: Description VO 구현

* feat: SupporterFeedback 엔티티 구현

* chore: Feedback 관련 패키지 변경

* refactor: SupporterFeedback Entity 에 nullable 추가

* feat: Runner 에 equals&hashcode 추가

* feat: SupporterFeedback 등록 API 구현

* refactor: FeedbackBusinessException 내부 클래스 삭제

* test: 안 쓰는 인스턴스 변수 로컬 변수로 변경

* test: SupporterFeedback 관련 Fixture 구현

* test: RestAssuredTest 컨벤션에 맞게 변경

* refactor: FeedbackService 에 Transaction 추가

* refactor: FeedbackService Runner 찾는 과정 삭제

* refactor: 로그인 기능 추가에 따른 @AuthRunner 사용하도록 변경

* refactor: RunnerPost 와 SupporterFeedback 과의 관계를 OneToOne 으로 변경

* 모든 도메인 객체 exception Notnull method 제거 (#184)

* refactor: domain exception을 server exception을 상속받도록 수정

* refactor: 사용하지 않는 MemberException 제거

* refactor: 모든 도메인 객체 exception Notnull method 제거

* refactor: stream 컨벤션에 맞도록 수정

* refactor: conflict 해결

* test: 에러메세지 수정

* refactor: TagException 상세히 분할(RunnerPostTag, SupporterTechnicalTag)

* refactor: TagException 상세히 분할(RunnerPostTag, SupporterTechnicalTag)에 따른 테스트 수정

* refactor: stream 점 위치 수정

* 러너 본인 프로필 조회 기능 구현 (#183)

* refactor: runner response 는 runner 패키지로 이동

* feat: runner 프로필 조회 response 생성

* refactor: 바뀐 response 패키지 적용

* test: IntroductionFixture 추가

* test: 인수테스트 추가

* test: 중복된 테스트 제거

* feat: runner 식별자로 runnerPost 조회 쿼리 생성

* feat: runner 식별자로 runnerPost 조회 서비스 로직 구현

* feat: runner 본인 프로필 조회 기능 구현

* refactor: auth 적용

* refactor: restdocs 관련 테스트 주석 처리

* test: runner fixture 에 introduction 추가

* refactor: controller 메소드 이름 변경

* Member Email 값 객체를 SocialId 값 객체로 변경 (#196)

* refactor: Member Email 값 객체를 SocialId 로 변경

* refactor: Member 의 SocialId 컬럼명 수정

* 모든 API 인증 기능 추가 (#202)

* refactor: FeedbackController 에 사용하지 않는 변수 삭제

* refactor: runnerPost auth 어노테이션 붙이기

* refactor: 게시물 상세 조회 시 auth 선택적으로 적용하도록 변경

* refactor: 게시물 수정, 삭제 시에 Auth 어노테이션 추가

* refactor: 서포터 전체 조회 반환 필드 변경

* test: 변경 사항에 따른 테스트 코드 변경

* 클라이언트 에러 HttpStatus 수정 (#206)

refactor: 클라이언트 에러 HttpStatus 수정

* 게시글 최신순으로 정렬 (#207)

* feat: 생성 순으로 게시글 불러오는 쿼리 생성

* feat: 게시글 생성 순으로 정렬

* refactor: yml 업데이트

---------

Co-authored-by: HyunSeo Park (Hyena) <[email protected]>
Co-authored-by: Ethan <[email protected]>
Co-authored-by: 은비 <[email protected]>
Co-authored-by: eunbii0213 <[email protected]>
  • Loading branch information
5 people authored Aug 3, 2023
1 parent fddade1 commit a7f2793
Show file tree
Hide file tree
Showing 222 changed files with 2,834 additions and 13,035 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/frontend_ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion backend/baton/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,5 @@ gradle-app.setting

# End of https://www.toptal.com/developers/gitignore/api/macos,java,gradle,intellij+all

src/main/resources/application-prod.yml
src/main/resources/application-deploy.yml
src/main/resources/application-dev.yml
4 changes: 4 additions & 0 deletions backend/baton/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
Expand Down
2 changes: 1 addition & 1 deletion backend/baton/secret
2 changes: 2 additions & 0 deletions backend/baton/src/main/java/touch/baton/BatonApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;

@ConfigurationPropertiesScan
@SpringBootApplication
public class BatonApplication {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package touch.baton.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import touch.baton.domain.oauth.controller.resolver.AuthRunnerPrincipalArgumentResolver;
import touch.baton.domain.oauth.controller.resolver.AuthSupporterPrincipalArgumentResolver;

import java.util.List;

@RequiredArgsConstructor
@Configuration
public class ArgumentResolverConfig extends WebMvcConfig {

private final AuthRunnerPrincipalArgumentResolver authRunnerPrincipalArgumentResolver;
private final AuthSupporterPrincipalArgumentResolver authSupporterPrincipalArgumentResolver;

@Override
public void addArgumentResolvers(final List<HandlerMethodArgumentResolver> resolvers) {
resolvers.add(authRunnerPrincipalArgumentResolver);
resolvers.add(authSupporterPrincipalArgumentResolver);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package touch.baton.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import touch.baton.infra.auth.oauth.github.http.GithubHttpInterface;

import static org.springframework.web.reactive.function.client.support.WebClientAdapter.forClient;

@Configuration
public class OauthHttpInterfaceConfig {

@Bean
public GithubHttpInterface githubHttpClient() {
return createHttpClient(GithubHttpInterface.class);
}

private <T> T createHttpClient(final Class<T> clazz) {
return HttpServiceProxyFactory
.builder(forClient(WebClient.create()))
.build()
.createClient(clazz);
}
}
13 changes: 10 additions & 3 deletions backend/baton/src/main/java/touch/baton/config/WebMvcConfig.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package touch.baton.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import static org.springframework.http.HttpHeaders.AUTHORIZATION;
import static org.springframework.http.HttpHeaders.LOCATION;
import static org.springframework.http.HttpMethod.DELETE;
import static org.springframework.http.HttpMethod.GET;
Expand All @@ -13,13 +16,17 @@

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

@Value("${cors.allowed-origin}")
private String allowedOrigin;

@Override
public void addCorsMappings(final CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowCredentials(false)
.allowedOrigins(allowedOrigin)
.allowCredentials(true)
.allowedMethods(GET.name(), POST.name(), PUT.name(), PATCH.name(), DELETE.name(), OPTIONS.name())
.exposedHeaders(LOCATION)
.exposedHeaders(LOCATION, AUTHORIZATION)
.maxAge(3600);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class ConverterConfig implements WebMvcConfigurer {
@Override
public void addFormatters(final FormatterRegistry registry) {
registry.addConverter(new StringDateToLocalDateTimeConverter(DEFAULT_DATE_TIME_FORMAT, KOREA_TIME_ZONE));
registry.addConverter(new OauthTypeConverter());
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package touch.baton.config.converter;

import org.springframework.core.convert.converter.Converter;
import touch.baton.domain.oauth.OauthType;

public class OauthTypeConverter implements Converter<String, OauthType> {

@Override
public OauthType convert(final String source) {
return OauthType.from(source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class GlobalControllerAdvice {

@ExceptionHandler(ClientRequestException.class)
public ResponseEntity<ErrorResponse> handleClientRequest(ClientRequestException e) {
return ResponseEntity.status(e.getHttpStatus().value()).body(ErrorResponse.from(e));
return ResponseEntity.status(e.getErrorCode().getHttpStatus()).body(ErrorResponse.from(e));
}
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
package touch.baton.domain.common.exception;

import org.springframework.http.HttpStatus;

public abstract class BaseException extends RuntimeException {

private final ErrorCode errorCode;

public BaseException(final ErrorCode errorCode) {
this.errorCode = errorCode;
}

@Override
public String getMessage() {
return errorCode.getMessage();
}

public String getErrorCode() {
return errorCode.getErrorCode();
}

public HttpStatus getHttpStatus() {
return errorCode.getHttpStatus();
public BaseException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public abstract class BusinessException extends BaseException {

public BusinessException(final ServerErrorCode errorCode) {
super(errorCode);
public BusinessException(final String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.springframework.http.HttpStatus;

public enum ClientErrorCode implements ErrorCode {
public enum ClientErrorCode {

TITLE_IS_NULL(HttpStatus.BAD_REQUEST, "RP001", "제목을 입력해주세요."),
PULL_REQUEST_URL_IS_NULL(HttpStatus.BAD_REQUEST, "RP002", "PR 주소를 입력해주세요."),
Expand All @@ -11,7 +11,21 @@ public enum ClientErrorCode implements ErrorCode {
CONTENTS_OVERFLOW(HttpStatus.BAD_REQUEST, "RP005", "내용은 1000자 까지 입력해주세요."),
PAST_DEADLINE(HttpStatus.BAD_REQUEST, "RP006", "마감일은 오늘보다 과거일 수 없습니다."),
CONTENTS_NOT_FOUND(HttpStatus.NOT_FOUND, "RP007", "존재하지 않는 게시물입니다."),
TAGS_ARE_NULL(HttpStatus.BAD_REQUEST, "RP008", "태그 목록을 빈 값이라도 입력해주세요.");
TAGS_ARE_NULL(HttpStatus.BAD_REQUEST, "RP008", "태그 목록을 빈 값이라도 입력해주세요."),

REVIEW_TYPE_IS_NULL(HttpStatus.BAD_REQUEST, "FB001", "만족도를 입력해주세요."),
SUPPORTER_ID_IS_NULL(HttpStatus.BAD_REQUEST, "FB002", "서포터 식별자를 입력해주세요."),
RUNNER_ID_IS_NULL(HttpStatus.BAD_REQUEST, "FB003", "러너 식별자를 입력해주세요."),

COMPANY_IS_NULL(HttpStatus.BAD_REQUEST, "OM001", "사용자의 회사 정보를 입력해주세요."),
OAUTH_REQUEST_URL_PROVIDER_IS_WRONG(HttpStatus.UNAUTHORIZED, "OA001", "redirect 할 url 이 조회되지 않는 잘못된 소셜 타입입니다."),
OAUTH_INFORMATION_CLIENT_IS_WRONG(HttpStatus.UNAUTHORIZED, "OA002", " 소셜 계정 정보를 조회할 수 없는 잘못된 소셜 타입입니다."),
OAUTH_AUTHORIZATION_VALUE_IS_NULL(HttpStatus.UNAUTHORIZED, "OA003", "Authorization 값을 입력해주세요."),
OAUTH_AUTHORIZATION_BEARER_TYPE_NOT_FOUND(HttpStatus.UNAUTHORIZED, "OA004", "Authorization 값을 Bearer 타입으로 입력해주세요."),
JWT_SIGNATURE_IS_WRONG(HttpStatus.UNAUTHORIZED, "JW001", "시그니처가 다른 잘못된 JWT 입니다."),
JWT_FORM_IS_WRONG(HttpStatus.UNAUTHORIZED, "JW002", "잘못 생성된 JWT 로 디코딩 할 수 없습니다."),
JWT_CLAIM_IS_WRONG(HttpStatus.UNAUTHORIZED, "JW003", "JWT 에 기대한 정보를 모두 포함하고 있지 않습니다."),
JWT_CLAIM_SOCIAL_ID_IS_WRONG(HttpStatus.UNAUTHORIZED, "JW004", "사용자의 잘못된 소셜 아이디(SocialId) 정보를 가진 JWT 입니다.");

private final HttpStatus httpStatus;
private final String errorCode;
Expand All @@ -23,17 +37,14 @@ public enum ClientErrorCode implements ErrorCode {
this.message = message;
}

@Override
public HttpStatus getHttpStatus() {
return httpStatus;
}

@Override
public String getErrorCode() {
return errorCode;
}

@Override
public String getMessage() {
return message;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

public class ClientRequestException extends BaseException {

private final ClientErrorCode errorCode;

public ClientRequestException(final ClientErrorCode errorCode) {
super(errorCode);
super(errorCode.getMessage());
this.errorCode = errorCode;
}

public ClientErrorCode getErrorCode() {
return errorCode;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package touch.baton.domain.common.exception;

public abstract class DomainException extends BaseException {
public abstract class DomainException extends BaseException{

public DomainException(final ServerErrorCode errorCode) {
super(errorCode);
public DomainException(final String message) {
super(message);
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.Getter;
import touch.baton.domain.common.exception.BaseException;
import touch.baton.domain.common.exception.ClientRequestException;

@Getter
public class ErrorResponse {
Expand All @@ -14,7 +15,7 @@ private ErrorResponse(final String errorCode, final String message) {
this.message = message;
}

public static ErrorResponse from(final BaseException e) {
return new ErrorResponse(e.getErrorCode(), e.getMessage());
public static ErrorResponse from(final ClientRequestException e) {
return new ErrorResponse(e.getErrorCode().getErrorCode(), e.getMessage());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Contents(final String value) {

private void validateNotNull(final String value) {
if (Objects.isNull(value)) {
throw new IllegalArgumentException("contents null 일 수 없습니다.");
throw new IllegalArgumentException("Contents 객체 내부에 contents null 일 수 없습니다.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public TagName(final String value) {

private void validateNotNull(final String value) {
if (Objects.isNull(value)) {
throw new IllegalArgumentException("tagName 은 null 일 수 없습니다.");
throw new IllegalArgumentException("TagName 객체 내부에 tagName 은 null 일 수 없습니다.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Title(final String value) {

private void validateNotNull(final String value) {
if (Objects.isNull(value)) {
throw new IllegalArgumentException("title 은 null 일 수 없습니다.");
throw new IllegalArgumentException("Title 객체 내부에 title 은 null 일 수 없습니다.");
}
}
}
Loading

0 comments on commit a7f2793

Please sign in to comment.