-
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
5 changed files
with
44 additions
and
73 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
16 changes: 2 additions & 14 deletions
16
src/main/java/gigedi/dev/domain/block/dto/request/CreateBlockRequest.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,16 +1,4 @@ | ||
package gigedi.dev.domain.block.dto.request; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class CreateBlockRequest { | ||
private String title; | ||
private double xCoordinate; | ||
private double yCoordinate; | ||
private double height; | ||
private double width; | ||
} | ||
public record CreateBlockRequest( | ||
String title, double xCoordinate, double yCoordinate, double height, double width) {} |
11 changes: 1 addition & 10 deletions
11
src/main/java/gigedi/dev/domain/block/dto/request/UpdateBlockRequest.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,12 +1,3 @@ | ||
package gigedi.dev.domain.block.dto.request; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class UpdateBlockRequest { | ||
private String title; | ||
} | ||
public record UpdateBlockRequest(String title) {} |
34 changes: 15 additions & 19 deletions
34
src/main/java/gigedi/dev/domain/block/dto/response/CreateBlockResponse.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,25 +1,21 @@ | ||
package gigedi.dev.domain.block.dto.response; | ||
|
||
import gigedi.dev.domain.block.domain.Block; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class CreateBlockResponse { | ||
private Long blockId; | ||
private String title; | ||
private double xCoordinate; | ||
private double yCoordinate; | ||
private double height; | ||
private double width; | ||
|
||
public CreateBlockResponse(Block block) { | ||
this.blockId = block.getBlockId(); | ||
this.title = block.getTitle(); | ||
this.xCoordinate = block.getXCoordinate(); | ||
this.yCoordinate = block.getYCoordinate(); | ||
this.height = block.getHeight(); | ||
this.width = block.getWidth(); | ||
public record CreateBlockResponse( | ||
Long blockId, | ||
String title, | ||
double xCoordinate, | ||
double yCoordinate, | ||
double height, | ||
double width) { | ||
public static CreateBlockResponse from(Block block) { | ||
return new CreateBlockResponse( | ||
block.getBlockId(), | ||
block.getTitle(), | ||
block.getXCoordinate(), | ||
block.getYCoordinate(), | ||
block.getHeight(), | ||
block.getWidth()); | ||
} | ||
} |
38 changes: 17 additions & 21 deletions
38
src/main/java/gigedi/dev/domain/block/dto/response/GetBlockResponse.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,27 +1,23 @@ | ||
package gigedi.dev.domain.block.dto.response; | ||
|
||
import gigedi.dev.domain.block.domain.Block; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class GetBlockResponse { | ||
private Long blockId; | ||
private String title; | ||
private int shootCount; | ||
private double xCoordinate; | ||
private double yCoordinate; | ||
private double height; | ||
private double width; | ||
|
||
public GetBlockResponse(Block block) { | ||
this.blockId = block.getBlockId(); | ||
this.title = block.getTitle(); | ||
this.shootCount = block.getShootCount(); | ||
this.xCoordinate = block.getXCoordinate(); | ||
this.yCoordinate = block.getYCoordinate(); | ||
this.height = block.getHeight(); | ||
this.width = block.getWidth(); | ||
public record GetBlockResponse( | ||
Long blockId, | ||
String title, | ||
int shootCount, | ||
double xCoordinate, | ||
double yCoordinate, | ||
double height, | ||
double width) { | ||
public static GetBlockResponse from(Block block) { | ||
return new GetBlockResponse( | ||
block.getBlockId(), | ||
block.getTitle(), | ||
block.getShootCount(), | ||
block.getXCoordinate(), | ||
block.getYCoordinate(), | ||
block.getHeight(), | ||
block.getWidth()); | ||
} | ||
} |