From ddb5012b9511452943c4bfc3ec50b36e11a80952 Mon Sep 17 00:00:00 2001 From: andyjk15 Date: Sun, 11 Oct 2020 15:17:40 +0100 Subject: [PATCH] [11.10.20] Removed graphql deletion --- pom.xml | 21 ++-------- .../graphql/mutations/BtcPriceMutation.java | 26 ------------ .../graphql/queries/BtcPriceQuery.java | 38 ------------------ src/main/resources/application.yaml | 2 +- src/main/resources/graphql/configQL.graphqls | 40 ------------------- 5 files changed, 5 insertions(+), 122 deletions(-) delete mode 100644 src/main/java/cryptosky/me/pricing/graphql/mutations/BtcPriceMutation.java delete mode 100644 src/main/java/cryptosky/me/pricing/graphql/queries/BtcPriceQuery.java delete mode 100644 src/main/resources/graphql/configQL.graphqls diff --git a/pom.xml b/pom.xml index b7821dc..0cfa4ee 100644 --- a/pom.xml +++ b/pom.xml @@ -48,23 +48,6 @@ spring-boot-starter-data-jpa - - - com.graphql-java - graphql-spring-boot-starter - 5.0.2 - - - com.graphql-java - graphql-java-tools - 5.2.4 - - - com.graphql-java - graphiql-spring-boot-starter - 5.0.2 - - com.h2database @@ -98,6 +81,10 @@ 1.18.8 true + + org.apache.commons + commons-lang3 + diff --git a/src/main/java/cryptosky/me/pricing/graphql/mutations/BtcPriceMutation.java b/src/main/java/cryptosky/me/pricing/graphql/mutations/BtcPriceMutation.java deleted file mode 100644 index 8ee0a80..0000000 --- a/src/main/java/cryptosky/me/pricing/graphql/mutations/BtcPriceMutation.java +++ /dev/null @@ -1,26 +0,0 @@ -package cryptosky.me.pricing.graphql.mutations; - -import com.coxautodev.graphql.tools.GraphQLMutationResolver; -import cryptosky.me.pricing.models.entities.BtcPriceModel; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import cryptosky.me.pricing.service.PriceService; - -@Component -public class BtcPriceMutation implements GraphQLMutationResolver { - - @Autowired - private PriceService priceService; - - 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.priceService.createBtc(createdDate, type, av_price, h_price, l_price, o_price, c_price, volume); - } - -} diff --git a/src/main/java/cryptosky/me/pricing/graphql/queries/BtcPriceQuery.java b/src/main/java/cryptosky/me/pricing/graphql/queries/BtcPriceQuery.java deleted file mode 100644 index e5dcea0..0000000 --- a/src/main/java/cryptosky/me/pricing/graphql/queries/BtcPriceQuery.java +++ /dev/null @@ -1,38 +0,0 @@ -package cryptosky.me.pricing.graphql.queries; - -import com.coxautodev.graphql.tools.GraphQLQueryResolver; -import cryptosky.me.pricing.models.entities.BtcPriceModel; -import cryptosky.me.pricing.models.entities.CryptoPriceModel; -import cryptosky.me.pricing.service.PriceService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Optional; - -@Component -public class BtcPriceQuery implements GraphQLQueryResolver { - - @Autowired - private PriceService priceService; - - public List getAllPrices(final int count ) { - return this.priceService.getAllPrices(count); - } - - public List getPricesBetweenCounts( final int startCount, final int endCount ) { - return this.priceService.getPricesBetweenCounts(startCount, endCount); - } - - public Optional getLatest() { - return this.priceService.getLatest(); - } - - public Optional getPriceForCreatedDate( final String createdDate ) { - return this.priceService.getPriceForCreatedDate(createdDate); - } - - public List getPriceBetweenDates(final String startDate, final String endDate ) { - return this.priceService.getPriceBetweenDates(startDate, endDate); - } -} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 16b00cf..6b11254 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -17,7 +17,7 @@ spring: platform: postgres jpa: hibernate: - ddl-auto: update + ddl-auto: validate show-sql: false properties: org.hibernate.envers.revision_field_name: revision_id diff --git a/src/main/resources/graphql/configQL.graphqls b/src/main/resources/graphql/configQL.graphqls deleted file mode 100644 index 6ca2324..0000000 --- a/src/main/resources/graphql/configQL.graphqls +++ /dev/null @@ -1,40 +0,0 @@ -type BtcPrice { - id: ID!, - timestamp: String!, - type: String, - average_price: Float!, - high_price: Float, - low_price: Float, - open_price: Float, - close_price: Float, - volume: Float -} - -type sentimentModel { - id: ID!, - timestamp: String!, - rawTweet: String, - sentimentScore: Float!, - positiveScore: Float, - neutralScore: Float, - negativeScore: Float, - compoundScore: Float! -} - -type Query { - allPrices(count: Int):[BtcPrice], - pricesBetweenCounts(startCount: Int, endCount: Int):[BtcPrice] - latest:BtcPrice, - priceForCreatedDate(createdDate: String):BtcPrice, - priceBetweenDates(startDate: String, endDate: String):[BtcPrice], - ################################################################ - currentTweet:sentimentModel, - allTweets(count: Int):[sentimentModel], - tweetsForDay(startDate: String, endDate: String):[sentimentModel], - tweetsForPeriod(startDate: String, endDate: String):[sentimentModel] -} - -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 - createTweet(createdDate: String!, rawTweet: String!, sentimentScore: Float!, positiveScore: Float, neutralScore: Float, negativeScore: Float, compoundScore: Float!):sentimentModel -} \ No newline at end of file