-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from TEAM-YOAJUNG/feature/club-service-update…
…-api [FEAT] 동아리 관련 수정 API 추가
- Loading branch information
Showing
11 changed files
with
359 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
33 changes: 33 additions & 0 deletions
33
club-service/src/main/java/club/gach_dong/dto/request/UpdateClubActivityRequest.java
This file contains 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 club.gach_dong.dto.request; | ||
|
||
import club.gach_dong.domain.Activity; | ||
import club.gach_dong.domain.ContactInfo; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDate; | ||
|
||
public record UpdateClubActivityRequest( | ||
@Schema(description = "동아리 ID", example = "1") | ||
@NotNull | ||
Long clubId, | ||
|
||
@Schema(description = "활동 ID", example = "1") | ||
@NotNull | ||
Long activityId, | ||
|
||
@Schema(description = "활동 제목", example = "가츠동 축구 동아리 첫 모임") | ||
@NotNull | ||
String title, | ||
|
||
@Schema(description = "활동 설명", example = "가츠동 축구 동아리 첫 모임입니다.") | ||
@NotNull | ||
String description, | ||
|
||
@Schema(description = "활동 날짜", example = "2023-08-31") | ||
@NotNull | ||
LocalDate date | ||
) implements ClubIdentifiable { | ||
public void updateToEntity(Activity activity) { | ||
activity.update(title, description, date); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
club-service/src/main/java/club/gach_dong/dto/request/UpdateClubRequest.java
This file contains 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,39 @@ | ||
package club.gach_dong.dto.request; | ||
|
||
import club.gach_dong.domain.Club; | ||
import club.gach_dong.domain.ClubCategory; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDateTime; | ||
|
||
public record UpdateClubRequest( | ||
@Schema(description = "동아리 ID", example = "1") | ||
@NotNull | ||
Long clubId, | ||
|
||
@Schema(description = "동아리 이름", example = "가츠동") | ||
@NotBlank | ||
String name, | ||
|
||
@Schema(description = "동아리 카테고리", example = "SPORTS") | ||
@NotNull | ||
ClubCategory category, | ||
|
||
@Schema(description = "동아리 한줄 설명", example = "가츠동은 최고의 동아리입니다.") | ||
@NotBlank | ||
String shortDescription, | ||
|
||
@Schema(description = "동아리 소개", example = "<h1>가츠동</h1> <p>최고의 동아리입니다</p>") | ||
String introduction, | ||
|
||
@Schema(description = "동아리 이미지 URL", example = "http://example.com/image.png") | ||
String clubImageUrl, | ||
|
||
@Schema(description = "동아리 설립일", example = "2023-01-01T00:00:00") | ||
LocalDateTime establishedAt | ||
) implements ClubIdentifiable { | ||
public void updateToEntity(Club club) { | ||
club.update(clubId, name, category, shortDescription, introduction, clubImageUrl, establishedAt); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
club-service/src/main/java/club/gach_dong/dto/request/UpdateContactInfoRequest.java
This file contains 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,28 @@ | ||
package club.gach_dong.dto.request; | ||
|
||
import club.gach_dong.domain.Club; | ||
import club.gach_dong.domain.ContactInfo; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
public record UpdateContactInfoRequest( | ||
@Schema(description = "동아리 ID", example = "1") | ||
@NotNull | ||
Long clubId, | ||
|
||
@Schema(description = "연락처 ID", example = "1") | ||
@NotNull | ||
Long contactInfoId, | ||
|
||
@Schema(description = "연락처 유형", example = "전화번호") | ||
@NotNull | ||
String type, | ||
|
||
@Schema(description = "연락처", example = "010-1234-5678") | ||
@NotNull | ||
String contact | ||
) implements ClubIdentifiable { | ||
public void updateToEntity(ContactInfo contactInfo) { | ||
contactInfo.update(type, contact); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
club-service/src/main/java/club/gach_dong/dto/response/UpdateClubActivityResponse.java
This file contains 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,38 @@ | ||
package club.gach_dong.dto.response; | ||
|
||
import club.gach_dong.domain.Activity; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDate; | ||
|
||
public record UpdateClubActivityResponse( | ||
@Schema(description = "동아리 ID", example = "1") | ||
@NotNull | ||
Long clubId, | ||
|
||
@Schema(description = "활동 ID", example = "1") | ||
@NotNull | ||
Long activityId, | ||
|
||
@Schema(description = "활동 제목", example = "가츠동 축구 동아리 첫 모임") | ||
@NotNull | ||
String title, | ||
|
||
@Schema(description = "활동 설명", example = "가츠동 축구 동아리 첫 모임입니다.") | ||
@NotNull | ||
String description, | ||
|
||
@Schema(description = "활동 날짜", example = "2023-08-31") | ||
@NotNull | ||
LocalDate date | ||
) { | ||
public static UpdateClubActivityResponse from(Activity updatedActivity) { | ||
return new UpdateClubActivityResponse( | ||
updatedActivity.getClub().getId(), | ||
updatedActivity.getId(), | ||
updatedActivity.getTitle(), | ||
updatedActivity.getDescription(), | ||
updatedActivity.getDate() | ||
); | ||
} | ||
} |
This file contains 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.