-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b13945
commit 2c86223
Showing
4 changed files
with
8 additions
and
26 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
22 changes: 0 additions & 22 deletions
22
...n/java/com/sponus/sponusbe/domain/announcement/dto/request/AnnouncementUpdateRequest.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 |
---|---|---|
@@ -1,39 +1,17 @@ | ||
package com.sponus.sponusbe.domain.announcement.dto.request; | ||
|
||
import static com.sponus.sponusbe.domain.announcement.entity.enums.AnnouncementStatus.*; | ||
|
||
import com.sponus.sponusbe.domain.announcement.entity.Announcement; | ||
import com.sponus.sponusbe.domain.announcement.entity.enums.AnnouncementCategory; | ||
import com.sponus.sponusbe.domain.announcement.entity.enums.AnnouncementStatus; | ||
import com.sponus.sponusbe.domain.announcement.entity.enums.AnnouncementType; | ||
import com.sponus.sponusbe.domain.organization.entity.Organization; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record AnnouncementUpdateRequest( | ||
@NotBlank(message = "[ERROR] 타이틀 입력은 필수 입니다.") | ||
String title, | ||
@NotNull(message = "[ERROR] 유형 입력은 필수 입니다.") | ||
AnnouncementType type, | ||
@NotNull(message = "[ERROR] 카테코리 입력은 필수 입니다.") | ||
AnnouncementCategory category, | ||
@NotBlank(message = "[ERROR] 내용 입력은 필수 입니다.") | ||
String content, | ||
|
||
AnnouncementStatus status | ||
) { | ||
|
||
public Announcement toEntity(Organization writer) { | ||
return Announcement.builder() | ||
.writer(writer) | ||
.title(title) | ||
.type(type) | ||
.category(category) | ||
.content(content) | ||
.status(OPENED) | ||
.build(); | ||
} | ||
} |
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