-
Notifications
You must be signed in to change notification settings - Fork 0
Feat : 어드민 동아리 업로드 API 구현 #353
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
Closed
Closed
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
7a2bc28
feat : club icon_image_path 컬럼 마이그레이션 추가
rlagkswn00 64de3e3
feat : 동아리 생성 성공 응답 코드 추가
rlagkswn00 c952f0b
feat : 동아리 중복 생성 에러 코드 추가
rlagkswn00 ed432da
feat : 어드민 동아리 생성 요청 DTO 확장
rlagkswn00 8c2a32a
feat : 어드민 동아리 생성 응답 DTO 추가
rlagkswn00 e5e82e2
feat : 어드민 동아리 생성 API 추가
rlagkswn00 ec908cb
feat : 동아리 생성 유스케이스 인터페이스 추가
rlagkswn00 0723951
feat : 동아리 생성 커맨드 정의 추가
rlagkswn00 9e5c9ec
feat : 동아리 생성 CommandPort 메서드 추가
rlagkswn00 9c060dd
feat : 동아리 생성 이벤트 포트 확장
rlagkswn00 dcf603a
feat : 동아리 중복 조회 포트 메서드 추가
rlagkswn00 db5c4f1
feat : 동아리 이름 소속 중복 조회 리포지토리 메서드 추가
rlagkswn00 e2d3d48
feat : ClubSns JPA Repository 구현 추가
rlagkswn00 1630111
feat : 동아리 생성 중복체크 persistence 구현 추가
rlagkswn00 60b4628
feat : 동아리 생성 필드 및 생성자 확장
rlagkswn00 82b7da5
feat : 동아리 카테고리 한글 매핑 지원 추가
rlagkswn00 baa6e94
feat : 동아리 소속 한글 매핑 지원 추가
rlagkswn00 4506e35
feat : 동아리 SNS URL 도메인 객체 매핑 추가
rlagkswn00 adf5728
feat : SNS URL 기반 타입 판별 로직 추가
rlagkswn00 c785833
feat : 스토리지 업로드 유스케이스 인터페이스 정의
rlagkswn00 b35f837
feat : 다중 파일 업로드 커맨드 모델 추가
rlagkswn00 2c13cf3
feat : 단일 이미지 업로드 커맨드 모델 추가
rlagkswn00 73455d0
feat : 이미지 삭제 이벤트 모델 확장
rlagkswn00 8ae5787
feat : 동아리 생성 이미지 업로드 이벤트 구현
rlagkswn00 ba010c6
feat : 동아리 생성 후 이미지 업로드 이벤트 리스너 추가
rlagkswn00 a383b0d
feat : 동아리 생성 이벤트 발행 어댑터 구현
rlagkswn00 aea95d5
fix : 파일 스트림 업로드 처리 및 예외 로깅 보강
rlagkswn00 98b746c
feat : 동아리 생성 서비스 로직 및 검증 구현
rlagkswn00 f882cb8
test : 어드민 동아리 생성 요청 응답 스텝 추가
rlagkswn00 d44ef89
test : 어드민 동아리 정보 업로드 인수테스트 추가
rlagkswn00 e358f08
test : ClubCategory 변환 테스트 정리
rlagkswn00 dfeca2c
test : ClubDivision 변환 테스트 정리
rlagkswn00 14eb28f
fix : 스토리지 Mock 어댑터 프로필 설정 조정
rlagkswn00 3181c99
fix : 스토리지 S3 어댑터 프로필 설정 조정
rlagkswn00 5eca5f4
refactor : logoImage를 iconImage 이름 통일
rlagkswn00 de5ca50
fix : posterImage Null 분기 처리
rlagkswn00 5a5a0c9
fix : 주석처리 해놓은 어노테이션 제거
rlagkswn00 2800922
refactor : 동아리 등록 API 파라미터명 변경
rlagkswn00 c319b56
fix : 이벤트 생성 간 path 중복 사용 해결
rlagkswn00 c32f062
remove : 불필요 파일 제거
rlagkswn00 bb6a1b8
remove : 미사용 파일 제거
rlagkswn00 eb7b40b
fix : reference type 대신 primitive type 사용하도록 수정
rlagkswn00 9d517ad
fix : ClubSnsType 매핑 과정 구체화 및 예외 케이스 처리
rlagkswn00 aca5447
test : ClubSnsType 도메인 테스트 추가
rlagkswn00 5eced2e
fix : ClubSnsType NPE 예외 처리
rlagkswn00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/com/kustacks/kuring/admin/adapter/in/web/dto/AdminClubCreateRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package com.kustacks.kuring.admin.adapter.in.web.dto; | ||
|
|
||
| import com.kustacks.kuring.club.application.port.in.dto.AdminClubCreateCommand; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Size; | ||
| import org.springframework.web.multipart.MultipartFile; | ||
|
|
||
| public record AdminClubCreateRequest( | ||
| @NotBlank @Size(max = 30) String name, | ||
| @NotBlank @Size(max = 30) String summary, | ||
| String description, | ||
| @NotBlank String category, | ||
| @NotBlank String division, | ||
| @NotNull Boolean isAlways, | ||
| String recruitStartAt, | ||
| String recruitEndAt, | ||
| @Size(max = 255) String applyUrl, | ||
| String qualifications, | ||
| String instagramUrl, | ||
| String youtubeUrl, | ||
| String etcUrl, | ||
| @Size(max = 30) String building, | ||
| @Size(max = 30) String room, | ||
| Double lat, | ||
| Double lon | ||
| ) { | ||
| public AdminClubCreateCommand toCommand(MultipartFile iconImage, MultipartFile posterImage) { | ||
| return new AdminClubCreateCommand( | ||
| name, | ||
| summary, | ||
| description, | ||
| category, | ||
| division, | ||
| isAlways, | ||
| recruitStartAt, | ||
| recruitEndAt, | ||
| applyUrl, | ||
| qualifications, | ||
| instagramUrl, | ||
| youtubeUrl, | ||
| etcUrl, | ||
| building, | ||
| room, | ||
| lat, | ||
| lon, | ||
| iconImage, | ||
| posterImage | ||
| ); | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/kustacks/kuring/admin/adapter/in/web/dto/AdminClubCreateResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package com.kustacks.kuring.admin.adapter.in.web.dto; | ||
|
|
||
| public record AdminClubCreateResponse( | ||
| Long clubId | ||
| ) { | ||
| } |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/kustacks/kuring/admin/adapter/out/event/ClubEventAdapter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package com.kustacks.kuring.admin.adapter.out.event; | ||
|
|
||
| import com.kustacks.kuring.club.application.port.out.ClubEventPort; | ||
| import com.kustacks.kuring.common.domain.Events; | ||
| import com.kustacks.kuring.common.exception.InvalidStateException; | ||
| import com.kustacks.kuring.common.exception.code.ErrorCode; | ||
| import com.kustacks.kuring.storage.adapter.in.event.dto.ClubCreateEvent; | ||
| import com.kustacks.kuring.storage.adapter.in.event.dto.ClubCreateEvent.ClubCreateImage; | ||
| import org.springframework.stereotype.Component; | ||
| import org.springframework.web.multipart.MultipartFile; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| @Component | ||
| public class ClubEventAdapter implements ClubEventPort { | ||
|
|
||
| @Override | ||
| public void publishClubCreate(Long clubId, MultipartFile iconImage, MultipartFile posterImage, String iconImagePath, String posterImagePath) { | ||
| try { | ||
| ClubCreateImage icon = new ClubCreateImage(iconImagePath, iconImage); | ||
|
|
||
| if (posterImage != null) { | ||
| ClubCreateImage poster = new ClubCreateImage(posterImagePath, posterImage); | ||
| Events.raise(new ClubCreateEvent(clubId, icon, poster)); | ||
| } else { | ||
| Events.raise(new ClubCreateEvent(clubId, icon, null)); | ||
| } | ||
|
|
||
| } catch (IOException e) { | ||
| throw new InvalidStateException(ErrorCode.FILE_IO_EXCEPTION); | ||
rlagkswn00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/main/java/com/kustacks/kuring/club/adapter/out/persistence/ClubRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| package com.kustacks.kuring.club.adapter.out.persistence; | ||
|
|
||
| import com.kustacks.kuring.club.domain.Club; | ||
| import com.kustacks.kuring.club.domain.ClubDivision; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| interface ClubRepository extends JpaRepository<Club, Long>, ClubQueryRepository { | ||
| boolean existsByNameAndDivision(String name, ClubDivision division); | ||
| } |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/kustacks/kuring/club/adapter/out/persistence/ClubSnsRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.kustacks.kuring.club.adapter.out.persistence; | ||
|
|
||
| import com.kustacks.kuring.club.domain.ClubSns; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| public interface ClubSnsRepository extends JpaRepository<ClubSns, Long> { | ||
| } |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/kustacks/kuring/club/application/port/in/ClubCreateAdminUseCase.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.kustacks.kuring.club.application.port.in; | ||
|
|
||
| import com.kustacks.kuring.club.application.port.in.dto.AdminClubCreateCommand; | ||
|
|
||
| public interface ClubCreateAdminUseCase { | ||
| void createClub(AdminClubCreateCommand command); | ||
rlagkswn00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
26 changes: 26 additions & 0 deletions
26
src/main/java/com/kustacks/kuring/club/application/port/in/dto/AdminClubCreateCommand.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package com.kustacks.kuring.club.application.port.in.dto; | ||
|
|
||
| import org.springframework.web.multipart.MultipartFile; | ||
|
|
||
| public record AdminClubCreateCommand( | ||
| String name, | ||
| String summary, | ||
| String description, | ||
| String category, | ||
| String division, | ||
| boolean isAlways, | ||
| String recruitStartAt, | ||
| String recruitEndAt, | ||
| String applyUrl, | ||
| String qualifications, | ||
| String instagramUrl, | ||
| String youtubeUrl, | ||
| String etcUrl, | ||
| String building, | ||
| String room, | ||
| Double lat, | ||
| Double lon, | ||
| MultipartFile iconImage, | ||
| MultipartFile posterImage | ||
| ) { | ||
| } |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/kustacks/kuring/club/application/port/out/ClubCommandPort.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.kustacks.kuring.club.application.port.out; | ||
|
|
||
| import com.kustacks.kuring.club.domain.Club; | ||
| import com.kustacks.kuring.club.domain.ClubSns; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public interface ClubCommandPort { | ||
| Club save(Club club); | ||
|
|
||
| void saveAll(List<ClubSns> toSave); | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
7 changes: 7 additions & 0 deletions
7
src/main/java/com/kustacks/kuring/club/application/port/out/ClubEventPort.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.kustacks.kuring.club.application.port.out; | ||
|
|
||
| import org.springframework.web.multipart.MultipartFile; | ||
|
|
||
| public interface ClubEventPort { | ||
| void publishClubCreate(Long clubId, MultipartFile iconImage, MultipartFile posterImage, String iconImagePath, String posterImagePath); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.