-
Notifications
You must be signed in to change notification settings - Fork 1
동아리 정보 수정 API 구현(재 PR) #130
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7833d8b
feat: 동아리 생성, 상세 정보 수정 기능 구현
JanooGwan 5da8907
feat: 동아리 생성, 상세 정보 수정 기능 구현(재커밋)
JanooGwan 6e5d1ce
refactor: 동아리 상세 정보 수정 관련 메소드 이름 변경
JanooGwan 39c14c6
refactor: 기존 동아리 정보 조회를 상세 정보/프로필 정보 조회로 분리
JanooGwan 42f13ec
refactor: 동아리 프로필 수정, 동아리 상세 정보 수정 API 통합
JanooGwan 027dcc2
refactor: API 통합에 따른 불필요한 클래스 제거
JanooGwan b46ec03
refactor: 동아리 생성 관련 메소드 이름 변경
JanooGwan 45fddca
새 브랜치 생성 후 커밋 테스트
JanooGwan 97ac821
chore: 서브모듈 충돌 해결
dh2906 cd5ad5d
feat: 동아리 정보 수정과 관련 없는 클래스 삭제
JanooGwan 0ffc42a
Merge branch 'feat/CAM-174-update-club' of https://github.com/JanooGw…
JanooGwan 8a27cdf
refactor: Club - 정적 팩토리 메소드(from) 생성
JanooGwan 16966b0
chore: 코드 정렬
JanooGwan 123bd99
fix: 서브모듈 충돌 해결
JanooGwan b2cad41
refactor: Club - 정적 팩토리 메소드 네이밍 변경
JanooGwan 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
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
54 changes: 54 additions & 0 deletions
54
src/main/java/gg/agit/konect/domain/club/dto/ClubCreateRequest.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,54 @@ | ||
| package gg.agit.konect.domain.club.dto; | ||
|
|
||
| import gg.agit.konect.domain.club.enums.ClubCategory; | ||
| import gg.agit.konect.domain.club.model.Club; | ||
| import gg.agit.konect.domain.university.model.University; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Size; | ||
|
|
||
| public record ClubCreateRequest( | ||
| @Schema(description = "동아리 이름", example = "BCSD Lab", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "동아리 이름은 필수 입력입니다.") | ||
| @Size(max = 50, message = "동아리 이름은 50자 이하여야 합니다.") | ||
| String name, | ||
|
|
||
| @Schema(description = "동아리 한 줄 소개", example = "즐겁게 일하고 열심히 노는 IT 특성화 동아리", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "동아리 소개는 필수 입력입니다.") | ||
| @Size(max = 100, message = "동아리 소개는 100자 이하여야 합니다.") | ||
| String description, | ||
|
|
||
| @Schema(description = "동아리 상세 소개", example = "BCSD에서 얻을 수 있는 경험\n1. IT 실무 경험", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "상세 소개는 필수 입력입니다.") | ||
| String introduce, | ||
|
|
||
| @Schema(description = "동아리 로고 이미지 URL", example = "https://example.com/logo.png", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "이미지 URL은 필수 입력입니다.") | ||
| @Size(max = 255, message = "이미지 URL은 255자 이하여야 합니다.") | ||
| String imageUrl, | ||
|
|
||
| @Schema(description = "동아리 방 위치", example = "학생회관 101호", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "동아리 위치는 필수입니다.") | ||
| @Size(max = 255, message = "동아리 위치는 255자 이하여야 합니다.") | ||
| String location, | ||
|
|
||
| @Schema(description = "동아리 분과", example = "ACADEMIC", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotNull(message = "동아리 분과는 필수입니다.") | ||
| ClubCategory clubCategory | ||
| ) { | ||
| public Club toEntity(University university) { | ||
| return Club.builder() | ||
| .name(name) | ||
| .description(description) | ||
| .introduce(introduce) | ||
| .imageUrl(imageUrl) | ||
| .location(location) | ||
| .clubCategory(clubCategory) | ||
| .university(university) | ||
| .build(); | ||
| } | ||
| } | ||
41 changes: 41 additions & 0 deletions
41
src/main/java/gg/agit/konect/domain/club/dto/ClubUpdateRequest.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,41 @@ | ||
| package gg.agit.konect.domain.club.dto; | ||
|
|
||
| import gg.agit.konect.domain.club.enums.ClubCategory; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Size; | ||
|
|
||
| public record ClubUpdateRequest( | ||
| @Schema(description = "동아리 이름", example = "BCSD Lab", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "동아리 이름은 필수 입력입니다.") | ||
| @Size(max = 50, message = "동아리 이름은 50자 이하여야 합니다.") | ||
| String name, | ||
|
|
||
| @Schema(description = "동아리 한 줄 소개", example = "즐겁게 일하고 열심히 노는 IT 특성화 동아리", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "동아리 소개는 필수 입력입니다.") | ||
| @Size(max = 100, message = "동아리 소개는 100자 이하여야 합니다.") | ||
| String description, | ||
|
|
||
| @Schema(description = "동아리 로고 이미지 URL", example = "https://example.com/logo.png", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "이미지 URL은 필수 입력입니다.") | ||
| @Size(max = 255, message = "이미지 URL은 255자 이하여야 합니다.") | ||
| String imageUrl, | ||
|
|
||
| @Schema(description = "동아리 방 위치", example = "학생회관 101호", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "동아리 위치는 필수입니다.") | ||
| @Size(max = 255, message = "동아리 위치는 255자 이하여야 합니다.") | ||
| String location, | ||
|
|
||
| @Schema(description = "동아리 분과", example = "ACADEMIC", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotNull(message = "동아리 분과는 필수입니다.") | ||
| ClubCategory clubCategory, | ||
|
|
||
| @Schema(description = "동아리 상세 소개", example = "BCSD에서 얻을 수 있는 경험\n1. IT 실무 경험", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) | ||
| @NotBlank(message = "상세 소개는 필수 입력입니다.") | ||
| String introduce | ||
| ) { | ||
| } |
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
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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/gg/agit/konect/domain/club/repository/ClubPositionRepository.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 gg.agit.konect.domain.club.repository; | ||
|
|
||
| import org.springframework.data.repository.Repository; | ||
|
|
||
| import gg.agit.konect.domain.club.model.ClubPosition; | ||
|
|
||
| public interface ClubPositionRepository extends Repository<ClubPosition, Integer> { | ||
|
|
||
| ClubPosition save(ClubPosition clubPosition); | ||
| } | ||
|
|
||
|
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toEntity메소드보다Club엔티티에서of라는 네이밍의 정적 팩토리 메소드를 만드는건 어떻게 생각하시나요?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 깊게 고민 못해봤던 것 같습니다
조금 고민해보았는데, 말씀해주신 대로
Club에of를 만드는 것이 더 적절한 것 같습니다정적 팩토리 메소드도 생성자처럼 객체를 만들어주는 역할을 하기 때문에,
객체를 생성하는 것과 관련된 건 객체(
Club)안에 응집시키는 것이 좋을 것 같습니다. 수정하겠습니다