diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/common/formats/AuctionJsonRepresentation.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/common/formats/AuctionJsonRepresentation.java index 4500423..ea4cf2c 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/common/formats/AuctionJsonRepresentation.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/common/formats/AuctionJsonRepresentation.java @@ -7,6 +7,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.Getter; import lombok.Setter; +import java.sql.Timestamp; + /** * Used to expose a representation of the state of an auction through an interface. This class is * only meant as a starting point when defining a uniform HTTP API for the Auction House: feel free @@ -28,12 +30,12 @@ public class AuctionJsonRepresentation { private String taskType; @Getter @Setter - private Integer deadline; + private Timestamp deadline; public AuctionJsonRepresentation() { } public AuctionJsonRepresentation(String auctionId, String auctionHouseUri, String taskUri, - String taskType, Integer deadline) { + String taskType, Timestamp deadline) { this.auctionId = auctionId; this.auctionHouseUri = auctionHouseUri; this.taskUri = taskUri; diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/service/StartAuctionService.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/service/StartAuctionService.java index b9d9d3d..60c5f24 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/service/StartAuctionService.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/service/StartAuctionService.java @@ -12,6 +12,7 @@ import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.sql.Timestamp; import java.util.Optional; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -26,7 +27,7 @@ import java.util.concurrent.TimeUnit; public class StartAuctionService implements LaunchAuctionUseCase { private static final Logger LOGGER = LogManager.getLogger(StartAuctionService.class); - private final static int DEFAULT_AUCTION_DEADLINE_MILLIS = 10000; + private final Timestamp DEFAULT_AUCTION_DEADLINE_MILLIS = Timestamp.valueOf("1970-01-01 00:00:01"); // Event port used to publish an auction started event private final AuctionStartedEventPort auctionStartedEventPort;