-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature/Inhabas#241] 프로젝트 게시판 구현 (빌드 확인 필요)
- Loading branch information
1 parent
40170eb
commit a0f1c83
Showing
32 changed files
with
861 additions
and
252 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ntest/domain/valueObject/ContestType.java → ...pi/domain/contest/domain/ContestType.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
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
17 changes: 17 additions & 0 deletions
17
resource-server/src/main/java/com/inhabas/api/domain/project/domain/PinOption.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,17 @@ | ||
package com.inhabas.api.domain.project.domain; | ||
|
||
public enum PinOption { | ||
DISABLED(0), | ||
TEMPORARY(1), | ||
PERMANENT(2); | ||
|
||
private final Integer option; | ||
|
||
PinOption(Integer option) { | ||
this.option = option; | ||
} | ||
|
||
public Integer getOption() { | ||
return option; | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
resource-server/src/main/java/com/inhabas/api/domain/project/domain/ProjectBoard.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,88 @@ | ||
package com.inhabas.api.domain.project.domain; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import javax.persistence.CascadeType; | ||
import javax.persistence.Column; | ||
import javax.persistence.DiscriminatorValue; | ||
import javax.persistence.Embedded; | ||
import javax.persistence.Entity; | ||
import javax.persistence.EntityListeners; | ||
import javax.persistence.Inheritance; | ||
import javax.persistence.InheritanceType; | ||
import javax.persistence.OneToMany; | ||
import javax.persistence.Table; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import com.inhabas.api.domain.board.domain.BaseBoard; | ||
import com.inhabas.api.domain.board.domain.valueObject.Content; | ||
import com.inhabas.api.domain.board.domain.valueObject.Title; | ||
import com.inhabas.api.domain.comment.domain.Comment; | ||
import com.inhabas.api.domain.file.domain.BoardFile; | ||
import com.inhabas.api.domain.menu.domain.Menu; | ||
|
||
@Entity | ||
@Table(name = "NORMAL_BOARD") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@EntityListeners(AuditingEntityListener.class) | ||
@Inheritance(strategy = InheritanceType.JOINED) | ||
@DiscriminatorValue("PROJECT") | ||
public class ProjectBoard extends BaseBoard { | ||
|
||
@Embedded private Content content; | ||
|
||
@Column private Boolean isPinned = false; | ||
|
||
@Column(columnDefinition = "DATETIME(0)") | ||
private LocalDateTime datePinExpiration; | ||
|
||
@OneToMany(mappedBy = "parentBoard", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private List<Comment> comments = new ArrayList<>(); | ||
|
||
/* constructor */ | ||
|
||
public ProjectBoard( | ||
String title, Menu menu, String content, Boolean isPinned, LocalDateTime datePinExpiration) { | ||
super(title, menu); | ||
this.content = new Content(content); | ||
this.isPinned = isPinned; | ||
this.datePinExpiration = datePinExpiration; | ||
} | ||
|
||
/* getter */ | ||
|
||
public Boolean getPinned() { | ||
return isPinned; | ||
} | ||
|
||
public LocalDateTime getDatePinExpiration() { | ||
return datePinExpiration; | ||
} | ||
|
||
public String getContent() { | ||
return content.getValue(); | ||
} | ||
|
||
public List<BoardFile> getFiles() { | ||
return Collections.unmodifiableList(files); | ||
} | ||
|
||
/* relation method */ | ||
|
||
public void updateText(String title, String content) { | ||
this.title = new Title(title); | ||
this.content = new Content(content); | ||
} | ||
|
||
public void updatePinned(Boolean isPinned, LocalDateTime datePinExpiration) { | ||
this.isPinned = isPinned; | ||
this.datePinExpiration = datePinExpiration; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../api/domain/project/ProjectBoardType.java → ...main/project/domain/ProjectBoardType.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
77 changes: 77 additions & 0 deletions
77
resource-server/src/main/java/com/inhabas/api/domain/project/dto/ProjectBoardDetailDto.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,77 @@ | ||
package com.inhabas.api.domain.project.dto; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Positive; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.inhabas.api.domain.file.dto.FileDownloadDto; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ProjectBoardDetailDto { | ||
|
||
@NotNull @Positive private Long id; | ||
|
||
@NotBlank private String title; | ||
|
||
@NotBlank private String content; | ||
@NotNull private Long writerId; | ||
|
||
@NotBlank private String writerName; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2024-11-01T00:00:00") | ||
private LocalDateTime datePinExpiration; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2024-11-01T00:00:00") | ||
private LocalDateTime dateCreated; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2024-11-01T00:00:00") | ||
private LocalDateTime dateUpdated; | ||
|
||
@NotNull private List<FileDownloadDto> images; | ||
|
||
@NotNull private List<FileDownloadDto> otherFiles; | ||
|
||
@NotNull private Boolean isPinned; | ||
|
||
@Builder | ||
public ProjectBoardDetailDto( | ||
Long id, | ||
String title, | ||
String content, | ||
Long writerId, | ||
String writerName, | ||
LocalDateTime datePinExpiration, | ||
LocalDateTime dateCreated, | ||
LocalDateTime dateUpdated, | ||
List<FileDownloadDto> images, | ||
List<FileDownloadDto> otherFiles, | ||
Boolean isPinned) { | ||
this.id = id; | ||
this.title = title; | ||
this.content = content; | ||
this.writerId = writerId; | ||
this.writerName = writerName; | ||
this.datePinExpiration = datePinExpiration; | ||
this.dateCreated = dateCreated; | ||
this.dateUpdated = dateUpdated; | ||
this.images = images; | ||
this.otherFiles = otherFiles; | ||
this.isPinned = isPinned; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
resource-server/src/main/java/com/inhabas/api/domain/project/dto/ProjectBoardDto.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,63 @@ | ||
package com.inhabas.api.domain.project.dto; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Positive; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ProjectBoardDto { | ||
@NotNull @Positive private Long id; | ||
|
||
@NotBlank private String title; | ||
|
||
@NotNull private Long writerId; | ||
|
||
@NotBlank private String writerName; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2024-11-01T00:00:00") | ||
private LocalDateTime datePinExpiration; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2024-11-01T00:00:00") | ||
private LocalDateTime dateCreated; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2024-11-01T00:00:00") | ||
private LocalDateTime dateUpdated; | ||
|
||
@NotNull private Boolean isPinned; | ||
|
||
@Builder | ||
public ProjectBoardDto( | ||
Long id, | ||
String title, | ||
Long writerId, | ||
String writerName, | ||
LocalDateTime datePinExpiration, | ||
LocalDateTime dateCreated, | ||
LocalDateTime dateUpdated, | ||
Boolean isPinned) { | ||
this.id = id; | ||
this.title = title; | ||
this.writerId = writerId; | ||
this.writerName = writerName; | ||
this.datePinExpiration = datePinExpiration; | ||
this.dateCreated = dateCreated; | ||
this.dateUpdated = dateUpdated; | ||
this.isPinned = isPinned; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
resource-server/src/main/java/com/inhabas/api/domain/project/dto/SaveProjectBoardDto.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 com.inhabas.api.domain.project.dto; | ||
|
||
import java.util.List; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class SaveProjectBoardDto { | ||
|
||
@NotBlank private String title; | ||
|
||
@NotBlank private String content; | ||
|
||
private List<MultipartFile> files; | ||
|
||
private Integer pinOption; | ||
|
||
@Builder | ||
public SaveProjectBoardDto( | ||
String title, String content, List<MultipartFile> files, Integer pinOption) { | ||
this.title = title; | ||
this.content = content; | ||
this.files = files; | ||
this.pinOption = pinOption; | ||
} | ||
} |
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
Oops, something went wrong.