-
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.
Merge pull request #11 from 7th-UMC-Hackathon-TeamV/feat/post
Feat/post
- Loading branch information
Showing
11 changed files
with
100 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
package banban.springboot.domain.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Group { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(nullable = false, length = 6) | ||
private String groupKey; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ public class MemberRequestDTO { | |
|
||
@Size(max=20) | ||
private String password; | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
src/main/java/banban/springboot/web/dto/response/GroupResponseDTO.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,4 +1,5 @@ | ||
package banban.springboot.web.dto.response; | ||
|
||
public class GroupResponseDTO { | ||
|
||
} |
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
public class MemberResponseDTO { | ||
private Long id; | ||
private String username; | ||
} | ||
} |
34 changes: 24 additions & 10 deletions
34
src/main/java/banban/springboot/web/dto/response/NewsResponseDTO.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,19 +1,33 @@ | ||
package banban.springboot.web.dto.response; | ||
|
||
import banban.springboot.domain.entity.News; | ||
import lombok.*; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@Builder | ||
@AllArgsConstructor | ||
|
||
public class NewsResponseDTO { | ||
private Long id; | ||
private String headline; | ||
private String content; | ||
private List<MultipartFile> images; | ||
private boolean isBreakingNews; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@Builder | ||
@AllArgsConstructor | ||
public static class NewsCreateResponseDTO { | ||
private Long newsId; | ||
private String headline; | ||
private String content; | ||
//private List<MultipartFile> images; | ||
private boolean isBreakingNews; | ||
|
||
public static NewsCreateResponseDTO from(News news) { | ||
return NewsCreateResponseDTO.builder() | ||
.newsId(news.getId()) | ||
.headline(news.getHeadline()) | ||
.content(news.getContent()) | ||
.isBreakingNews(news.isBreakingNews()) | ||
.build(); | ||
} | ||
} | ||
} |