changed deadline to timestamp and the logic to schedule an auction #56
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user