Skip to content

Commit

Permalink
Merge pull request #52 from Team-KeepGoing/feature/device
Browse files Browse the repository at this point in the history
Refactor :: refactor device request value
  • Loading branch information
miraexhoi authored Jun 13, 2024
2 parents 93917a4 + 72224d5 commit 8ee441f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class Device {
기기 등록일
*/
@Column(nullable = false)
private String regDate;
private LocalDateTime regDate;

/*
기기 대여 시작일
Expand All @@ -61,7 +61,7 @@ public class Device {
private User borrower;

@Builder
public Device(String deviceName, DeviceStatus status, String imgUrl, String regDate, LocalDateTime rentDate, User borrower) {
public Device(String deviceName, DeviceStatus status, String imgUrl, LocalDateTime regDate, LocalDateTime rentDate, User borrower) {
this.deviceName = deviceName;
this.status = status;
this.imgUrl = imgUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.keepgoing.keepserver.domain.device.payload.request.DeviceDto;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;

Expand All @@ -25,7 +26,7 @@ public static Device dtoToEntity(DeviceDto dto) {
return Device.builder()
.deviceName(dto.deviceName())
.imgUrl(dto.imgUrl())
.regDate(dto.regDate())
.regDate(LocalDateTime.now())
.rentDate(dto.rentDate())
.status(DeviceStatus.AVAILABLE)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public record DeviceDto (
Long id,
String deviceName,
String imgUrl,
String regDate,
LocalDateTime regDate,
LocalDateTime rentDate,
DeviceStatus status
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public record DeviceResponseDto (
Long id,
String deviceName,
String imgUrl,
LocalDateTime regDate,
LocalDateTime rentDate,
DeviceStatus status
) {
Expand Down

This file was deleted.

0 comments on commit 8ee441f

Please sign in to comment.