-
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
Showing
19 changed files
with
307 additions
and
362 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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/kumofactory/cloud/blueprint/domain/ComponentDot.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,43 @@ | ||
package com.kumofactory.cloud.blueprint.domain; | ||
|
||
import com.kumofactory.cloud.blueprint.dto.ComponentDotDto; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.CreationTimestamp; | ||
import org.hibernate.annotations.UpdateTimestamp; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import java.util.Date; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ComponentDot { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@CreationTimestamp | ||
private Date created_at; | ||
@UpdateTimestamp | ||
private Date updated_at; | ||
|
||
private Integer x; // 점의 x 좌표 | ||
private Integer y; // 점의 y 좌표 | ||
private String componentId; // 점이 속한 컴포넌트의 id | ||
|
||
public static ComponentDot createComponentDot(ComponentDotDto componentDotDto) { | ||
ComponentDot componentDot = new ComponentDot(); | ||
componentDot.setComponentId(componentDotDto.getComponentId()); | ||
componentDot.setX(componentDotDto.getX()); | ||
componentDot.setY(componentDotDto.getY()); | ||
return componentDot; | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/com/kumofactory/cloud/blueprint/domain/ComponentLine.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,45 @@ | ||
package com.kumofactory.cloud.blueprint.domain; | ||
|
||
import com.kumofactory.cloud.blueprint.domain.aws.AwsBluePrint; | ||
import com.kumofactory.cloud.blueprint.dto.ComponentLineDto; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.CreationTimestamp; | ||
import org.hibernate.annotations.UpdateTimestamp; | ||
|
||
import javax.persistence.*; | ||
import java.util.Date; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ComponentLine { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@CreationTimestamp | ||
private Date created_at; | ||
@UpdateTimestamp | ||
private Date updated_at; | ||
|
||
private String ui_id; // Client 에서 생성하는 uuid | ||
@OneToOne(cascade = CascadeType.ALL) | ||
private ComponentDot source; | ||
@OneToOne(cascade = CascadeType.ALL) | ||
private ComponentDot destination; | ||
@ManyToOne | ||
private AwsBluePrint bluePrint; | ||
|
||
public static ComponentLine createComponentLink(ComponentLineDto lineDto, AwsBluePrint bluePrint) { | ||
ComponentLine componentLink = new ComponentLine(); | ||
componentLink.setUi_id(lineDto.getId()); | ||
componentLink.setSource(ComponentDot.createComponentDot(lineDto.getSrc())); | ||
componentLink.setDestination(ComponentDot.createComponentDot(lineDto.getDst())); | ||
componentLink.setBluePrint(bluePrint); | ||
return componentLink; | ||
} | ||
} |
56 changes: 0 additions & 56 deletions
56
src/main/java/com/kumofactory/cloud/blueprint/domain/ComponentPoint.java
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
src/main/java/com/kumofactory/cloud/blueprint/domain/PointLink.java
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/kumofactory/cloud/blueprint/domain/aws/AwsComponentType.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,5 +1,5 @@ | ||
package com.kumofactory.cloud.blueprint.domain.aws; | ||
|
||
public enum AwsComponentType { | ||
VPC, SUBNET, ELB, EC2, EFS, WAF, ROUTE53, NAT_GATEWAY, RDS | ||
VPC, SUBNET, ELB, EC2, EFS, WAF, ROUTE53, NAT_GATEWAY, RDS, | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/kumofactory/cloud/blueprint/dto/ComponentDotDto.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,21 @@ | ||
package com.kumofactory.cloud.blueprint.dto; | ||
|
||
import com.kumofactory.cloud.blueprint.domain.ComponentDot; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class ComponentDotDto { | ||
private Integer x; | ||
private Integer y; | ||
private String componentId; | ||
|
||
public static ComponentDotDto mapper(ComponentDot componentDot) { | ||
ComponentDotDto componentDotDto = new ComponentDotDto(); | ||
componentDotDto.setX(componentDot.getX()); | ||
componentDotDto.setY(componentDot.getY()); | ||
componentDotDto.setComponentId(componentDot.getComponentId()); | ||
return componentDotDto; | ||
} | ||
} |
Oops, something went wrong.