From: Michael Winsauer Date: Tue, 11 Dec 2018 14:07:35 +0000 (+0100) Subject: Merge branch '35-analysis-does-not-return-json' into 'master' X-Git-Tag: code-freeze~28 X-Git-Url: https://git.somenet.org/pub/jan/aic18.git/commitdiff_plain/3a87d949191651c24136a6fd415fe69444591f70?hp=4671b9307c14380214ac2f706fc0575326922481 Merge branch '35-analysis-does-not-return-json' into 'master' refined README.me, fixed issue #35 Closes #35 See merge request aic18/G6T4!30 --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3a6547..ee52a52 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,16 @@ # Contribution Guide -TODO + +## Guidelines + +* Don't push directly to the `master` branch. +* Create a new branch from `master` for new features. For best pratice, prefix it with the name of your service, e.g. `twitter-fix-something`. +* Use Merge Requests (MRs) instead of directly pushing to master. +* Don't accept your own MRs, unless they are actually minor, like changing a `README` file. Otherwise ask someone else to test it. + + +## Don't do this + +* Force pushing to remote branches, especially master. It's usually uncessary, just fix your own feature branch. +* Rebasing or resetting remote branches. Doing it locally is fine. If you want to undo an already pushed commit, push a revert commit. +* Squashing commits. I'm personally fine with it, but I think someone was against it? Not sure if it was a tutor, or not. diff --git a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/configuration/Twitter4jProperties.java b/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/configuration/Twitter4jProperties.java index 3196f98..8e2ae24 100644 --- a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/configuration/Twitter4jProperties.java +++ b/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/configuration/Twitter4jProperties.java @@ -1,5 +1,7 @@ package at.aic18.g6t4.servicetwitter.configuration; +import lombok.Getter; +import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; @@ -8,23 +10,15 @@ import javax.validation.constraints.NotEmpty; @ConfigurationProperties(prefix = "twitter4j") @Validated +@Getter +@Setter public class Twitter4jProperties { @Valid private final OAuth oauth = new OAuth(); private boolean debug = false; - public OAuth getOauth() { - return oauth; - } - - public boolean isDebug() { - return debug; - } - - public void setDebug(boolean debug) { - this.debug = debug; - } - + @Getter + @Setter public static class OAuth { @NotEmpty private String consumerKey; @@ -32,38 +26,6 @@ public class Twitter4jProperties { @NotEmpty private String accessToken; @NotEmpty private String accessTokenSecret; - public String getConsumerKey() { - return consumerKey; - } - - public void setConsumerKey(String consumerKey) { - this.consumerKey = consumerKey; - } - - public String getConsumerSecret() { - return consumerSecret; - } - - public void setConsumerSecret(String consumerSecret) { - this.consumerSecret = consumerSecret; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public String getAccessTokenSecret() { - return accessTokenSecret; - } - - public void setAccessTokenSecret(String accessTokenSecret) { - this.accessTokenSecret = accessTokenSecret; - } - } } diff --git a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/exception/SearchException.java b/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/exception/SearchException.java deleted file mode 100644 index b69d7ab..0000000 --- a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/exception/SearchException.java +++ /dev/null @@ -1,21 +0,0 @@ -package at.aic18.g6t4.servicetwitter.exception; - -public class SearchException extends Exception { - - public SearchException() { - super(); - } - - public SearchException(String message) { - super(message); - } - - public SearchException(String message, Throwable cause) { - super(message, cause); - } - - public SearchException(Throwable cause) { - super(cause); - } - -} diff --git a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java b/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java index d676835..f10c2dc 100644 --- a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java +++ b/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java @@ -18,7 +18,8 @@ public class TwitterService { } public List searchTweets(String queryString) throws TwitterException { - Query query = new Query(queryString); + String excludeRetweets = " exclude:retweets"; + Query query = new Query(queryString + excludeRetweets); query.count(10); QueryResult queryResult = twitter.search(query); List statusList = queryResult.getTweets(); diff --git a/service-twitter/src/main/resources/application.yml b/service-twitter/src/main/resources/application.yml index 6941e32..ac49b95 100644 --- a/service-twitter/src/main/resources/application.yml +++ b/service-twitter/src/main/resources/application.yml @@ -1,4 +1,4 @@ -debug: true +debug: false spring: jackson: @@ -8,7 +8,7 @@ server: port: 8084 twitter4j: - debug: true + debug: false oauth: consumer-key: "DnmBShVqvJ2xfnRjkAWtq644Z" consumer-secret: "YbP2oAdU9IyuYMAUxbyJn1NNKZ91jnOz1CpNKMSCjCR0Pu8JlJ"