-
Notifications
You must be signed in to change notification settings - Fork 0
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
c452387
commit d229461
Showing
10 changed files
with
240 additions
and
7 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
48 changes: 48 additions & 0 deletions
48
src/main/java/com/odiga/fiesta/festival/domain/FestivalModificationRequest.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,48 @@ | ||
package com.odiga.fiesta.festival.domain; | ||
|
||
import static jakarta.persistence.GenerationType.*; | ||
|
||
import com.odiga.fiesta.common.domain.BaseEntity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
@Table(name = "festival_modification_request") | ||
public class FestivalModificationRequest extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
@Column(name = "festival_modification_id") | ||
private Long id; | ||
|
||
@Column(name = "festival_id", nullable = false) | ||
private Long festivalId; | ||
|
||
@Column(name = "user_id", nullable = false) | ||
private Long userId; | ||
|
||
@Column(name = "content", length = 500, nullable = false) | ||
private String content; | ||
|
||
@Column(name = "is_pending", nullable = false) | ||
private boolean isPending; | ||
|
||
@Builder | ||
public FestivalModificationRequest(Long id, Long festivalId, Long userId, | ||
String content, boolean isPending) { | ||
this.id = id; | ||
this.festivalId = festivalId; | ||
this.userId = userId; | ||
this.content = content; | ||
this.isPending = isPending; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/odiga/fiesta/festival/dto/request/CreateFestivalModificationRequest.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,19 @@ | ||
package com.odiga.fiesta.festival.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class CreateFestivalModificationRequest { | ||
|
||
@NotBlank | ||
private String content; | ||
|
||
@Builder | ||
public CreateFestivalModificationRequest(String content) { | ||
this.content = content; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/odiga/fiesta/festival/dto/response/FestivalModificationResponse.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,25 @@ | ||
package com.odiga.fiesta.festival.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@Getter | ||
public class FestivalModificationResponse { | ||
|
||
private Long festivalId; | ||
private Long requestId; | ||
private boolean isPending; | ||
private LocalDateTime createdAt; | ||
|
||
@Builder | ||
public FestivalModificationResponse(Long festivalId, Long requestId, boolean isPending, LocalDateTime createdAt) { | ||
this.festivalId = festivalId; | ||
this.requestId = requestId; | ||
this.isPending = isPending; | ||
this.createdAt = createdAt; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...main/java/com/odiga/fiesta/festival/repository/FestivalModificationRequestRepository.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,8 @@ | ||
package com.odiga.fiesta.festival.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.odiga.fiesta.festival.domain.FestivalModificationRequest; | ||
|
||
public interface FestivalModificationRequestRepository extends JpaRepository<FestivalModificationRequest, Long> { | ||
} |
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
10 changes: 10 additions & 0 deletions
10
src/main/resources/db/migration/V22__add_festival_modification_request.sql
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,10 @@ | ||
CREATE TABLE festival_modification_request | ||
( | ||
festival_modification_id BIGINT NOT NULL PRIMARY KEY, | ||
festival_id BIGINT NOT NULL, | ||
user_id BIGINT NOT NULL, | ||
content VARCHAR(500) NOT NULL, | ||
is_pending BIT(1) DEFAULT 1 NOT NULL, | ||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); |
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.