Skip to content

Commit

Permalink
Feature: 세션테이블 '제목' 컬럼 추가 (#38)
Browse files Browse the repository at this point in the history
- session_title
- 길이 100자 제한
  • Loading branch information
Youthhing authored Jun 27, 2024
1 parent fe8d757 commit 67cc6bf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public record AddSessionRequest(
Long generationId,
MultipartFile sessionImage,
@NotNull
String title,
@NotNull
String description,
ItIssue itIssue,
Networking networking,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public record SessionListResponse(
Long sessionId,
Integer sessionNumber,
String title,
String photoUrl,
String description,
Long generationId,
Expand All @@ -15,6 +16,7 @@ public static SessionListResponse from(Session session) {
return new SessionListResponse(
session.getId(),
session.getNumber(),
session.getTitle(),
(session.getPhotoS3Info() != null) ? session.getPhotoS3Info().getUrl() : null,
session.getDescription(),
session.getGeneration().getId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public record UpdateSessionRequest(
MultipartFile sessionImage,
@NotNull
Boolean isPhotoUpdated,
String title,
String description,
@NotNull
ItIssue itIssue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public class Session extends BaseTimeEntity {
@Column(name = "session_number")
private Integer number;

@Column(name = "session_title", length = 100)
private String title;

@Embedded
private S3Info photoS3Info;

Expand All @@ -58,9 +61,10 @@ public class Session extends BaseTimeEntity {
private SessionContents sessionContents;

@Builder
public Session(Integer number, S3Info s3Info, String description, Generation generation, SessionContents sessionContents) {
public Session(Integer number, S3Info s3Info, String title, String description, Generation generation, SessionContents sessionContents) {
this.number = number;
this.photoS3Info = s3Info;
this.title = title;
this.description = description;
this.generation = generation;
this.sessionContents = sessionContents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public AddSessionResponse addSession(AddSessionRequest request) throws ImageExce
.s3Info(s3Info)
.description(request.description())
.generation(findGeneration)
.title(request.title())
.sessionContents(SessionContents.builder()
.csEducation(request.csEducation())
.devTalk(request.devTalk())
Expand Down

0 comments on commit 67cc6bf

Please sign in to comment.