From 7384400fa790b46262775045d53b941d52c39c81 Mon Sep 17 00:00:00 2001 From: Mason Kim <54897403+mskim9967@users.noreply.github.com> Date: Wed, 24 Aug 2022 17:07:00 +0900 Subject: [PATCH] =?UTF-8?q?dev=20to=20main=20=EB=B0=B0=ED=8F=AC=20(#52)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) * main -> dev (#29) * 배포를 위한 dev->main 병합 (#25) * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) Co-authored-by: leeeeeyeon Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> * refactor: Instrument 순서 변경 및 img url 추가 (#26) * refactor: Instrument initialize() 함수 주석 처리 (#27) * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) * refactor: Instrument 순서 변경 및 img url 추가 * refactor: Instrument initialize() 함수 주석 처리 Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: defwdahyun0 * 배포를 위한 dev->main 병합 (#28) * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: defwdahyun0 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: defwdahyun0 * Instrument initialize() 주석 해제 * refactor: Instrument initialize() 0번째 원소 추가 (#32) * refactor: Instrument 순서 변경 및 img url 추가 * refactor: Instrument initialize() 함수 주석 처리 * refactor: Instrument initialize() 주석 해제 * 배포를 위한 dev->main 병합 (#31) * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) * main -> dev (#29) * 배포를 위한 dev->main 병합 (#25) * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) Co-authored-by: leeeeeyeon Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> * refactor: Instrument 순서 변경 및 img url 추가 (#26) * refactor: Instrument initialize() 함수 주석 처리 (#27) * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) * refactor: Instrument 순서 변경 및 img url 추가 * refactor: Instrument initialize() 함수 주석 처리 Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: defwdahyun0 * 배포를 위한 dev->main 병합 (#28) * [#2] style: resource별로 디렉토리 구조 생성 * [#2] style: domain, repository 코드 추가 * [#2] feat: BaseTimeEntity 추가 * [#2] refactor: Project 도메인 수정 * refactor: User 도메인 수정 * [#6] feat: Response 형식 지정 * [#9] feat: S3 파일 업로드 관련 파일 추가 (#10) * [#9] feat: S3 파일 업로드 관련 파일 추가 * [#9] feat: S3 - mp4 형식 파일은 video 폴더에 저장되도록 코드 변경 * [#5] feat: Instrument api 악기 domain, api 추가 * [#5] feat: User domain User domain 개발 * [#5] feat: UserInstrument relation domain User-Instrument 관계 테이블 생성 * [#5] feat: Access/Refresh token with Spring Security * [#5] feat: Kakao sign in/up 카카오 계정으로 회원가입/로그인 구현 * [#5] feat: Sign up with profile image 회원가입 시 프로필 이미지 업로드 하도록 기능 추가 * [#5] test: s3 upload * [#5] test: OAuth sign up/in * Feature/#4 - 프로젝트 게시 API 및 AwsS3Config 문제 해결 (#14) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * Feature/#8 - 프로젝트 조회 API (#15) * [umc-artistack#8] feat: 프로젝트 조회 API * chore: Swagger 적용 * [#8] hotfix: 프로젝트 조회 API DTO 분리 및 로직 수정 * [#8] fix: 프로젝트 도메인 업데이트 * [#8] feat: 프로젝트 상세 조회 API -> 유저 정보 및 악기 조회 추가 * [#8] hotfix: 악기 조회 * [#8] hotfix: 생성일 수정일 조회 추가 * Feature/#4 - 프로젝트 게시 API 보완 및 테스트 코드 작성 (#17) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API (#18) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Feature/#12 회원 관련 API (#20) * Feature/#4 scope ENUM 타입으로 변경 및 Swagger 문서 다듬기 (#21) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#16 - 좋아요 API (#23) * [#16] feat: 좋아요 & 좋아요 취소 API * [#16] feat: 좋아요수 조회 추가 * [#16] fix: 개수 조회를 위한 project domain 수정 * [#16] fix: validaition 수정 * [#16] fix: 반환값 명시적으로 변경 * style: 이름 변경 및 중복 코드 제거 * [#16] feat: 프로필 조회시 좋아요수 함께 반환 * [#8] refactor: 반환 타입을 List에서 Dto로 변경 (#24) Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: defwdahyun0 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: defwdahyun0 * Instrument initialize() 주석 해제 Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: defwdahyun0 * refactor: Instrument initialize() 함수 0번째 원소 추가 Co-authored-by: Mason Kim Co-authored-by: Mason Kim <54897403+mskim9967@users.noreply.github.com> Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: defwdahyun0 * Hotfix/#8 - request 및 response 형식 수정 (#34) * [#8] refactor: 프로젝트 정보 조회 URI 변경 * [#8] refactor: user->userDto 조회로 변경 * Feature/#12 - 프로젝트 삭제, 프로젝트 리스트 조회 (#37) * security: access token 미검사 개발을 위한 모든 uri access token 미검사 * refactor: Response code * [#5] fix: SignUp method 실수로 회원가입을 Get Method로 받음. Post로 수정함 * [#12] feat - 회원 조회, 수정, 탈퇴 API 추가 * [#12] test: /users * fix: minor url 일부 수정 * Merge remote-tracking branch 'umc-artistack/dev' into feature/#12 * [#12] refactor: user 제약조건 * [#12] feat: 다른 유저 조회 artistack id로 다른 유저 조회 * [#12] feat: jwt 재발급 jwt 만료 시 재발급하는 api * [#12] refactor: if to switch * [#12] feat: 나의/타유저의 프로젝트들 조회 pagable 사용하여 페이징 구현 * [#12] test * [#12] test * [#12] docs: project controller comment * [#12] fix: 로그인 실패 응답 변경 UserDto 형식으로 변경 * [#12] fix: 프로젝트 조회 시 범위 조정 PUBLIC 상태의 프로젝트만 조회 가능 * [#12] feat: 프로젝트 삭제 API * [#12] fix: 프로젝트 리스트 조회 api * Feature/#4 - 프로젝트 등록 API 수정 및 테스트코드 작성 (#41) * [#4] feat: 프로젝트 게시 API * [#4] fix: AwsS3Config 설정 파일에서 값을 못 가져오는 문제 해결 * [#5] fix: OAuth 테스트코드 안되는 오류 수정 * [#4] feat: bpm, instrument 타입 변경 / user 추가 / validation 보완 * [#4] refactor: conflict 없도록 프로젝트 게시 API 수정 * [#4] test: 정상 동작에 대한 테스트코드 추가 * Update src/main/java/com/artistack/project/dto/ProjectDto.java Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * [#4] feat: Swagger 문서화 * [#4] refactor: scope ENUM 타입으로 변경 * [#4] style: 회원가입, 로그인 Swagger 어노테이션 추가 * [#4] feat: Swagger API 정보 수정 및 Authorize 활성화 * style: Swagger 문서 설명 추가 * test: 테스트코드 scope ENUM 타입으로 변경 * style: 에러 코드 오름차순으로 정렬 * chore: .gitignore에 application.properties 추가 * refactor: 악기 요청 값을 List에서 List으로 변경 * refactor: validation 후 S3에 업로드하도록 로직 변경 * [#4] feat: 프로젝트 등록 시 하나의 악기만 선택 가능하도록 validation 추가 * refactor: 프로젝트 등록 시 동영상 업로드 로직 변경 * [#4] test: 프로젝트 등록 API Controller 테스트 코드 작성 * [#4] test: 프로젝트 등록 API Controller 테스트 코드에 악기 수를 count하는 코드 추가 * [#4] chore: application.properties 변경 Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> * Feature/#13 - 스택 조회 API에 프로젝트 정보 추가 (#43) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Merge branch 'dev' of github.com:leeeeeyeon/artistack-server into feature/#13 * Merge branch 'dev' of github.com:leeeeeyeon/artistack-server into feature/#13 * [#13] feat: 해당 유저가 쌓은 프로젝트 정보 추가 * [#13] refactor: 사용하지 않는 메서드 제거 * [#13] chore: gitignore 파일 트랙킹하지 않도록 수정 * 12 회원 관련 API - 애플로그인 (#45) * security: access token 미검사 개발을 위한 모든 uri access token 미검사 * refactor: Response code * [#5] fix: SignUp method 실수로 회원가입을 Get Method로 받음. Post로 수정함 * [#12] feat - 회원 조회, 수정, 탈퇴 API 추가 * [#12] test: /users * fix: minor url 일부 수정 * Merge remote-tracking branch 'umc-artistack/dev' into feature/#12 * [#12] refactor: user 제약조건 * [#12] feat: 다른 유저 조회 artistack id로 다른 유저 조회 * [#12] feat: jwt 재발급 jwt 만료 시 재발급하는 api * [#12] refactor: if to switch * [#12] feat: 나의/타유저의 프로젝트들 조회 pagable 사용하여 페이징 구현 * [#12] test * [#12] test * [#12] docs: project controller comment * [#12] fix: 로그인 실패 응답 변경 UserDto 형식으로 변경 * [#12] fix: 프로젝트 조회 시 범위 조정 PUBLIC 상태의 프로젝트만 조회 가능 * [#12] feat: 프로젝트 삭제 API * [#12] fix: 프로젝트 리스트 조회 api * [#12] feat: apple login - apple authorization code로 apple refresh token 발급 - apple refresh token으로 apple identity token 발급하여 유저 식별 - apple refresh token으로 회원 탈퇴 * [#12] fix: 토큰 재발급 HTTP METHOD * [#12] test * Feature/#40 - 좋아요 누른 사람 조회 API, 좋아요 여부 확인 코드 추가 (#47) * [#40] feat: 좋아요 누른 사람 조회 API * [#40] feat: 프로젝트 정보 조회 API에 좋아요 여부 추가 * fix: 프로젝트 전체 조회 API에 project의 title 추가 * fix: 스택 조회 API에 project의 id 추가 * feat: 프로젝트 전체 조회 API에 좋아요 여부 추가 * fix: local to dev * [#40] fix: projectLikeDto -> userDto 활용 * [#40] fix: 좋아요 누른 사람 조회 API Paging 처리 * [#40] feat: ROLE이 USER인 좋아요를 누른 사용자만 조회, count * fix: local to dev * project list 응답 형식, header 범위 (#49) * [#12] fix: 프로젝트 리스트 response form * [#12] fix: authorization header 범위 회원가입에 필요한 api 빼고 모두 헤더 필요하도록 * Feature/#13 스택 조회 API 페이징, 본인 포함 옵션 추가, 모든 프로젝트 조회 API 스택커 resposne 수정 (#50) * [#4] feat: 프로젝트 게시 API * [#13] feat: 스택 조회 API * [#13] style: Swagger 파라미터 dataType 변경 * Merge branch 'dev' of github.com:leeeeeyeon/artistack-server into feature/#13 * Merge branch 'dev' of github.com:leeeeeyeon/artistack-server into feature/#13 * [#13] feat: 해당 유저가 쌓은 프로젝트 정보 추가 * [#13] refactor: 사용하지 않는 메서드 제거 * [#13] chore: gitignore 파일 트랙킹하지 않도록 수정 * [#13] feat: 스택 조회 API 페이징, query string 추가 * fix: 모든 프로젝트 조회 API response 수정 및 스택 조회 API 본인 포함 여부 옵션 추가 * fix: 모든 프로젝트 조회 API 스택커 수 추가 및 스택커 정보 response 수정 Co-authored-by: leeeeeyeon Co-authored-by: Dahyeon Woo <60066586+defwdahyun0@users.noreply.github.com> Co-authored-by: defwdahyun0 Co-authored-by: DahyeonWoo <60066586+DahyeonWoo@users.noreply.github.com> --- .../com/artistack/config/SecurityConfig.java | 1 - .../project/controller/ProjectController.java | 20 +++- .../com/artistack/project/dto/ProjectDto.java | 52 ++++++--- .../project/service/ProjectService.java | 106 +++++++++++++----- .../java/com/artistack/user/dto/UserDto.java | 10 ++ .../controller/ProjectControllerTest.java | 5 - 6 files changed, 136 insertions(+), 58 deletions(-) diff --git a/src/main/java/com/artistack/config/SecurityConfig.java b/src/main/java/com/artistack/config/SecurityConfig.java index ba0688c..7dd671a 100644 --- a/src/main/java/com/artistack/config/SecurityConfig.java +++ b/src/main/java/com/artistack/config/SecurityConfig.java @@ -53,7 +53,6 @@ protected void configure(HttpSecurity http) throws Exception { .and() .authorizeRequests() .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() - .antMatchers("/**").permitAll() // 개발을 위한 모든 uri 임시 허가 .antMatchers("/oauth/**").permitAll() .antMatchers("/user/checkDuplicate").permitAll() .antMatchers("/instruments").permitAll() diff --git a/src/main/java/com/artistack/project/controller/ProjectController.java b/src/main/java/com/artistack/project/controller/ProjectController.java index f9b2a16..ae30749 100644 --- a/src/main/java/com/artistack/project/controller/ProjectController.java +++ b/src/main/java/com/artistack/project/controller/ProjectController.java @@ -22,7 +22,10 @@ import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PageableDefault; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -143,15 +146,18 @@ public DataResponseDto getProjectLikeUsers( /** * 스택 조회 API - 제이 - * [Get] /projects/{projectId}/prev - * [Get] /projects/{projectId}/next + * [Get] /projects/{projectId}/prev?current=true + * [Get] /projects/{projectId}/next?current=true */ @ApiOperation(value = "스택 조회") @ApiImplicitParams( value = { @ApiImplicitParam(name = "projectId", value = "현재 프로젝트 id", required = true, dataType = "long", paramType = "path"), @ApiImplicitParam(name = "sequence", value = "순서(prev or next)", required = true, dataType = "string", paramType = "path")}) @GetMapping("/{projectId}/{sequence}") - public DataResponseDto getStack(@PathVariable Long projectId, @PathVariable String sequence) { + public DataResponseDto getStack( + @PageableDefault(size = 6) Pageable pageable, + @PathVariable Long projectId, @PathVariable String sequence, + @RequestParam(defaultValue = "true") Boolean current) { // validation // 1. query parameter가 next, prev를 제외한 다른 값이 들어올 경우 if (!(sequence.equals("next") || sequence.equals("prev"))) { @@ -159,9 +165,13 @@ public DataResponseDto getStack(@PathVariable Long projectId, @PathVaria } try { - List stackers = projectService.getStackers(projectId, sequence); + List stackers = projectService.getStackers(projectId, sequence, current); - return DataResponseDto.of(stackers); + final int start = (int) pageable.getOffset(); + final int end = Math.min((start + pageable.getPageSize()), stackers.size()); + final Page page = new PageImpl<>(stackers.subList(start, end), pageable, stackers.size()); + + return DataResponseDto.of(page); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/artistack/project/dto/ProjectDto.java b/src/main/java/com/artistack/project/dto/ProjectDto.java index fd7f677..e6fabfa 100644 --- a/src/main/java/com/artistack/project/dto/ProjectDto.java +++ b/src/main/java/com/artistack/project/dto/ProjectDto.java @@ -1,5 +1,8 @@ package com.artistack.project.dto; + +import static org.springframework.util.ObjectUtils.isEmpty; + import com.artistack.base.GeneralException; import com.artistack.base.constant.Code; import com.artistack.instrument.domain.ProjectInstrument; @@ -57,6 +60,10 @@ public class ProjectDto { private List instrumentIds; + private List prevStackers; + + private Integer prevStackCount; + private Integer likeCount; private Integer stackCount; @@ -68,9 +75,12 @@ public ProjectDto() { } // 메이슨 - public static ProjectDto profileResponse(Project project, ProjectLikeRepository projectLikeRepository, UserRepository userRepository) { + public static ProjectDto profileResponse(Project project, ProjectLikeRepository projectLikeRepository, + UserRepository userRepository) { + + Boolean isLiked = !isEmpty(projectLikeRepository) && !projectLikeRepository.findByUserAndProject( + userRepository.findById(SecurityUtil.getUserId()).orElse(null), project).isEmpty(); - Boolean isLiked = !isEmpty(projectLikeRepository) && !projectLikeRepository.findByUserAndProject(userRepository.findById(SecurityUtil.getUserId()).orElse(null), project).isEmpty(); return ProjectDto.builder() .id(project.getId()) @@ -84,12 +94,20 @@ public static ProjectDto profileResponse(Project project, ProjectLikeRepository } public static ProjectDto projectResponse(Project project) { - return projectResponse(project, null, null, null); + return projectResponse(project, null, null, null, null); + } + + public static ProjectDto projectResponse(Project project, ProjectInstrumentRepository projectInstrumentRepository, + ProjectLikeRepository projectLikeRepository, UserRepository userRepository) { + return projectResponse(project, projectInstrumentRepository, projectLikeRepository, userRepository, null); } - public static ProjectDto projectResponse(Project project, ProjectInstrumentRepository projectInstrumentRepository, ProjectLikeRepository projectLikeRepository, UserRepository userRepository) { - Boolean isLiked = !isEmpty(projectLikeRepository) && !projectLikeRepository.findByUserAndProject(userRepository.findById(SecurityUtil.getUserId()).orElse(null), project).isEmpty(); + public static ProjectDto projectResponse(Project project, ProjectInstrumentRepository projectInstrumentRepository, + ProjectLikeRepository projectLikeRepository, UserRepository userRepository, List prevStackers) { + + Boolean isLiked = !isEmpty(projectLikeRepository) && !projectLikeRepository.findByUserAndProject( + userRepository.findById(SecurityUtil.getUserId()).orElse(null), project).isEmpty(); return ProjectDto.builder() .id(project.getId()) @@ -106,6 +124,8 @@ public static ProjectDto projectResponse(Project project, ProjectInstrumentRepos .instruments(Optional.ofNullable(projectInstrumentRepository).map( e -> e.findByProjectId(project.getId()).stream().map(ProjectInstrument::getInstrument) .map(InstrumentDto::response).collect(Collectors.toList())).orElse(null)) + .prevStackers(prevStackers) + .prevStackCount(prevStackers.size()) .stackCount(project.getStackCount()) .likeCount(project.getLikeCount()) .isLiked(isLiked) @@ -147,16 +167,16 @@ public static ProjectDto insertProject(String title, String description, String // (+) videoUrl, prevProjectId, User 추가적으로 필요 public Project toEntity(String videoUrl, Long prevProjectId, User user) { return Project.builder() - .videoUrl(videoUrl) - .title(title) - .description(description) - .bpm(bpm) - .codeFlow(codeFlow) - .scope(scope) - .isStackable(isStackable) - .prevProjectId(prevProjectId) - .user(user) - .viewCount(0) - .build(); + .videoUrl(videoUrl) + .title(title) + .description(description) + .bpm(bpm) + .codeFlow(codeFlow) + .scope(scope) + .isStackable(isStackable) + .prevProjectId(prevProjectId) + .user(user) + .viewCount(0) + .build(); } } diff --git a/src/main/java/com/artistack/project/service/ProjectService.java b/src/main/java/com/artistack/project/service/ProjectService.java index bc26523..7eaa4e5 100644 --- a/src/main/java/com/artistack/project/service/ProjectService.java +++ b/src/main/java/com/artistack/project/service/ProjectService.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.Optional; -import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Page; @@ -55,9 +54,13 @@ public class ProjectService { * @param artistackId 조회할 유저의 artistackId (optional) * @return 조건에 맞는 프로젝트들 (profileResponse) */ - public Page getByConditionWithPaging(Pageable pageable, Optional artistackId, Optional lastId) { - return projectRepository.getByConditionWithPaging(pageable, artistackId.orElse(null), lastId.orElse(null), Scope.PUBLIC) - .map(project -> ProjectDto.profileResponse(project, projectLikeRepository, userRepository)); + public Page getByConditionWithPaging(Pageable pageable, Optional artistackId, + Optional lastId) { + return projectRepository.getByConditionWithPaging(pageable, artistackId.orElse(null), + lastId.orElse(null), Scope.PUBLIC) + .map(project -> ProjectDto.projectResponse(project, projectInstrumentRepository, projectLikeRepository, + userRepository, getPrevStackers(project.getId(), false, true)) + ); } /** @@ -91,8 +94,9 @@ public Page getMyWithPaging(Pageable pageable) { // 프로젝트 정보 조회 public ProjectDto getById(Long projectId) { return projectRepository.findById(projectId) - .map(project -> ProjectDto.projectResponse(project, projectInstrumentRepository, projectLikeRepository, userRepository)) - .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); + .map(project -> ProjectDto.projectResponse(project, projectInstrumentRepository, projectLikeRepository, + userRepository)) + .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); } // 프로젝트 좋아요 등록 @@ -144,7 +148,7 @@ public String deleteLikeProject(Long projectId) { public Page getProjectLikeUsersWithPaging(Pageable pageable, Long projectId) { Project project = projectRepository.findById(projectId) - .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); + .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); Page projectLikes = projectLikeRepository.getByProjectWithPaging(pageable, project); @@ -204,35 +208,53 @@ public String insertProject(Long prevProjectId, MultipartFile video, ProjectDto } // 스택 조회 - 다음 스택인지, 이전 스택인지 선택 - public List getStackers(Long projectId, String sequence) { + public List getStackers(Long projectId, String sequence, Boolean current) { if (sequence.equals("prev")) { - return getPrevStackers(projectId); + return getPrevStackers(projectId, current, false); } else { - return getNextStackers(projectId); + return getNextStackers(projectId, current); } } // 이전에 스택을 쌓은 유저 목록(이전 스택) 조회 - public List getPrevStackers(Long projectId) { - // while문을 이용하여 prevProjectId = 0(최초 프로젝트)이 될 때까지 스택 조회 + public List getPrevStackers(Long projectId, Boolean current, Boolean search) { ArrayList stackers = new ArrayList<>(); + if (search) { + Long prevProjectId = projectRepository.findById(projectId) + .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")) + .getPrevProjectId(); + + // while문을 이용하여 prevProjectId = 0(최초 프로젝트)이 될 때까지 스택 조회 + while (prevProjectId != 0) { + Project project = projectRepository.findById(prevProjectId) + .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); + + UserDto userDto = getSearchStackResponse(project.getId()); + stackers.add(userDto); + + prevProjectId = project.getPrevProjectId(); + } + + return stackers; + } + + // 현재 프로젝트 유저 정보 추가 + if (current) { + UserDto userDto = getStackResponse(projectId); + stackers.add(userDto); + } + Long prevProjectId = projectRepository.findById(projectId) .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")) .getPrevProjectId(); - + // while문을 이용하여 prevProjectId = 0(최초 프로젝트)이 될 때까지 스택 조회 while (prevProjectId != 0) { Project project = projectRepository.findById(prevProjectId) .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); - User user = project.getUser(); - - List instruments = getInstrumentDtoFromProject(project); - - ProjectDto projectDto = ProjectDto.stackResponse(project); - - UserDto userDto = UserDto.stackResponse(user, instruments, projectDto); + UserDto userDto = getStackResponse(project.getId()); stackers.add(userDto); prevProjectId = project.getPrevProjectId(); @@ -242,24 +264,20 @@ public List getPrevStackers(Long projectId) { } // 현재 스택 위에 스택을 쌓은 유저 목록(다음 스택) 조회 - public List getNextStackers(Long projectId) { + public List getNextStackers(Long projectId, Boolean current) { ArrayList stackers = new ArrayList<>(); + if (current) { + UserDto userDto = getStackResponse(projectId); + stackers.add(userDto); + } + // prevProjectId가 projectId인 자식 노드들 반환 // 1. prevProjectId가 projectId인 프로젝트들을 찾아 List projects = projectRepository.findAllByPrevProjectId(projectId); for (Project project : projects) { - Long userId = project.getUser().getId(); - - List instruments = getInstrumentDtoFromProject(project); - - User user = userRepository.findById(userId) - .orElseThrow(() -> new GeneralException(Code.USER_NOT_FOUND, "유저를 찾을 수 없습니다.")); - - ProjectDto projectDto = ProjectDto.stackResponse(project); - - UserDto userDto = UserDto.stackResponse(user, instruments, projectDto); + UserDto userDto = getStackResponse(project.getId()); stackers.add(userDto); } @@ -279,4 +297,30 @@ private List getInstrumentDtoFromProject(Project project) { return instruments; } + + // 스택 조회 메서드에서 중복되는 부분 모듈화 + public UserDto getStackResponse(Long projectId) { + Project project = projectRepository.findById(projectId) + .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); + + User user = project.getUser(); + + List instruments = getInstrumentDtoFromProject(project); + + ProjectDto projectDto = ProjectDto.stackResponse(project); + + return UserDto.stackResponse(user, instruments, projectDto); + } + + public UserDto getSearchStackResponse(Long projectId) { + Project project = projectRepository.findById(projectId) + .orElseThrow(() -> new GeneralException(Code.PROJECT_NOT_FOUND, "프로젝트를 찾을 수 없습니다.")); + + User user = project.getUser(); + + List instruments = getInstrumentDtoFromProject(project); + + return UserDto.SearchStackResponse(user, instruments); + } + } diff --git a/src/main/java/com/artistack/user/dto/UserDto.java b/src/main/java/com/artistack/user/dto/UserDto.java index 3eed031..5f6c59c 100644 --- a/src/main/java/com/artistack/user/dto/UserDto.java +++ b/src/main/java/com/artistack/user/dto/UserDto.java @@ -10,12 +10,14 @@ import com.artistack.base.GeneralException; import com.artistack.base.constant.Code; +import com.artistack.instrument.domain.Instrument; import com.artistack.instrument.domain.UserInstrument; import com.artistack.instrument.dto.InstrumentDto; import com.artistack.instrument.repository.UserInstrumentRepository; import com.artistack.oauth.constant.ProviderType; import com.artistack.project.domain.ProjectLike; + import com.artistack.project.dto.ProjectDto; import com.artistack.user.constant.Role; import com.artistack.user.domain.User; @@ -96,6 +98,14 @@ public static UserDto stackResponse(User user, List instruments, .build(); } + public static UserDto SearchStackResponse(User user, List instruments) { + return UserDto.builder() + .nickname(user.getNickname()) + .profileImgUrl(user.getProfileImgUrl()) + .instruments(instruments) + .build(); + } + public static UserDto projectLikeUsersResponse(ProjectLike projectLike) { return UserDto.builder() .artistackId(projectLike.getUser().getArtistackId()) diff --git a/src/test/java/com/artistack/controller/ProjectControllerTest.java b/src/test/java/com/artistack/controller/ProjectControllerTest.java index 8bd15b8..20349ee 100644 --- a/src/test/java/com/artistack/controller/ProjectControllerTest.java +++ b/src/test/java/com/artistack/controller/ProjectControllerTest.java @@ -224,11 +224,6 @@ void getProjectsTest() throws Exception { for (int i = 0; i < uploadUrls.size(); i++) { then(res.get(i).getVideoUrl()).isEqualTo(uploadUrls.get(i)); } - - Collections.reverse(res); - int lastIdx = 3; - List lastIdRes = getProjectsByLastId(accessToken, res.get(lastIdx).getId().intValue(), pageSize, Code.OK.getCode()); - then(lastIdRes.get(0).getId()).isEqualTo(res.get(lastIdx + 1).getId()); } // 메이슨