[05.02.20] Addition of open price to model
This commit is contained in:
parent
434a6d1504
commit
ce14d59ca1
@ -30,15 +30,18 @@ public class CryptoPriceModel {
|
|||||||
@Column(name = "l_price", nullable = false)
|
@Column(name = "l_price", nullable = false)
|
||||||
private float low_price;
|
private float low_price;
|
||||||
|
|
||||||
|
@Column(name = "o_price")
|
||||||
|
private float open_price;
|
||||||
|
|
||||||
@Column(name = "c_price")
|
@Column(name = "c_price")
|
||||||
private float close_price;
|
private float close_price;
|
||||||
|
|
||||||
@Column(name = "volume")
|
@Column(name = "volume")
|
||||||
private float volume;
|
private float volume;
|
||||||
|
|
||||||
// private transient String formattedDate;
|
private transient String formattedDate;
|
||||||
//
|
|
||||||
// public String getFormattedDate() {
|
public String getFormattedDate() {
|
||||||
// return getTimestamp().toString();
|
return getTimestamp().toString();
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
@ -14,8 +14,9 @@ public class BtcPriceMutation implements GraphQLMutationResolver {
|
|||||||
private BtcPriceService btcPriceService;
|
private BtcPriceService btcPriceService;
|
||||||
|
|
||||||
public BtcPriceModel createBtc(final String createdDate, final String type, final float av_price,
|
public BtcPriceModel createBtc(final String createdDate, final String type, final float av_price,
|
||||||
final float h_price, final float l_price, final float c_price, final float volume ) {
|
final float h_price, final float l_price, final float o_price,
|
||||||
return this.btcPriceService.createBtc(createdDate, type, av_price, h_price, l_price, c_price, volume);
|
final float c_price, final float volume ) {
|
||||||
|
return this.btcPriceService.createBtc(createdDate, type, av_price, h_price, l_price, o_price, c_price, volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,8 @@ public class BtcPriceService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public BtcPriceModel createBtc(final String createdDate, final String type, final float av_price,
|
public BtcPriceModel createBtc(final String createdDate, final String type, final float av_price,
|
||||||
final float h_price, final float l_price, final float c_price, final float volume ) {
|
final float h_price, final float l_price, final float o_price,
|
||||||
|
final float c_price, final float volume ) {
|
||||||
|
|
||||||
final BtcPriceModel btcPrice = new BtcPriceModel();
|
final BtcPriceModel btcPrice = new BtcPriceModel();
|
||||||
btcPrice.setTimestamp(format(createdDate).toString());
|
btcPrice.setTimestamp(format(createdDate).toString());
|
||||||
@ -30,6 +31,7 @@ public class BtcPriceService {
|
|||||||
btcPrice.setAverage_price(av_price);
|
btcPrice.setAverage_price(av_price);
|
||||||
btcPrice.setHigh_price(h_price);
|
btcPrice.setHigh_price(h_price);
|
||||||
btcPrice.setLow_price(l_price);
|
btcPrice.setLow_price(l_price);
|
||||||
|
btcPrice.setOpen_price(o_price);
|
||||||
btcPrice.setClose_price(c_price);
|
btcPrice.setClose_price(c_price);
|
||||||
btcPrice.setVolume(volume);
|
btcPrice.setVolume(volume);
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ type BtcPrice {
|
|||||||
average_price: Float!,
|
average_price: Float!,
|
||||||
high_price: Float,
|
high_price: Float,
|
||||||
low_price: Float,
|
low_price: Float,
|
||||||
|
open_price: Float,
|
||||||
close_price: Float,
|
close_price: Float,
|
||||||
volume: Float
|
volume: Float
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user