[24.06.20] Adding Ask and Bid Price

This commit is contained in:
andyjk15 2020-06-24 12:42:02 +01:00
parent e0a8697899
commit 2b24b1b5df
5 changed files with 33 additions and 13 deletions

View File

@ -6,9 +6,9 @@ env.GIT_BRANCH = 'master'
env.GIT_REPOSITORY_PATH = "github.com/andyjk15/${env.APPLICATION_NAME}.git"
env.GIT_REPOSITORY_URL = "https://${env.GIT_REPOSITORY_PATH}"
env.GITHUB_CREDENTIALS_ID = 'Github'
env.DOCKER_REPOSITORY = 'registry.cryptosky.me'
env.DOCKER_REPOSITORY = 'registry.digitalocean.com/cryptosky-image-registry'
env.DOCKER_REPOSITORY_URL = "https://${env.DOCKER_REPOSITORY}"
env.DOCKER_REPOSITORY_TCP = "tcp://${env.DOCKER_REPOSITORY}:4243"
env.DOCKER_REPOSITORY_TCP = "tcp://registry.digitalocean.com"
env.NAMESPACE = 'production'
env.SLAVE_LABEL = "cryptosky-aio-build"
@ -74,10 +74,10 @@ try {
stage('Tag Repository') {
withDockerServer([uri: "${env.DOCKER_REPOSITORY_TCP}"]) {
withDockerRegistry([credentialsId: 'Registry', url: "${env.DOCKER_REPOSITORY_URL}"]) {
def image = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}")
withDockerRegistry([credentialsId: 'DORegistry', url: "${env.DOCKER_REPOSITORY_URL}"]) {
def image = docker.build("db-gateway:${env.APPLICATION_VERSION}")
image.push()
def latest = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:latest")
def latest = docker.build("db-gateway:latest")
latest.push()
}
}

View File

@ -31,6 +31,12 @@ public class CryptoPriceModel {
@Column(name = "l_price", nullable = false)
private float low_price;
@Column(name = "a_price", nullable = false)
private float ask_price;
@Column(name = "b_price", nullable = false)
private float bid_price;
@Column(name = "o_price")
private float open_price;

View File

@ -13,10 +13,16 @@ public class BtcPriceMutation implements GraphQLMutationResolver {
@Autowired
private BtcPriceService btcPriceService;
public BtcPriceModel createBtc(final String createdDate, final String type, final float av_price,
final float h_price, final float l_price, final float o_price,
final float c_price, final float volume ) {
return this.btcPriceService.createBtc(createdDate, type, av_price, h_price, l_price, o_price, c_price, volume);
public BtcPriceModel createBtc(final String createdDate, final String type,
final float av_price,
final float h_price,
final float l_price,
final float o_price,
final float a_price,
final float b_price,
final float c_price,
final float volume ) {
return this.btcPriceService.createBtc(createdDate, type, av_price, h_price, l_price, a_price, b_price, o_price, c_price, volume);
}
}

View File

@ -23,9 +23,15 @@ public class BtcPriceService {
}
@Transactional
public BtcPriceModel createBtc(final String createdDate, final String type, final float av_price,
final float h_price, final float l_price, final float o_price,
final float c_price, final float volume ) {
public BtcPriceModel createBtc(final String createdDate, final String type,
final float av_price,
final float h_price,
final float l_price,
final float a_price,
final float b_price,
final float o_price,
final float c_price,
final float volume ) {
final BtcPriceModel btcPrice = new BtcPriceModel();
btcPrice.setTimestamp(LocalDateTime.parse((createdDate)));
@ -33,6 +39,8 @@ public class BtcPriceService {
btcPrice.setAverage_price(av_price);
btcPrice.setHigh_price(h_price);
btcPrice.setLow_price(l_price);
btcPrice.setAsk_price(a_price);
btcPrice.setBid_price(b_price);
btcPrice.setOpen_price(o_price);
btcPrice.setClose_price(c_price);
btcPrice.setVolume(volume);

View File

@ -35,6 +35,6 @@ type Query {
}
type Mutation {
createBtc(createdDate: String!, type: String!, average_price: Float!, high_price: Float, low_price: Float, open_price: Float, close_price: Float, volume: Float):BtcPrice
createBtc(createdDate: String!, type: String!, average_price: Float!, high_price: Float, low_price: Float, ask_price: Float, bid_price: Float, open_price: Float, close_price: Float, volume: Float):BtcPrice
createTweet(createdDate: String!, rawTweet: String!, sentimentScore: Float!, positiveScore: Float, neutralScore: Float, negativeScore: Float, compoundScore: Float!):tweetModel
}