forked from finos/vuu
-
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
2bb9c0a
commit 55aa632
Showing
7 changed files
with
128 additions
and
60 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
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
24 changes: 24 additions & 0 deletions
24
layout-server/src/main/java/org/finos/vuu/layoutserver/dto/response/LayoutDTO.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,24 @@ | ||
package org.finos.vuu.layoutserver.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import org.finos.vuu.layoutserver.model.Layout; | ||
|
||
import java.io.Serializable; | ||
|
||
@Data | ||
@Builder | ||
public class LayoutDTO implements Serializable { | ||
|
||
private String id; | ||
private String definition; | ||
private MetadataDTO metadata; | ||
|
||
public static LayoutDTO fromEntity(Layout layout) { | ||
return LayoutDTO.builder() | ||
.id(layout.getId()) | ||
.definition(layout.getDefinition()) | ||
.metadata(MetadataDTO.fromEntity(layout.getMetadata())) | ||
.build(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
layout-server/src/main/java/org/finos/vuu/layoutserver/dto/response/MetadataDTO.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,31 @@ | ||
package org.finos.vuu.layoutserver.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import org.finos.vuu.layoutserver.model.Metadata; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
|
||
@Data | ||
@Builder | ||
public class MetadataDTO implements Serializable { | ||
|
||
private String layoutId; | ||
private String name; | ||
private String group; | ||
private String screenshot; | ||
private String user; | ||
private Date date; | ||
|
||
public static MetadataDTO fromEntity(Metadata metadata) { | ||
return MetadataDTO.builder() | ||
.layoutId(metadata.getLayout().getId()) | ||
.name(metadata.getName()) | ||
.group(metadata.getGroup()) | ||
.screenshot(metadata.getScreenshot()) | ||
.user(metadata.getUser()) | ||
.date(metadata.getDate()) | ||
.build(); | ||
} | ||
} |
14 changes: 8 additions & 6 deletions
14
layout-server/src/main/java/org/finos/vuu/layoutserver/model/Layout.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,21 +1,23 @@ | ||
package org.finos.vuu.layoutserver.model; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
|
||
@Entity | ||
@Data | ||
@Builder | ||
@Entity | ||
@NoArgsConstructor | ||
public class Layout { | ||
@Id | ||
@GeneratedValue(strategy= GenerationType.AUTO) | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private String id; | ||
|
||
@NonNull | ||
private String definition; | ||
|
||
@OneToOne(cascade = CascadeType.ALL) | ||
@JoinColumn(name = "metadata_id", referencedColumnName = "id") | ||
@NonNull | ||
private Metadata metadata; | ||
|
||
protected Layout() {} | ||
} |
24 changes: 12 additions & 12 deletions
24
layout-server/src/main/java/org/finos/vuu/layoutserver/model/Metadata.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,28 +1,28 @@ | ||
package org.finos.vuu.layoutserver.model; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
import lombok.Builder; | ||
import jakarta.persistence.*; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
|
||
import java.util.Date; | ||
|
||
@Entity | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@Entity | ||
public class Metadata { | ||
|
||
@Id | ||
@GeneratedValue | ||
private Long id; | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private String id; | ||
|
||
@OneToOne(mappedBy = "metadata") | ||
@NonNull | ||
private Layout layout; | ||
|
||
private String name; | ||
private String group; | ||
private String screenshot; | ||
private String user; | ||
private Date date; | ||
|
||
protected Metadata() { | ||
} | ||
private Date date = new Date(); | ||
} |
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