-
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
1 parent
b7a68ac
commit ab69ae4
Showing
24 changed files
with
667 additions
and
190 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
10 changes: 5 additions & 5 deletions
10
app-api/src/main/java/com/project/reactdashboard/domain/stock/StockApi.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,16 @@ | ||
package com.project.reactdashboard.domain.stock; | ||
|
||
import com.project.reactdashboard.domain.stock.model.Stock; | ||
import com.project.reactdashboard.domain.stock.model.StockDomain; | ||
|
||
import java.util.List; | ||
|
||
public interface StockApi { | ||
|
||
void createAll(List<Stock> stocks); | ||
void createAll(List<StockDomain> stockDomains); | ||
|
||
List<Stock> findBySymbol(String symbol); | ||
List<StockDomain> findBySymbol(String symbol); | ||
|
||
List<Stock> findAllLatest(); | ||
List<StockDomain> findAllLatest(); | ||
|
||
Stock findLastWorkingDayBySymbol(String symbol); | ||
StockDomain findLastWorkingDayBySymbol(String symbol); | ||
} |
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
10 changes: 5 additions & 5 deletions
10
app-api/src/main/java/com/project/reactdashboard/domain/stock/StockSpi.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,17 +1,17 @@ | ||
package com.project.reactdashboard.domain.stock; | ||
|
||
import com.project.reactdashboard.domain.stock.model.Stock; | ||
import com.project.reactdashboard.domain.stock.model.StockDomain; | ||
|
||
import java.time.OffsetDateTime; | ||
import java.util.List; | ||
|
||
public interface StockSpi { | ||
|
||
void createAll(List<Stock> stocks); | ||
void createAll(List<StockDomain> stockDomains); | ||
|
||
List<Stock> findBySymbol(String symbol, OffsetDateTime date); | ||
List<StockDomain> findBySymbol(String symbol, OffsetDateTime date); | ||
|
||
List<Stock> findAllLatest(); | ||
List<StockDomain> findAllLatest(); | ||
|
||
Stock findLastWorkingDayBySymbol(String symbol, OffsetDateTime lastWorkingDay); | ||
StockDomain findLastWorkingDayBySymbol(String symbol, OffsetDateTime lastWorkingDay); | ||
} |
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
186 changes: 186 additions & 0 deletions
186
app-api/src/main/java/com/project/reactdashboard/domain/stock/model/StockDomain.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,186 @@ | ||
package com.project.reactdashboard.domain.stock.model; | ||
|
||
import java.io.Serializable; | ||
import java.time.OffsetDateTime; | ||
|
||
public class StockDomain implements Serializable { | ||
|
||
private Long id; | ||
|
||
private OffsetDateTime date; | ||
|
||
private String symbol; | ||
|
||
private double open; | ||
|
||
private double high; | ||
|
||
private double low; | ||
|
||
private double close; | ||
|
||
private double volume; | ||
|
||
private SymbolValuesDomain symbolValuesDomain; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public OffsetDateTime getDate() { | ||
return date; | ||
} | ||
|
||
public void setDate(OffsetDateTime date) { | ||
this.date = date; | ||
} | ||
|
||
public String getSymbol() { | ||
return symbol; | ||
} | ||
|
||
public void setSymbol(String symbol) { | ||
this.symbol = symbol; | ||
} | ||
|
||
public SymbolValuesDomain getSymbolValues() { | ||
return symbolValuesDomain; | ||
} | ||
|
||
public void setSymbolValues(SymbolValuesDomain symbolValuesDomain) { | ||
this.symbolValuesDomain = symbolValuesDomain; | ||
} | ||
|
||
public double getOpen() { | ||
return open; | ||
} | ||
|
||
public void setOpen(double open) { | ||
this.open = open; | ||
} | ||
|
||
public double getHigh() { | ||
return high; | ||
} | ||
|
||
public void setHigh(double high) { | ||
this.high = high; | ||
} | ||
|
||
public double getLow() { | ||
return low; | ||
} | ||
|
||
public void setLow(double low) { | ||
this.low = low; | ||
} | ||
|
||
public double getClose() { | ||
return close; | ||
} | ||
|
||
public void setClose(double close) { | ||
this.close = close; | ||
} | ||
|
||
public double getVolume() { | ||
return volume; | ||
} | ||
|
||
public void setVolume(double volume) { | ||
this.volume = volume; | ||
} | ||
|
||
public StockDomain() { | ||
} | ||
|
||
private StockDomain(StockDomainBuilder builder) { | ||
this.id = builder.id; | ||
this.date = builder.date; | ||
this.symbol = builder.symbol; | ||
this.symbolValuesDomain = builder.symbolValuesDomain; | ||
this.open = builder.open; | ||
this.close = builder.close; | ||
this.high = builder.high; | ||
this.low = builder.low; | ||
this.volume = builder.volume; | ||
} | ||
|
||
public static class StockDomainBuilder { | ||
|
||
private Long id; | ||
|
||
private OffsetDateTime date; | ||
|
||
private String symbol; | ||
|
||
private SymbolValuesDomain symbolValuesDomain; | ||
|
||
private double open; | ||
|
||
private double high; | ||
|
||
private double low; | ||
|
||
private double close; | ||
|
||
private double volume; | ||
|
||
public StockDomainBuilder(){ | ||
} | ||
|
||
public StockDomainBuilder withId(Long id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withDate(OffsetDateTime date) { | ||
this.date = date; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withSymbol(String symbol) { | ||
this.symbol = symbol; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withSymbolValues(SymbolValuesDomain symbolValuesDomain) { | ||
this.symbolValuesDomain = symbolValuesDomain; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withOpen(double open) { | ||
this.open = open; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withLow(double low) { | ||
this.low = low; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withHigh(double high) { | ||
this.high = high; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withClose(double close) { | ||
this.close = close; | ||
return this; | ||
} | ||
|
||
public StockDomainBuilder withVolume(double volume) { | ||
this.volume = volume; | ||
return this; | ||
} | ||
|
||
public StockDomain build(){ | ||
return new StockDomain(this); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.