[11.10.20] Removed graphql deletion
This commit is contained in:
parent
80843da00e
commit
ddb5012b95
21
pom.xml
21
pom.xml
@ -48,23 +48,6 @@
|
|||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- GraghQL -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.graphql-java</groupId>
|
|
||||||
<artifactId>graphql-spring-boot-starter</artifactId>
|
|
||||||
<version>5.0.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.graphql-java</groupId>
|
|
||||||
<artifactId>graphql-java-tools</artifactId>
|
|
||||||
<version>5.2.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.graphql-java</groupId>
|
|
||||||
<artifactId>graphiql-spring-boot-starter</artifactId>
|
|
||||||
<version>5.0.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Local database -->
|
<!-- Local database -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
@ -98,6 +81,10 @@
|
|||||||
<version>1.18.8</version>
|
<version>1.18.8</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--- Logging -->
|
<!--- Logging -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -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<BtcPriceModel> getAllPrices(final int count ) {
|
|
||||||
return this.priceService.getAllPrices(count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<BtcPriceModel> getPricesBetweenCounts( final int startCount, final int endCount ) {
|
|
||||||
return this.priceService.getPricesBetweenCounts(startCount, endCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Optional<BtcPriceModel> getLatest() {
|
|
||||||
return this.priceService.getLatest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Optional<BtcPriceModel> getPriceForCreatedDate( final String createdDate ) {
|
|
||||||
return this.priceService.getPriceForCreatedDate(createdDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<BtcPriceModel> getPriceBetweenDates(final String startDate, final String endDate ) {
|
|
||||||
return this.priceService.getPriceBetweenDates(startDate, endDate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -17,7 +17,7 @@ spring:
|
|||||||
platform: postgres
|
platform: postgres
|
||||||
jpa:
|
jpa:
|
||||||
hibernate:
|
hibernate:
|
||||||
ddl-auto: update
|
ddl-auto: validate
|
||||||
show-sql: false
|
show-sql: false
|
||||||
properties:
|
properties:
|
||||||
org.hibernate.envers.revision_field_name: revision_id
|
org.hibernate.envers.revision_field_name: revision_id
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user