diff --git a/.classpath b/.classpath index 92b9cb8..3c53960 100644 --- a/.classpath +++ b/.classpath @@ -1,39 +1,39 @@ - + - - + - + - - - + + + + - + + - + - - + diff --git a/.factorypath b/.factorypath new file mode 100644 index 0000000..32f8be5 --- /dev/null +++ b/.factorypath @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..07783c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +target/ +*.iml +.idea/ +demo.iml +*.class +src/main/resources/twitter4j.properties +.gradle/ +.vscode +.settings/ \ No newline at end of file diff --git a/.gradle/6.5/executionHistory/executionHistory.lock b/.gradle/6.5/executionHistory/executionHistory.lock new file mode 100644 index 0000000..eee959e Binary files /dev/null and b/.gradle/6.5/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.5/fileChanges/last-build.bin b/.gradle/6.5/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/6.5/fileChanges/last-build.bin differ diff --git a/.gradle/6.5/fileHashes/fileHashes.lock b/.gradle/6.5/fileHashes/fileHashes.lock new file mode 100644 index 0000000..0325f14 Binary files /dev/null and b/.gradle/6.5/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.5/gc.properties b/.gradle/6.5/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..8bf31e9 Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..dbd9417 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed Aug 26 19:54:40 JST 2020 +gradle.version=6.5 diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock new file mode 100644 index 0000000..4b33b72 Binary files /dev/null and b/.gradle/checksums/checksums.lock differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.settings/org.eclipse.jdt.apt.core.prefs b/.settings/org.eclipse.jdt.apt.core.prefs index d4313d4..687ad91 100644 --- a/.settings/org.eclipse.jdt.apt.core.prefs +++ b/.settings/org.eclipse.jdt.apt.core.prefs @@ -1,2 +1,4 @@ eclipse.preferences.version=1 -org.eclipse.jdt.apt.aptEnabled=false +org.eclipse.jdt.apt.aptEnabled=true +org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations +org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 7797211..b56a5cf 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -5,6 +5,6 @@ org.eclipse.jdt.core.compiler.compliance=11 org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.processAnnotations=enabled org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=11 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e0f15db --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic" +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..556ccd1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' + +services: + db: + image: postgres:latest + container_name: emolog_db + volumes: + - ./docker/pg:/docker-entrypoint-initdb.d + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: test_db + ports: + - '5432:5432' \ No newline at end of file diff --git a/docker/pg/1-createTable.sql b/docker/pg/1-createTable.sql new file mode 100644 index 0000000..7f9bae3 --- /dev/null +++ b/docker/pg/1-createTable.sql @@ -0,0 +1,102 @@ +/*テーブル作成*/ +create table users ( + id serial primary key, + name varchar(30) not null, + mail varchar(50) not null, + filterlevel smallint +); + +create table sample ( + friendid serial primary key, + name varchar(30) not null, + mail varchar(50) not null, + filterlevel smallint +); + +create table friend ( + id serial primary key, + userid INTEGER not null, + friendid INTEGER not null, + name varchar(30) not null, + latestemolog varchar(30), + updated_at timestamp, + lasttweetid INTEGER DEFAULT 0 +); + +create table emolog ( + id serial primary key, + userid INTEGER not null, + friendid INTEGER not null, + created_at timestamp, + contents varchar(30) +); + +create table chat ( + id serial primary key, + userid INTEGER not null, + friendid INTEGER not null, + contents varchar(30), + create_at timestamp +); + +create table requestfriend ( + id serial primary key, + userid INTEGER not null, + requestfriendid INTEGER not null, + create_at timestamp +); + +/* BEGIN:nakamura */ +insert into users(name, mail, filterlevel) values +('ichigo.chocomint', 'ichigo@hoge.com', 1), +('banana.chocomint', 'banana@hoge.com', 2), +('pinapple.chocomint', 'pineapple@hoge.com', 3), +('apple.chocomint', 'apple@hoge.com', 4), +('lemon.chocomint', 'lemon@hoge.com', 5) +; + +insert into friend(userid, name, latestemolog, updated_at) values +(123, 'ichigo.chocomint', '🍎🍋🍇', '2001-01-01 01:01:01'), +(456, 'banana.chocomint', '🍈🍓🍌', '2002-02-02 02:02:02'), +(789, 'pinapple.chocomint', '🍊🥝🍎', '2003-03-03 03:03:03'), +(321, 'apple.chocomint', '🍋🍇🍈', '2004-04-04 04:04:04'), +(654, 'lemon.chocomint', '🍓🍌🍊', '2005-05-05 05:05:05'), +(1919, 'CNN', '🦍🍗🚽', '2005-05-05 05:05:05'), +(810, 'samurai_badass', '🌮🌾🥢', '2005-05-05 05:05:05'), +(114, 'capital_noodle', '💃💃💃', '2005-05-05 05:05:05'), +(514, 'roland_0fficial', '😲😲😲', '2005-05-05 05:05:05') +; + +insert into emolog(userid, friendid, created_at, contents) values +(1, 2, '2006-06-06 06:06:06', '⛰🌋🗻'), +(2, 1, '2007-07-07 07:07:07', '🏘🏠🏡'), +(1, 3, '2008-08-08 08:08:08', '🐒🦍🐒'), +(3, 1, '2009-09-09 09:09:09', '⭐️🌟⭐️'), +(2, 3, '2010-10-10 10:10:10', '🐈🐈🐈') +; + +insert into chat(userid, friendid, contents, create_at) values +(123, 456, 'Hello', '2011-11-11 11:11:11'), +(789, 123, 'Good morning', '2012-12-12 12:12:12'), +(456, 789, 'Good afternoon', '2013-01-13 01:13:13'), +(456, 123, 'Good evening', '2014-02-14 02:14:14'), +(123, 789, 'Good night', '2015-03-15 03:15:15') + +; + +insert into requestfriend(userid, requestfriendid, create_at) values +(12, 34, '2016-04-16 04:16:16'), +(56, 78, '2017-05-17 05:17:17'), +(91, 23, '2018-06-18 06:18:18'), +(45, 67, '2019-07-19 07:19:19'), +(89, 12, '2020-08-20 08:20:20') +; + +insert into users(name, mail, filterlevel) values + ('ichigo.chocomint', 'hoge@hoge.com', 1), + ('banana.chocomint', 'hogehoge@hoge.com', 2), + ('pinapple.chocomint', 'hogehogehoge@hoge.com', 3) +; + +/* END:nakamura */ + diff --git a/pom.xml b/pom.xml index 38894aa..1d459e5 100644 --- a/pom.xml +++ b/pom.xml @@ -16,8 +16,24 @@ 11 + 2.18.0 + + + twitter4j.org + twitter4j.org Repository + http://twitter4j.org/maven2 + + true + + + true + + + + + org.springframework.boot @@ -27,6 +43,16 @@ org.springframework.boot spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.postgresql + postgresql + runtime + org.springframework.boot @@ -48,6 +74,86 @@ + + + com.vdurmont + emoji-java + 4.0.0 + + + + org.seasar.doma.boot + doma-spring-boot-starter + 1.2.1 + + + org.seasar.doma.boot + doma-spring-boot-core + 1.2.1 + + + org.twitter4j + twitter4j-core + [4.0,) + + + + com.ibm.watson + ibm-watson + 8.5.0 + + + + javax.validation + validation-api + 2.0.1.Final + + + org.hibernate.common + hibernate-commons-annotations + 5.1.0.Final + + + org.hibernate + hibernate-validator + 7.0.0.Alpha6 + + + org.projectlombok + lombok + 1.18.12 + + + org.seasar.doma + doma + ${doma.version} + + + + com.vdurmont + emoji-java + 4.0.0 + @@ -55,6 +161,11 @@ org.springframework.boot spring-boot-maven-plugin + + + src/main/resources/twitter4j.properties + + diff --git a/src/main/java/com/example/demo/AppConfig.java b/src/main/java/com/example/demo/AppConfig.java new file mode 100644 index 0000000..cb8dc9c --- /dev/null +++ b/src/main/java/com/example/demo/AppConfig.java @@ -0,0 +1,49 @@ +package com.example.demo; + +import javax.sql.DataSource; + +import org.seasar.doma.SingletonConfig; +import org.seasar.doma.jdbc.Config; +import org.seasar.doma.jdbc.dialect.Dialect; +import org.seasar.doma.jdbc.dialect.PostgresDialect; +import org.seasar.doma.jdbc.tx.LocalTransactionDataSource; +import org.seasar.doma.jdbc.tx.LocalTransactionManager; +import org.seasar.doma.jdbc.tx.TransactionManager; + +/** + * @author Yuta Takayama + */ +@SingletonConfig +public class AppConfig implements Config { + + private static final AppConfig INSTANCE = new AppConfig(); + + private final Dialect dialect; + private final LocalTransactionDataSource dataSource; + private final TransactionManager transactionManager; + + private AppConfig() { + dialect = new PostgresDialect(); + dataSource = new LocalTransactionDataSource("jdbc:postgresql://localhost:5432/sample", "postgres", "postgres"); + transactionManager = new LocalTransactionManager(dataSource.getLocalTransaction(getJdbcLogger())); + } + + @Override + public Dialect getDialect() { + return dialect; + } + + @Override + public DataSource getDataSource() { + return dataSource; + } + + @Override + public TransactionManager getTransactionManager() { + return transactionManager; + } + + public static AppConfig singleton() { + return INSTANCE; + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 452d348..0bbb6c7 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -5,24 +5,30 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @author Yuta Takayama + */ @SpringBootApplication +@EnableScheduling public class DemoApplication implements CommandLineRunner { - public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } - @Autowired - JdbcTemplate jdbcTemplate; - - @Override // アプリ起動時に実行される。 - public void run(String... strings) throws Exception { - jdbcTemplate.execute("CREATE TABLE customers(" + - "id SERIAL, first_name VARCHAR(255), last_name VARCHAR(255))"); - - jdbcTemplate.update("INSERT INTO customers(first_name, last_name) VALUES ('John','Woo')"); - } +// @Autowired +// JdbcTemplate jdbcTemplate; -} + @Override // アプリ起動時に実行される。 + public void run(String... strings) throws Exception { + /* + jdbcTemplate.execute("CREATE TABLE customers(" + + "id SERIAL, first_name VARCHAR(255), last_name VARCHAR(255))"); + + jdbcTemplate.update("INSERT INTO customers(first_name, last_name) VALUES ('John','Woo')"); + */ + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/ScheduledTasks.java b/src/main/java/com/example/demo/ScheduledTasks.java new file mode 100644 index 0000000..78a85b2 --- /dev/null +++ b/src/main/java/com/example/demo/ScheduledTasks.java @@ -0,0 +1,36 @@ +package com.example.demo; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import com.example.demo.service.EmologService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +/** + * @author Yuta Takayama + */ +@Component +public class ScheduledTasks { + + private static final Logger log = LoggerFactory.getLogger(ScheduledTasks.class); + + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); + @Autowired + EmologService emologService; + +// @Scheduled +// fixedDelay: taskの実行完了時点から指定時間後に次のtaskを実行する. 単位はms. +// fixedRate: taskの実行開始時点から指定時間後に次のtaskを実行する. 単位はms. +// initialDelay: 指定時間後に最初のtaskを開始する. 単位はms. fixedDelay又はfixedRateと組み合わせて使用する. +// cron: cronで指定した周期でtaskを実行する. +// zone: cronの起動時間のタイムゾーンを指定する. 未指定時はデフォルトのtimezoneを使用する. +// @Scheduled(fixedRate = 300000) + public void createEmolog() throws Exception { + emologService.createEmolog(); + } +} diff --git a/src/main/java/com/example/demo/ViewController.java b/src/main/java/com/example/demo/ViewController.java deleted file mode 100644 index 430c6be..0000000 --- a/src/main/java/com/example/demo/ViewController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.demo; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMethod; - -@Controller -public class ViewController { - - @RequestMapping(value = "/", method = RequestMethod.GET) - public String View(){ - return "view"; - } - /* - @RequestMapping(value = "/", method = RequestMethod.GET) - public String SayHello(Model model) { - model.addAttribute("msg", "Hello World!!!"); - return "view"; - }*/ -} \ No newline at end of file diff --git a/src/main/java/com/example/demo/common/EmologOutput.java b/src/main/java/com/example/demo/common/EmologOutput.java new file mode 100644 index 0000000..7d5de15 --- /dev/null +++ b/src/main/java/com/example/demo/common/EmologOutput.java @@ -0,0 +1,150 @@ +package com.example.demo.common; + +import com.ibm.cloud.sdk.core.security.IamAuthenticator; +import com.ibm.watson.natural_language_understanding.v1.NaturalLanguageUnderstanding; +import com.ibm.watson.natural_language_understanding.v1.model.*; +import com.ibm.watson.visual_recognition.v3.VisualRecognition; +import com.ibm.watson.visual_recognition.v3.model.*; +import com.vdurmont.emoji.Emoji; +import com.vdurmont.emoji.EmojiManager; +import org.apache.commons.lang3.StringUtils; +import twitter4j.*; + +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.List; + +/** +* @author Yuta Takayama +*/ +public class EmologOutput { + + /** text to keyword + //input: (username, tweet_id) + //output: ArrayList keywords + */ + public List calcKeywords(QueryResult result) throws TwitterException, FileNotFoundException { + + List keywords = new ArrayList(); + + for (Status status : result.getTweets()) { + if(status.getMediaEntities().length > 0) { + String tmp = watsonImage(status.getMediaEntities()[0].getMediaURL()); + if (!StringUtils.isBlank(tmp)) { +// System.out.println(tmp); + keywords.add(tmp); + } + } + String tmp = watsonNLU(status.getText()); + if(!StringUtils.isBlank(tmp)) { +// System.out.println(tmp); + keywords.add(tmp); + } + } + return keywords; + } + + + /** ユーザ名とidからツイート検索 + //input: String username + //input: long tweet_id + //output: QueryResult + */ + public QueryResult querySearch(String username, long tweet_id) throws TwitterException { + // 初期化 + Twitter twitter = new TwitterFactory().getInstance(); + Query query = new Query(); + + //ユーザーネームで指定.sinceId以降のtweetから15個取ってくる.最新のツイートから時系列順に取ってくるっぽい。 + query.setQuery("from:" + username); + query.setSinceId(tweet_id); + + return twitter.search(query); + } + + + /** 文字列からキーワードを抽出する + //input: String text + //output: String keyword + */ + private String watsonNLU(String text) { + IamAuthenticator authenticator = new IamAuthenticator("fVfaYMA7tCh4zInWBhTBb5t69xQryK7ObKl42nampynG"); + NaturalLanguageUnderstanding naturalLanguageUnderstanding = new NaturalLanguageUnderstanding("2019-07-12", authenticator); + naturalLanguageUnderstanding.setServiceUrl("https://api.jp-tok.natural-language-understanding.watson.cloud.ibm.com/instances/ac3df365-93f6-4255-beb8-620d66041251"); + + CategoriesOptions categories= new CategoriesOptions.Builder() + .limit(3) + .build(); + + Features features = new Features.Builder() + .categories(categories) + .build(); + + AnalyzeOptions parameters = new AnalyzeOptions.Builder() + .text(text) + .features(features) + .build(); + + AnalysisResults response = naturalLanguageUnderstanding + .analyze(parameters) + .execute() + .getResult(); + List resultCategories = new ArrayList<>(); + for (CategoriesResult r : response.getCategories()) { + if (r.getScore() > 0.7) { + String[] splitword = r.getLabel().split("/"); + resultCategories.add(splitword[splitword.length - 1]); + } + } +// return resultCategories.toString(); + return response.getCategories().get(0).getLabel(); + } + +// + /** 画像urlからキーワードを抽出する + //input: String imageUrl + //output: String keyword + */ + private String watsonImage(String url) throws FileNotFoundException { + IamAuthenticator authenticator = new IamAuthenticator("8nwN0eKp7eZ73So4DLdPndp_yv-vtlI27pN1wK2TjVg1"); + VisualRecognition visualRecognition = new VisualRecognition("2019-07-12", authenticator); + + ClassifyOptions options = new ClassifyOptions.Builder() + .url(url) + .build(); + ClassifiedImages result = visualRecognition.classify(options).execute().getResult(); + System.out.println(result); + + List images = result.getImages(); + + ClassifiedImage image = images.get(0); + ClassifierResult r = image.getClassifiers().get(0); + ClassResult c = r.getClasses().get(0); + return c.getXClass(); + } + + + /** emoji-javaを使ってキーワードから絵文字に変換 + //input: String keyword + //output: emoji (Unicode) + */ + public static String convertEmoji(String keyword) { + keyword = keyword.replace(" ", "_"); //空白を_に置換 + keyword = ":" + keyword + ":"; + Emoji emoji; + try { + emoji = EmojiManager.getForAlias(keyword); + System.out.println(emoji); + return emoji.getUnicode(); + } catch(java.lang.NullPointerException n) { + //キーワードがエイリアスとして存在していないときは?を返す + System.out.println(n); + emoji = EmojiManager.getForAlias("grey_question"); + return emoji.getUnicode(); + } + } +} + + + + diff --git a/src/main/java/com/example/demo/controller/ChatController.java b/src/main/java/com/example/demo/controller/ChatController.java new file mode 100644 index 0000000..f93bace --- /dev/null +++ b/src/main/java/com/example/demo/controller/ChatController.java @@ -0,0 +1,117 @@ +package com.example.demo.controller; + + +import com.example.demo.entity.Emolog; +import com.example.demo.service.EmologService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; + +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.ui.Model; + +import java.util.List; +import java.util.Map; + +//import java.util.Date; +import com.vdurmont.emoji.EmojiParser; + +import org.springframework.stereotype.Controller; + +//chatページの表示 +/** + * @author Yuta Takayama + */ +@Controller +@RequestMapping(path = "/chat") +public class ChatController { + + @Autowired + JdbcTemplate jdbcTemplate; + + @Autowired + EmologService service; + + @RequestMapping(path = "/{emologid}", method = RequestMethod.GET) + public String chat(@PathVariable("emologid") String emologid, Model model){ + int friendemologId = Integer.parseInt(emologid); + //日付 + //Date date = new Date(); + + String date = "8月18日"; + model.addAttribute("date", date); + + + int u_id = 1; + int f_id = 2; + + Emolog friendEmolog = service.selectById(friendemologId); + Emolog myEmolog = service.selectByDay(friendEmolog); + + //絵文字の表示部分 + //相手側 + model.addAttribute("FriendEmolog", friendEmolog); + //自分側 + //text=MyEmolog; + model.addAttribute("MyEmolog", myEmolog); + + + return "chat"; + } + + /*自分用 + @RequestMapping(path = "/", method = RequestMethod.GET) + public String twitter_connect(Model model){ + model.addAttribute("MyEmolog", "Hello Springboot"); + return "chat"; + }*/ + + + //テキストボックス入力 + /*@RequestMapping(value = "/chat", method = RequestMethod.GET) + public String TextBox(Model model){ + // 空のフォームオブジェクトをModelに設定 + model.addAttribute("MessageBox", new Message()); + // 遷移先を返す(この場合はinput.htmlが遷移先となる) + return "chat"; + }*/ + + /*@RequestMapping(value = "/chat", method = RequestMethod.POST) + public String confirm(@ModelAttribute("MessageBox") Message form,Model model) { + // 空のフォームオブジェクトをModelに設定 + model.addAttribute("MessageBox", new Message()); + + // 遷移先を返す(この場合はconfirm.htmlが遷移先となる) + return "chat"; + }*/ + + + //private static final Logger LOG = LoggerFactory.getLogger(ViewController.class); +/* + @Autowired + JdbcTemplate jdbcTemplate; + + + @RequestMapping(path = "/users", method = RequestMethod.GET) + public String index() { + List> list; + list = jdbcTemplate.queryForList("select * from users"); + return list.toString(); + } + + @RequestMapping(path = "/users/{id}", method = RequestMethod.GET) + public String read(@PathVariable("id") String id) { + List> list; + list = jdbcTemplate.queryForList("select * from users where id = ?", id); + return list.toString(); + } + + + @RequestMapping(path = "/", method = RequestMethod.GET) + public String twitter_connect() throws Exception{ + return ""; + }*/ + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/EmologController.java b/src/main/java/com/example/demo/controller/EmologController.java new file mode 100644 index 0000000..5760aa6 --- /dev/null +++ b/src/main/java/com/example/demo/controller/EmologController.java @@ -0,0 +1,48 @@ +package com.example.demo.controller; + +import com.example.demo.entity.Emolog; +import com.example.demo.entity.Friend; +import com.example.demo.entity.Sample; +import com.example.demo.service.EmologService; +import com.example.demo.service.FriendService; +import com.example.demo.service.SampleService; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Controller +@RequestMapping(path = "/emologlist") +public class EmologController { + + @Autowired + EmologService service; + + @Autowired + FriendService friendService; + + @RequestMapping(value="/{userid}/{friendid}",method=RequestMethod.GET) + public String selectAll(@PathVariable("userid") String userid, @PathVariable("friendid") String friendid, Model model) { + int userId = Integer.parseInt(userid); + int friendId = Integer.parseInt(friendid); + List emologs = service.selectAll(userId, friendId); + Friend friend = friendService.select(userId, friendId); + model.addAttribute("emologs", emologs); + model.addAttribute("friend", friend); + return "emologlist"; + } + + @RequestMapping(path = "/emologlist") + public String chat(Model model){ + return "emologlist"; + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/FriendController.java b/src/main/java/com/example/demo/controller/FriendController.java new file mode 100644 index 0000000..be19e7d --- /dev/null +++ b/src/main/java/com/example/demo/controller/FriendController.java @@ -0,0 +1,37 @@ +package com.example.demo.controller; + +import com.example.demo.entity.Friend; +import com.example.demo.service.FriendService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Controller +@RequestMapping(path = "/") +public class FriendController { + + @Autowired + FriendService service; + + @RequestMapping(value="/{userid}",method=RequestMethod.GET) + public String selectAll(@PathVariable("userid") String userid, Model model) { + int userId = Integer.parseInt(userid); + List friends = service.selectAll(userId); + model.addAttribute("friends", friends); + return "friendlist.html"; + } + + @RequestMapping(path = "/friendlist") + public String chat(Model model) { + return "friendlist"; + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/HtmlController.java b/src/main/java/com/example/demo/controller/HtmlController.java new file mode 100644 index 0000000..ce1749b --- /dev/null +++ b/src/main/java/com/example/demo/controller/HtmlController.java @@ -0,0 +1,101 @@ +package com.example.demo.controller; + +import com.example.demo.common.EmologOutput; +import com.example.demo.service.EmologService; +import com.vdurmont.emoji.EmojiManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.ui.ModelMap; +import com.vdurmont.emoji.EmojiParser; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import twitter4j.TwitterException; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Naoto Nishida + */ +@Controller +@RequestMapping(path = "/") +public class HtmlController { + + @Autowired + EmologService emologService; + + /** + * @author Naoto Nishida + */ + @RequestMapping(path = "/", method = RequestMethod.GET) + public String index() { + return "friendlist"; + } + + /** + * @author Naoto Nishida + */ + @RequestMapping(path = "/emologlist", method = RequestMethod.GET) + public String emologlist() { + return "emologlist"; + } + + /** + * @author Naoto Nishida + */ +//この処理いる?バッチ処理できたらいらなそうな気がする。 + @RequestMapping(path = "/enter", method = RequestMethod.GET) + public String crawling( + ModelMap modelMap + ) throws Exception { + + emologService.createEmolog(); + + //previous実装.バッチ処理したからいらなくなった。 + /** + * List keyword_tweets = new ArrayList(); + * List keyword_images = new ArrayList(); + * + * keyword_tweets = ViewController.get_NLU_keywords("CNN", 100000); + * keyword_images = ViewController.get_image_keywords("CNN", 100000); + * + * List emojiList = new ArrayList(); + * + * // TODO: ここでDBアクセスかなんかlook upする??。->つかささんのやつくっつける。 + * + * // 文字列整形の方(テキトーに::をつける方) + * for( String keyword : keyword_tweets){ + * try{ + * String tmp = EmojiParser.parseToHtmlDecimal(":" + keyword + ":"); + * emojiList.add(tmp); + * } + * catch (NullPointerException ignored){} + * } + * + * for( String keyword : keyword_images){ + * try{ + * String tmp = EmojiParser.parseToHtmlDecimal(":" + keyword + ":"); + * emojiList.add(tmp); + * } + * catch (NullPointerException ignored){} + * } + * + * // で、:hoge:みたいなんが得られたらEmologにパースして、それをaddAttributeする.->データがdbに入っていないとThymeleaf側で取り出せん模様。 + * // modelMap.addAttribute("emologs", emojiList); + * + * + * // emojiList : ["😃", "😃", "😃"] みたいな感じ。 + * // emojiListから一つの文字列に直す。 + * String emolog = String.join("", emojiList); + * + * + * //TODO: ここで得られたemologをdbに登録する処理… + * // emolog(userid, friendid, create_at, contents) + * // userid = 1, friendid = 2, create_at = TIMESTAMP??, contents = emolog + * + * return "friendlist"; + */ + + return "friendlist"; + } +} diff --git a/src/main/java/com/example/demo/controller/ImageController.java b/src/main/java/com/example/demo/controller/ImageController.java new file mode 100644 index 0000000..a2d7d85 --- /dev/null +++ b/src/main/java/com/example/demo/controller/ImageController.java @@ -0,0 +1,59 @@ +//BEGIN:nakamura +package com.example.demo.controller; + +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.ibm.cloud.sdk.core.security.IamAuthenticator; +import com.ibm.watson.natural_language_understanding.v1.model.AnalysisResults; +import com.ibm.watson.natural_language_understanding.v1.model.AnalyzeOptions; +import com.ibm.watson.natural_language_understanding.v1.model.CategoriesResult; +import com.ibm.watson.natural_language_understanding.v1.model.Features; +import com.ibm.watson.visual_recognition.v3.VisualRecognition; +import com.ibm.watson.visual_recognition.v3.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMethod; +import java.io.File; + +@RestController +@RequestMapping(path = "/image") +public class ImageController { + private static final Logger LOG = LoggerFactory.getLogger(ImageController.class); + + @Autowired + JdbcTemplate jdbcTemplate; + + @RequestMapping(path = "/recognition", method = RequestMethod.GET) + public String test( + @RequestParam(name = "img_path", defaultValue = "/Users/NakamuraTsukasa/Desktop/633.png") String img_path, + @RequestParam(name = "img_url", defaultValue = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Jewelkatz_Romeo_Of_Stalker-Bars.jpg") String img_url + ) throws FileNotFoundException { + //String url = "https://zukan.pokemon.co.jp/zukan-api/up/images/index/94b9fb82b38847b83a8041e9a78989ce.png"; + + IamAuthenticator authenticator = new IamAuthenticator("8nwN0eKp7eZ73So4DLdPndp_yv-vtlI27pN1wK2TjVg1"); + VisualRecognition visualRecognition = new VisualRecognition("2019-07-12", authenticator); + + ClassifyOptions options = new ClassifyOptions.Builder() + .url(img_url) + //.imagesFile(new File(img_path)) + .build(); + ClassifiedImages result = visualRecognition.classify(options).execute().getResult(); + //System.out.println(result); + + List images = result.getImages(); + + ClassifiedImage image = images.get(0); + ClassifierResult r = image.getClassifiers().get(0); + ClassResult c = r.getClasses().get(0); + + return c.getXClass(); + + } +} +//END:nakamura \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/NLUController.java b/src/main/java/com/example/demo/controller/NLUController.java new file mode 100644 index 0000000..c016886 --- /dev/null +++ b/src/main/java/com/example/demo/controller/NLUController.java @@ -0,0 +1,67 @@ +package com.example.demo.controller; + + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.ibm.cloud.sdk.core.security.IamAuthenticator; +import com.ibm.watson.natural_language_understanding.v1.NaturalLanguageUnderstanding; +import com.ibm.watson.natural_language_understanding.v1.model.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * @author Yuta Takayama + * 自然言語認識のテストのために作成したコード。 + * 実際のプロダクトには使用していない。 + */ +@RestController +@RequestMapping(path = "/NLU") +public class NLUController { + private static final Logger LOG = LoggerFactory.getLogger(ViewController.class); + + @Autowired + JdbcTemplate jdbcTemplate; + + @RequestMapping(path = "/test", method = RequestMethod.GET) + public String index() { + IamAuthenticator authenticator = new IamAuthenticator("fVfaYMA7tCh4zInWBhTBb5t69xQryK7ObKl42nampynG"); + NaturalLanguageUnderstanding naturalLanguageUnderstanding = new NaturalLanguageUnderstanding("2019-07-12", authenticator); + naturalLanguageUnderstanding.setServiceUrl("https://api.jp-tok.natural-language-understanding.watson.cloud.ibm.com/instances/ac3df365-93f6-4255-beb8-620d66041251"); + String text = "ユーチューバー。2006年からYouTubeやってます。YouTube&SNSフォロワー計2000万人突破。再生回数計120億回突破。UUUM株式会社最高顧問&ファウンダー。インスタTikTokもフォロー是非 ! DM読んでませんので、お仕事、その他コラボ依頼や動画SNS絡みのことは事務所まで"; + + CategoriesOptions categories= new CategoriesOptions.Builder() + .limit(3) + .build(); + + Features features = new Features.Builder() + .categories(categories) + .build(); + + AnalyzeOptions parameters = new AnalyzeOptions.Builder() + .text(text) + .features(features) + .build(); + + AnalysisResults response = naturalLanguageUnderstanding + .analyze(parameters) + .execute() + .getResult(); + List resultCategories = new ArrayList<>(); + for (CategoriesResult r : response.getCategories()) { + if (r.getScore() > 0.7) { + String[] splitword = r.getLabel().split("/"); + resultCategories.add(splitword[splitword.length - 1]); + } + } + + +// return resultCategories.toString(); + return response.getCategories().get(0).getLabel(); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/SampleController.java b/src/main/java/com/example/demo/controller/SampleController.java new file mode 100644 index 0000000..acd8edb --- /dev/null +++ b/src/main/java/com/example/demo/controller/SampleController.java @@ -0,0 +1,35 @@ +package com.example.demo.controller; + +import com.example.demo.entity.Emolog; +import com.example.demo.entity.Sample; +import com.example.demo.service.EmologService; +import com.example.demo.service.SampleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMethod; + +import java.util.List; + +/** + * @author Yuta Takayama + * バックエンドのテストのために作成したコード。 + * 実際のプロダクトには使用していない。 + */ +@RestController +@RequestMapping(path = "/sample") +public class SampleController { + + @Autowired + SampleService service; + + @RequestMapping(value="/users",method=RequestMethod.GET) + public List selectAll() { + return service.selectAll(1); + } + + @RequestMapping(value="/users/add",method=RequestMethod.GET) + public List insert() { + return service.insert(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/TwitterController.java b/src/main/java/com/example/demo/controller/TwitterController.java new file mode 100644 index 0000000..8a420cc --- /dev/null +++ b/src/main/java/com/example/demo/controller/TwitterController.java @@ -0,0 +1,62 @@ +package com.example.demo.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMethod; +import twitter4j.*; + +import java.io.IOException; + +/** + * @author Naoto Nishida + */ +@RestController +@RequestMapping(path = "/twitter") +public class TwitterController { + + /** + * @author Naoto Nishida + */ + @GetMapping("/search_keyword") + public QueryResult search_keyowrd(@RequestParam(name = "searchword", defaultValue = "judo") String searchword) throws TwitterException { + // 初期化 + Twitter twitter = new TwitterFactory().getInstance(); + Query query = new Query(searchword); + + QueryResult result = twitter.search(query); + + // for debug. show tweet results on CLI + for (Status status : result.getTweets()) { + System.out.println("@" + status.getUser().getScreenName() + ":" + status.getText()); + } + + return result; + } + + /** + * @author Naoto Nishida + */ + @RequestMapping(path = "/search_user", method = RequestMethod.GET) + public QueryResult search_user(@RequestParam(name = "username", defaultValue = "CNN") String username, + @RequestParam(name = "tweet_id", defaultValue = "1000000") long tweet_id + ) throws TwitterException { + // 初期化 + Twitter twitter = new TwitterFactory().getInstance(); + Query query = new Query(); + + //ユーザーネームで指定.sinceId以降のtweetから15個取ってくる.最新のツイートから時系列順に取ってくるっぽい。 + query.setQuery("from:" + username); + query.setSinceId(tweet_id); + + QueryResult result = twitter.search(query); + + //for debug on CLI. + for (Status status : result.getTweets()) { + System.out.println("@" + status.getUser().getScreenName() + ":" + status.getText()); + } + + //TODO: ここで取ってきたLatestTweetIdを保存しておいて、次回からそのidのツイート以降のツイートを拾ってくればOK + + return result; + } +} diff --git a/src/main/java/com/example/demo/controller/ViewController.java b/src/main/java/com/example/demo/controller/ViewController.java new file mode 100644 index 0000000..ff49e6b --- /dev/null +++ b/src/main/java/com/example/demo/controller/ViewController.java @@ -0,0 +1,258 @@ +package com.example.demo.controller; + +import java.io.File; +import java.io.FileNotFoundException; +import java.lang.NullPointerException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import com.example.demo.entity.Emolog; +import com.example.demo.service.EmologService; +import com.ibm.cloud.sdk.core.security.IamAuthenticator; +import com.ibm.watson.natural_language_understanding.v1.NaturalLanguageUnderstanding; +import com.ibm.watson.natural_language_understanding.v1.model.*; +import com.ibm.watson.visual_recognition.v3.VisualRecognition; +import com.ibm.watson.visual_recognition.v3.model.*; +import com.vdurmont.emoji.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMethod; +import twitter4j.*; + +@RestController +@RequestMapping(path = "/") +public class ViewController { + private static final Logger LOG = LoggerFactory.getLogger(ViewController.class); + + @Autowired + JdbcTemplate jdbcTemplate; + + @Autowired + EmologService emologService; + + + @RequestMapping(path = "/users", method = RequestMethod.GET) + public String index() { + List> list; + list = jdbcTemplate.queryForList("select * from users"); + return list.toString(); + } + + @RequestMapping(path = "/users/{id}", method = RequestMethod.GET) + public String read(@PathVariable("id") String id) { + List> list; + list = jdbcTemplate.queryForList("select * from users where id = ?", id); + return list.toString(); + } + + /** + * @author Naoto Nishida + */ + //TODO: Controllerのままか、返り値の型の調整どうするか考える(フロントとの兼ね合い。) + @RequestMapping(path = "/twitter_NLU_keyword", method = RequestMethod.GET) + public List collect_NLU_keywords_from_tweets( + @RequestParam(name = "username", defaultValue = "CNN") String username, + @RequestParam(name = "tweet_id", defaultValue = "1000000") long tweet_id + ) throws TwitterException { + QueryResult result = search_user(username, tweet_id); + ArrayList NLU_results = new ArrayList<>(); + + for (Status status : result.getTweets()) { + String tmp = NLU(status.getText()); + if(tmp != null) { +// System.out.println(tmp); + NLU_results.add(tmp); + } + } + + return NLU_results; + //TODO: 整形する必要あるかも? + } + + /** + * @author Naoto Nishida + */ + @RequestMapping(path = "/twitter_image_keyword", method = RequestMethod.GET) + public List collect_image_keywords_from_tweets( + @RequestParam(name = "username", defaultValue = "CNN") String username, + @RequestParam(name = "tweet_id", defaultValue = "1000000") long tweet_id + ) throws Exception { + QueryResult result = search_user(username, tweet_id); + ArrayList imageprocessing_results = new ArrayList<>(); + + for (Status status : result.getTweets()) { + if(status.getMediaEntities().length > 0) { +// System.out.println(status.getMediaEntities()[0].getMediaURL()); + + String tmp = ImageProcessing(status.getMediaEntities()[0].getMediaURL()); + if (tmp != null) { +// System.out.println(tmp); + imageprocessing_results.add(tmp); + } + } + } + + return imageprocessing_results; +// ["call center", "people", "newsreader"]みたいなんがくる。 + + } + + /** + * @author Naoto Nishida + */ + // コントローラは関数として呼び出すのはキツイっぽいのでとりま関数として取り出してる。。 + //TODO: TwitterControllerやNLUControllerから共通部分を分離して別クラスとして保持。 + private static QueryResult search_user(String username, long tweet_id) throws TwitterException { + // 初期化 + Twitter twitter = new TwitterFactory().getInstance(); + Query query = new Query(); + + //ユーザーネームで指定.sinceId以降のtweetから15個取ってくる.最新のツイートから時系列順に取ってくるっぽい。 + query.setQuery("from:" + username); + query.setSinceId(tweet_id); + + return twitter.search(query); + } + + private static String NLU(String text) { + IamAuthenticator authenticator = new IamAuthenticator("fVfaYMA7tCh4zInWBhTBb5t69xQryK7ObKl42nampynG"); + NaturalLanguageUnderstanding naturalLanguageUnderstanding = new NaturalLanguageUnderstanding("2019-07-12", authenticator); + naturalLanguageUnderstanding.setServiceUrl("https://api.jp-tok.natural-language-understanding.watson.cloud.ibm.com/instances/ac3df365-93f6-4255-beb8-620d66041251"); + + CategoriesOptions categories= new CategoriesOptions.Builder() + .limit(3) + .build(); + + Features features = new Features.Builder() + .categories(categories) + .build(); + + AnalyzeOptions parameters = new AnalyzeOptions.Builder() + .text(text) + .features(features) + .build(); + + AnalysisResults response = naturalLanguageUnderstanding + .analyze(parameters) + .execute() + .getResult(); + List resultCategories = new ArrayList<>(); + for (CategoriesResult r : response.getCategories()) { + if (r.getScore() > 0.7) { + String[] splitword = r.getLabel().split("/"); + resultCategories.add(splitword[splitword.length - 1]); + } + } +// return resultCategories.toString(); + return response.getCategories().get(0).getLabel(); + } + + + private static String ImageProcessing(String url) throws FileNotFoundException { + + IamAuthenticator authenticator = new IamAuthenticator("8nwN0eKp7eZ73So4DLdPndp_yv-vtlI27pN1wK2TjVg1"); + VisualRecognition visualRecognition = new VisualRecognition("2019-07-12", authenticator); + + ClassifyOptions options = new ClassifyOptions.Builder() + .url(url) + .build(); + ClassifiedImages result = visualRecognition.classify(options).execute().getResult(); + System.out.println(result); + + List images = result.getImages(); + + ClassifiedImage image = images.get(0); + ClassifierResult r = image.getClassifiers().get(0); + ClassResult c = r.getClasses().get(0); + + return c.getXClass(); + + } + + //BEGIN:nakamura + //emoji-javaを使ってキーワードから絵文字に変換 + @RequestMapping(path = "/convert/{keyword}", method = RequestMethod.GET) + public String convert( + @PathVariable("keyword") String keyword + ) { + keyword = keyword.replace(" ", "_"); //空白を_に置換 + keyword = ":" + keyword + ":"; + Emoji emoji; + try { + emoji = EmojiManager.getForAlias(keyword); + System.out.println(emoji); + return emoji.getUnicode(); + } catch(java.lang.NullPointerException n) { + //キーワードがエイリアスとして存在していないときは?を返す + System.out.println(n); + emoji = EmojiManager.getForAlias("grey_question"); + return emoji.getUnicode(); + } + } + + /** + * @author Yuta Takayama + */ + @RequestMapping(value="/emolog",method=RequestMethod.GET) + public List insertEmolog( + Integer user, + Integer friend, + String emoji + ) throws ParseException { +// return emologService.insert(user, friend, emoji); + return emologService.insert(123, 456, "U+1F600"); + } + //END:nakamura + + /** + * @author Naoto Nishida + */ + //関数もおいちゃえ + public static List get_NLU_keywords(String username, long tweet_id) throws TwitterException { + QueryResult result = search_user(username, tweet_id); + ArrayList NLU_results = new ArrayList<>(); + + for (Status status : result.getTweets()) { + String tmp = NLU(status.getText()); + if(tmp != null) { +// System.out.println(tmp); + NLU_results.add(tmp); + } + } + + return NLU_results; + //TODO: 整形する必要あるかも? + } + + + /** + * @author Naoto Nishida + */ + public static List get_image_keywords(String username, long tweet_id) throws Exception { + QueryResult result = search_user(username, tweet_id); + ArrayList imageprocessing_results = new ArrayList<>(); + + for (Status status : result.getTweets()) { + if(status.getMediaEntities().length > 0) { +// System.out.println(status.getMediaEntities()[0].getMediaURL()); + + String tmp = ImageProcessing(status.getMediaEntities()[0].getMediaURL()); + if (tmp != null) { +// System.out.println(tmp); + imageprocessing_results.add(tmp); + } + } + } + + return imageprocessing_results; +// ["call center", "people", "newsreader"]みたいなんがくる。 + + } + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/dao/EmologDao.java b/src/main/java/com/example/demo/dao/EmologDao.java new file mode 100644 index 0000000..c911921 --- /dev/null +++ b/src/main/java/com/example/demo/dao/EmologDao.java @@ -0,0 +1,37 @@ +package com.example.demo.dao; + +import com.example.demo.entity.Emolog; +import com.example.demo.entity.Sample; +import org.seasar.doma.BatchInsert; +import org.seasar.doma.Dao; +import org.seasar.doma.Insert; +import org.seasar.doma.Select; +import org.seasar.doma.boot.ConfigAutowireable; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Dao +@ConfigAutowireable +public interface EmologDao { + + @Select + List selectAll(int user, int friend); + + @Select + Emolog selectById(int id); + + @Select + Emolog selectByDay(int userid, int friendid, LocalDateTime created_at); + + @Insert + int insert(Emolog e); + + @BatchInsert + int[] insertAll(List e); +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/dao/FriendDao.java b/src/main/java/com/example/demo/dao/FriendDao.java new file mode 100644 index 0000000..f43b1d4 --- /dev/null +++ b/src/main/java/com/example/demo/dao/FriendDao.java @@ -0,0 +1,31 @@ +package com.example.demo.dao; + +import com.example.demo.entity.Emolog; +import com.example.demo.entity.Friend; +import org.seasar.doma.BatchUpdate; +import org.seasar.doma.Dao; +import org.seasar.doma.Select; +import org.seasar.doma.Update; +import org.seasar.doma.boot.ConfigAutowireable; + +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Dao +@ConfigAutowireable +public interface FriendDao { + + @Select + List selectAll(int userid); + + @Select + List selectAllRecord(); + + @BatchUpdate + int[] updateAll(List friends); + + @Select + Friend select(int userid, int friendid); +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/dao/SampleDao.java b/src/main/java/com/example/demo/dao/SampleDao.java new file mode 100644 index 0000000..6eb73cd --- /dev/null +++ b/src/main/java/com/example/demo/dao/SampleDao.java @@ -0,0 +1,25 @@ +package com.example.demo.dao; + +import com.example.demo.entity.Sample; +import org.seasar.doma.*; +import org.seasar.doma.boot.ConfigAutowireable; +import org.springframework.transaction.annotation.Transactional; + +import java.io.Serializable; +import java.util.List; + +@Dao +@ConfigAutowireable +public interface SampleDao{ + + @Select + List selectAll(); + + @Insert + @Transactional + int insert(Sample s); // (6) +// @Update +// int update(Sample s); +// @Delete +// int delete(Sample s); +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/entity/Emolog.java b/src/main/java/com/example/demo/entity/Emolog.java new file mode 100644 index 0000000..2903924 --- /dev/null +++ b/src/main/java/com/example/demo/entity/Emolog.java @@ -0,0 +1,45 @@ +package com.example.demo.entity; + + + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import org.seasar.doma.*; + +import javax.validation.constraints.Max; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @author Yuta Takayama + */ +@Entity +@Data +@Getter +@Setter +@Table(name = "emolog") +public class Emolog implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + Integer id; + + @NotNull + + @Size(max=30) + private Integer userid; + + @NotNull + @Size(max=50) + private Integer friendid; + + @NotNull + @Max(40) + private String contents; + + private LocalDateTime created_at; +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/entity/Friend.java b/src/main/java/com/example/demo/entity/Friend.java new file mode 100644 index 0000000..4c1f414 --- /dev/null +++ b/src/main/java/com/example/demo/entity/Friend.java @@ -0,0 +1,50 @@ +package com.example.demo.entity; + + + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import org.seasar.doma.*; + +import javax.validation.constraints.Max; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @author Yuta Takayama + */ +@Entity +@Data +@Getter +@Setter +public class Friend implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @NotNull + @Size(max=30) + private Integer userid; + + @NotNull + @Size(max=30) + private Integer friendid; + + @NotNull + @Size(max=30) + private String name; + + @Max(30) + private String latestemolog; + + private LocalDateTime updated_at; + + private Long lasttweetid; + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/entity/Sample.java b/src/main/java/com/example/demo/entity/Sample.java new file mode 100644 index 0000000..a23c984 --- /dev/null +++ b/src/main/java/com/example/demo/entity/Sample.java @@ -0,0 +1,39 @@ +package com.example.demo.entity; + + + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import org.seasar.doma.Entity; +import org.seasar.doma.GeneratedValue; +import org.seasar.doma.GenerationType; +import org.seasar.doma.Id; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; + + +@Entity +@Data +@Getter +@Setter +public class Sample implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @NotNull + @Size(min=30) + private String name; + + @NotNull + @Size(min=50) + private String mail; + + private int filterlevel; +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/entity/Users.java b/src/main/java/com/example/demo/entity/Users.java new file mode 100644 index 0000000..44e6c51 --- /dev/null +++ b/src/main/java/com/example/demo/entity/Users.java @@ -0,0 +1,56 @@ +package com.example.demo.entity; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "users") +public class Users { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + private String name; + private String mail; + private int filter_level; + + protected Users() {} + + /** + * コンストラクタ. + * + * @param name ユーザ名 + */ + public Users(String name,String mail,int filter_level) { + this.name = name; + this.mail = mail; + this.filter_level = filter_level; + } + + /*public Users(String name) { + this.name = name; + }*/ + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + + public String getMail() { + return mail; + } + + public int getfilter_level() { + return filter_level; + } + + @Override + public String toString() { + return String.format("{id:%d,name:%s}", id, name); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/repository/EmologRepository.java b/src/main/java/com/example/demo/repository/EmologRepository.java new file mode 100644 index 0000000..6e4782a --- /dev/null +++ b/src/main/java/com/example/demo/repository/EmologRepository.java @@ -0,0 +1,47 @@ +package com.example.demo.repository; + +import com.example.demo.dao.EmologDao; +import com.example.demo.dao.SampleDao; +import com.example.demo.entity.Emolog; +import com.example.demo.entity.Sample; +import org.seasar.doma.BatchInsert; +import org.seasar.doma.Insert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Repository +public class EmologRepository { + + @Autowired + EmologDao dao; + + public List selectAll(int user, int friend) { // (4) + return dao.selectAll(user, friend); + } + + + public Emolog selectById(int friendemologId){ + return dao.selectById(friendemologId); + } + + public Emolog selectByDay(int userid, int friendid, LocalDateTime created_at){ + return dao.selectByDay(userid, friendid, created_at); + } + + @Insert + public int insert(Emolog e) { + return dao.insert(e); + } + + @BatchInsert + public int[] insertAll(List emologs){ + return dao.insertAll(emologs); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/repository/FriendRepository.java b/src/main/java/com/example/demo/repository/FriendRepository.java new file mode 100644 index 0000000..37da9d4 --- /dev/null +++ b/src/main/java/com/example/demo/repository/FriendRepository.java @@ -0,0 +1,36 @@ +package com.example.demo.repository; + +import com.example.demo.dao.FriendDao; +import com.example.demo.entity.Friend; +import org.seasar.doma.BatchUpdate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Repository +public class FriendRepository { + + @Autowired + FriendDao dao; + + public List selectAll(int user) { // (4) + return dao.selectAll(user); + } + + public List selectAllRecord(){ + return dao.selectAllRecord(); + } + + @BatchUpdate + public int[] updateAll(List friends){ + return dao.updateAll(friends); + } + + public Friend select(int userid, int friendid){ + return dao.select(userid, friendid); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/repository/SampleRepository.java b/src/main/java/com/example/demo/repository/SampleRepository.java new file mode 100644 index 0000000..86396e4 --- /dev/null +++ b/src/main/java/com/example/demo/repository/SampleRepository.java @@ -0,0 +1,30 @@ +package com.example.demo.repository; + +import com.example.demo.dao.SampleDao; +import com.example.demo.entity.Sample; +import org.seasar.doma.Insert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public class SampleRepository{ + + @Autowired + SampleDao dao; + + public List selectAll() { // (4) + return dao.selectAll(); + } + @Insert + public int insert(Sample s) { + return dao.insert(s); + } // (6) +// @Update +// int update(Sample s); +// @Delete +// int delete(Sample s); +// @Select +// long countByFinished(boolean finished); +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/repository/UsersRepository.java b/src/main/java/com/example/demo/repository/UsersRepository.java new file mode 100644 index 0000000..d115b14 --- /dev/null +++ b/src/main/java/com/example/demo/repository/UsersRepository.java @@ -0,0 +1,9 @@ +package com.example.demo.repository; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import com.example.demo.entity.Users; + +@Repository +public interface UsersRepository extends CrudRepository { +} diff --git a/src/main/java/com/example/demo/repository/ViewRepository.java b/src/main/java/com/example/demo/repository/ViewRepository.java new file mode 100644 index 0000000..0f2f810 --- /dev/null +++ b/src/main/java/com/example/demo/repository/ViewRepository.java @@ -0,0 +1,5 @@ +package com.example.demo.repository; + +public class ViewRepository { + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/service/EmologService.java b/src/main/java/com/example/demo/service/EmologService.java new file mode 100644 index 0000000..0947276 --- /dev/null +++ b/src/main/java/com/example/demo/service/EmologService.java @@ -0,0 +1,111 @@ +package com.example.demo.service; + +import com.example.demo.common.EmologOutput; +import com.example.demo.controller.ViewController; +import com.example.demo.entity.Emolog; +import com.example.demo.entity.Friend; +import com.example.demo.repository.EmologRepository; +import com.example.demo.repository.FriendRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.ui.ModelMap; +import twitter4j.QueryResult; +import twitter4j.TwitterException; + +import javax.validation.constraints.Null; +import java.text.ParseException; +import java.time.LocalDateTime; +import java.util.*; + +/** + * @author Yuta Takayama + */ +@Service +public class EmologService { + + @Autowired + EmologRepository emologRepository; + + @Autowired + FriendRepository friendRepository; + +// @Autowired + EmologOutput emologOutput; + + + public Emolog selectById(int friendemologId){ + return emologRepository.selectById(friendemologId); + } + + public Emolog selectByDay(Emolog friendEmolog){ + return emologRepository.selectByDay(friendEmolog.getFriendid(), friendEmolog.getUserid(), friendEmolog.getCreated_at()); + } + + public List selectAll(int user, int friend){ + return emologRepository.selectAll(user, friend); + } + + //BEGIN:nakamura + public List insert(int user, int friend, String contents) throws ParseException { + Emolog e = new Emolog(); + e.setId((int)Calendar.getInstance().getTimeInMillis()); + e.setUserid(user); + e.setFriendid(friend); + LocalDateTime created_at = LocalDateTime.now(); + e.setCreated_at(created_at); + e.setContents(contents); + emologRepository.insert(e); + return emologRepository.selectAll(user, friend); + } + //END:nakamura + + /** + * @author Yuta Takayama + */ + public void createEmolog() throws Exception { + List friends = friendRepository.selectAllRecord(); + + List newEmologs = new ArrayList(); + LocalDateTime created_at = LocalDateTime.now(); + int count = 0; + for (Friend friend : friends) { + try { + QueryResult result = emologOutput.querySearch(friend.getName(), friend.getLasttweetid()); + + List keywords = emologOutput.calcKeywords(result); + + List emojiList = new ArrayList(); + + for( String keyword : keywords){ + emojiList.add(EmologOutput.convertEmoji(keyword)); + } + + // emojiList : ["😃", "😃", "😃"] みたいな感じ。 + // emojiListから一つの文字列に直す。 + String emologStr = String.join("", emojiList); + + ////////// + friend.setLatestemolog(emologStr); + friend.setUpdated_at(created_at); + friend.setLasttweetid(result.getMaxId()); + Emolog e = new Emolog(); + e.setContents(emologStr); + e.setFriendid(friend.getId()); + e.setUserid(friend.getUserid()); + e.setCreated_at(created_at); + e.setId((int) Calendar.getInstance().getTimeInMillis() + count); +// newEmologs.add(e); + emologRepository.insert(e); + count++; + + } + catch(NullPointerException e){ } + } + + friendRepository.updateAll(friends); +// emologRepository.insertAll(newEmologs); + + + } + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/service/FriendService.java b/src/main/java/com/example/demo/service/FriendService.java new file mode 100644 index 0000000..7df9670 --- /dev/null +++ b/src/main/java/com/example/demo/service/FriendService.java @@ -0,0 +1,26 @@ +package com.example.demo.service; + +import com.example.demo.entity.Friend; +import com.example.demo.repository.FriendRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Service +public class FriendService { + + @Autowired + FriendRepository repository; + + public List selectAll(int user){ + return repository.selectAll(user); + } + + public Friend select(int userid, int friendid){ + return repository.select(userid, friendid); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/service/SampleService.java b/src/main/java/com/example/demo/service/SampleService.java new file mode 100644 index 0000000..33debf1 --- /dev/null +++ b/src/main/java/com/example/demo/service/SampleService.java @@ -0,0 +1,34 @@ +package com.example.demo.service; + +import com.example.demo.entity.Sample; +import com.example.demo.repository.SampleRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author Yuta Takayama + */ +@Service +public class SampleService { + + + @Autowired + SampleRepository repository; + + public List selectAll(int id){ + return repository.selectAll(); + } + + public List insert(){ + Sample dummy = new Sample(); + dummy.setName("田中"); + dummy.setMail("dummy@mail"); + dummy.setFilterlevel(1); + repository.insert(dummy); + return repository.selectAll(); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/service/ViewService.java b/src/main/java/com/example/demo/service/ViewService.java new file mode 100644 index 0000000..f047c5a --- /dev/null +++ b/src/main/java/com/example/demo/service/ViewService.java @@ -0,0 +1,5 @@ +package com.example.demo.service; + +public class ViewService { + +} \ No newline at end of file diff --git a/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectAll.sql b/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectAll.sql new file mode 100644 index 0000000..0753c67 --- /dev/null +++ b/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectAll.sql @@ -0,0 +1,10 @@ +--/** +--* @author Yuta Takayama +--*/ +select * +from emolog +where +userid = /* user */1 +and +friendid = /* friend */1 +order by created_at diff --git a/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectByDay.sql b/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectByDay.sql new file mode 100644 index 0000000..5ff952d --- /dev/null +++ b/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectByDay.sql @@ -0,0 +1,11 @@ +--/** +--* @author Yuta Takayama +--*/ +select * +from emolog +where +userid = /* userid */1 +and +friendid = /* friendid */1 +and +created_at = /* created_at */'2010-10-10 10:10:10' \ No newline at end of file diff --git a/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectById.sql b/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectById.sql new file mode 100644 index 0000000..26d01b5 --- /dev/null +++ b/src/main/resources/META-INF/com/example/demo/dao/EmologDao/selectById.sql @@ -0,0 +1,7 @@ +--/** +--* @author Yuta Takayama +--*/ +select * +from emolog +where +id = /* id */1 \ No newline at end of file diff --git a/src/main/resources/META-INF/com/example/demo/dao/FriendDao/select.sql b/src/main/resources/META-INF/com/example/demo/dao/FriendDao/select.sql new file mode 100644 index 0000000..ae7e613 --- /dev/null +++ b/src/main/resources/META-INF/com/example/demo/dao/FriendDao/select.sql @@ -0,0 +1,10 @@ +--/** +--* @author Yuta Takayama +--*/ + +select * +from friend +where +userid = /* userid */1 +and +friendid = /* friendid */2 \ No newline at end of file diff --git a/src/main/resources/META-INF/com/example/demo/dao/FriendDao/selectAll.sql b/src/main/resources/META-INF/com/example/demo/dao/FriendDao/selectAll.sql new file mode 100644 index 0000000..075aac0 --- /dev/null +++ b/src/main/resources/META-INF/com/example/demo/dao/FriendDao/selectAll.sql @@ -0,0 +1,7 @@ +--/** +--* @author Yuta Takayama +--*/ +select * +from friend +where userid = /* userid */1 +order by updated_at \ No newline at end of file diff --git a/src/main/resources/META-INF/com/example/demo/dao/FriendDao/selectAllRecord.sql b/src/main/resources/META-INF/com/example/demo/dao/FriendDao/selectAllRecord.sql new file mode 100644 index 0000000..4cb574e --- /dev/null +++ b/src/main/resources/META-INF/com/example/demo/dao/FriendDao/selectAllRecord.sql @@ -0,0 +1,5 @@ +--/** +--* @author Yuta Takayama +--*/ +select * +from friend \ No newline at end of file diff --git a/src/main/resources/META-INF/com/example/demo/dao/SampleDao/selectAll.sql b/src/main/resources/META-INF/com/example/demo/dao/SampleDao/selectAll.sql new file mode 100644 index 0000000..ae728ef --- /dev/null +++ b/src/main/resources/META-INF/com/example/demo/dao/SampleDao/selectAll.sql @@ -0,0 +1,2 @@ +select * +From sample \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4060d13..65d215d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,8 +1,22 @@ -spring.datasource.data-source-class-name=org.h2.Driver -spring.datasource.url=jdbc:h2:mem:emologdb -spring.datasource.username=dbuser -spring.datasource.password=dm +# spring.datasource.data-source-class-name=org.h2.Driver +# spring.datasource.url=jdbc:h2:mem:emologdb +# spring.datasource.username=dbuser +# spring.datasource.password=dm spring.h2.console.enabled=true spring.h2.console.path=/h2-console -spring.h2.console.settings.web-allow-others=true \ No newline at end of file +spring.h2.console.settings.web-allow-others=true + +spring.datasource.driver-class-name=org.postgresql.Driver +spring.datasource.url=jdbc:postgresql://localhost:5432/test_db +spring.datasource.username=postgres +spring.datasource.password=postgres + +jsonStoreEnabled=true + +spring.thymeleaf.prefix=classpath:/templates/ +spring.thymeleaf.suffix=.html +spring.thymeleaf.mode=LEGACYHTML5 +spring.thymeleaf.encoding=UTF-8 +spring.thymeleaf.content-type=text/html + diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 091464e..e16fb0e 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -1,13 +1,27 @@ -@@charset "UTF-8"; +@charset "UTF-8"; +html,body { + padding: 0; + margin: 0; + height: 100%; + overflow: hidden; +} body { - margin: 0; - padding: 0; - background-color: #d3d3d3; + background-color: #ffffff; color: #000000; font-size: 15x; line-height: 2; - overflow: hidden; +} + +h1 { + font-size:100px; + line-height: 1; + color:#000000; + font-family: 'Bitter',serif; +} + +p { + font-family: 'Bitter',serif; } p,h1,h2,h3,h4,h5,h6 { @@ -19,6 +33,7 @@ img { } ul { + list-style: none; margin: 0; padding: 0; } @@ -36,28 +51,35 @@ a:hover { text-decoration: underline; } -header { +.header { width: 960px; - height: 100px; margin: 0 auto; border: solid 1px #000000; + height: 15%; } - -.backbtn { - float: left; +#wrap { + clear: both; + padding: 0; + margin: 0; + height: 85%; } -.friend-name { - text-align: center; - padding: 20px 0; - font-size: 20px; - font-family: 'Bitter',serif; - margin-right: 50px; +.content { + width: 960px; + margin: 0 auto; + height: 100%; + background-color: #fffacd; } .global-nav { + height: 10%; width: 100%; + + width: 960px; + margin: 0 auto; + position: fixed; + bottom: 0; } .global-nav li{ @@ -82,56 +104,64 @@ header { text-decoration: none; } -#wrap { - clear: both; -} +/* chat.html 部分*/ -.content { - width: 960px; - margin: 0 auto; +.friend-name { + font-size: 20px; + font-family: 'Bitter',serif; } - -footer { - width: 960px; - margin: 0 auto; - text-align: center; - padding: 20px 20px; +ul.header_ul{ + width: 100%; } - -header { - width: 960px; - height: 100px; - margin: 0 auto; - border: solid 1px #000000; +ul.header_ul li{ + display: inline-block; + vertical-align:middle; + margin: 0; + padding: 0; + width: 45%; } .emolog { + margin: 0; + width: 100%; + height: 30%; background-color: #f5f5f5; - padding: 10px 5px; - text-align: center; + padding: 5px 5px; } - -.emolog-date { - text-align: left; - margin: 10px 10px; - font-size: 20px; - font-family: 'Bitter',serif; -} - -.emoji { +.chat { + padding: 0; margin: 0; + background-color: #fffacd; + height: 55%; +} +.message { padding: 0; + margin: 0; + height: 15%; + background-color: #FFFFFF; } -.chat { - height: 300px; - background-color: #fffacd; +.emolog_ul { + width: 100%; + } -.message { - padding: 0; - text-align: center; +.emolog_ul li { + text-align: center; + display: inline-block; + vertical-align:middle; + margin: 0; + padding: 0; +} +.emolog_ul li.emolog-date-cover { + vertical-align:top; + width: 10%; } + +.emolog_ul li.emolog-show { + width: 80%; +} + .message-box { width: 77%; text-align: left; @@ -142,29 +172,15 @@ header { .message-btn { width: 20%; margin: 0 0; -} - -.message-btn{ background-color: #009cd3; color: #ffffff; font-size: 20px; font-family: 'Bitter',serif; } -h1 { - font-size:100px; - line-height: 1; - color:#000000; - font-family: 'Bitter',serif; -} - -p { - font-family: 'Bitter',serif; -} - /* emologlist.html*/ .emolog-list { - height: 400px; + height: 90%; background-color: #f5f5f5; overflow: auto; } @@ -173,5 +189,47 @@ p { list-style: none; text-align: center; } +.emolog-date { + float: left; + text-align: left; + margin: 5px -5px 0 0; + font-size: 18px; + font-family: 'Bitter',serif; +} /* emologlist.html 終わり*/ +/* friendlist.html*/ +.header_ul_friendlist { + width: 100%; + height: 100%; + text-align: center; +} +.header_ul_friendlist li{ + text-align: center; + display: inline-block; + vertical-align:middle; + margin: 0; + padding: 0; +} +li .add_img { + /*float: right;*/ + width: 50%; + padding: 5px; + height: auto; +} +.header_ul_friendlist li.add-img-wrap{ + width: 10%; +} +.header_ul_friendlist li.adjust-name { + margin:0; + width: 10%; + height: auto; +} +.header_ul_friendlist li.friend-header-name { + width: 70%; + /*text-align: center;*/ + font-size: 18px; + font-family: 'Bitter',serif; +} + +/* friendlist.html終わり*/ diff --git a/src/main/resources/templates/chat.html b/src/main/resources/templates/chat.html new file mode 100644 index 0000000..5362b49 --- /dev/null +++ b/src/main/resources/templates/chat.html @@ -0,0 +1,65 @@ + + + + + チャットページ + + + + + + +
+
    +
  • + backbutton +
  • +
  • +
    +

    hogeさん

    +
    +
  • +
+
+
+
+ +
+
    +
  • +

    8/18

    +
  • +
  • + + +

    +

    emolog_arrow

    + +

    +
  • +
+ +
+ +
+ + + +
+ +
+ +
+ + +
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/resources/templates/emologlist.html b/src/main/resources/templates/emologlist.html new file mode 100644 index 0000000..902c5ed --- /dev/null +++ b/src/main/resources/templates/emologlist.html @@ -0,0 +1,87 @@ + + + + + + エモログリストページ + + + + +
+
    +
  • + backbutton +
  • +
  • +
    +

    hogeさん

    +
    +
  • +
+
+ +
+
+ +
+ + +
+ + +
+
+
+ + +
+ + diff --git a/src/main/resources/templates/friendlist.html b/src/main/resources/templates/friendlist.html new file mode 100644 index 0000000..48a3ace --- /dev/null +++ b/src/main/resources/templates/friendlist.html @@ -0,0 +1,54 @@ + + + + + フレンドリストページ + + + + +
+
    +
  • +
  • +

    友だち

    +
  • +
  • + backbutton +
  • +
+
+ + +
+ + +
+ + diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html new file mode 100644 index 0000000..183fa7c --- /dev/null +++ b/src/main/resources/templates/index.html @@ -0,0 +1,10 @@ + + + + + index + + +ENTER!! + + \ No newline at end of file diff --git a/src/main/resources/templates/view.html b/src/main/resources/templates/view.html index 6cad663..3b1a5a3 100644 --- a/src/main/resources/templates/view.html +++ b/src/main/resources/templates/view.html @@ -1,17 +1,17 @@ - + チャットページ - +
- backbutton + backbutton

hogeさん

@@ -22,10 +22,10 @@

8/18

- -

🍉🍉🍉🍉🍉🍉🍉

-

emolog_arrow

+

🍉🍉🍉🍉🍉🍉🍉

+

emolog_arrow

+

🍉🍉🍉🍉🍉🍉🍉

diff --git a/src/main/resources/twitter4j.properties b/src/main/resources/twitter4j.properties new file mode 100644 index 0000000..e4aef1c --- /dev/null +++ b/src/main/resources/twitter4j.properties @@ -0,0 +1,6 @@ +debug=true +oauth.consumerKey= 53i2wkDRrQjw4zUkHdTpgxxTx +oauth.consumerSecret= dpgXNsrU8Tk2JZYG9tt6cVpHvcsGb7lq1RwxK2Ibe45aMV6eTT +oauth.accessToken= 211508041-deXZlvTpwU7mCNuWVulUjf0eJ1ERiw3UDuz6QCeA +oauth.accessTokenSecret= 59Ms0KaBdTJnqbSqHK1NDjG2MtgxHl56qyRinZphGO3DN + diff --git a/target/classes/application.properties b/target/classes/application.properties index 4060d13..65d215d 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,8 +1,22 @@ -spring.datasource.data-source-class-name=org.h2.Driver -spring.datasource.url=jdbc:h2:mem:emologdb -spring.datasource.username=dbuser -spring.datasource.password=dm +# spring.datasource.data-source-class-name=org.h2.Driver +# spring.datasource.url=jdbc:h2:mem:emologdb +# spring.datasource.username=dbuser +# spring.datasource.password=dm spring.h2.console.enabled=true spring.h2.console.path=/h2-console -spring.h2.console.settings.web-allow-others=true \ No newline at end of file +spring.h2.console.settings.web-allow-others=true + +spring.datasource.driver-class-name=org.postgresql.Driver +spring.datasource.url=jdbc:postgresql://localhost:5432/test_db +spring.datasource.username=postgres +spring.datasource.password=postgres + +jsonStoreEnabled=true + +spring.thymeleaf.prefix=classpath:/templates/ +spring.thymeleaf.suffix=.html +spring.thymeleaf.mode=LEGACYHTML5 +spring.thymeleaf.encoding=UTF-8 +spring.thymeleaf.content-type=text/html + diff --git a/target/classes/com/example/demo/DemoApplication.class b/target/classes/com/example/demo/DemoApplication.class deleted file mode 100644 index 0fcc45f..0000000 Binary files a/target/classes/com/example/demo/DemoApplication.class and /dev/null differ diff --git a/target/classes/com/example/demo/ViewController.class b/target/classes/com/example/demo/ViewController.class deleted file mode 100644 index b0bff05..0000000 Binary files a/target/classes/com/example/demo/ViewController.class and /dev/null differ diff --git a/target/classes/static/css/style.css b/target/classes/static/css/style.css index 091464e..e16fb0e 100644 --- a/target/classes/static/css/style.css +++ b/target/classes/static/css/style.css @@ -1,13 +1,27 @@ -@@charset "UTF-8"; +@charset "UTF-8"; +html,body { + padding: 0; + margin: 0; + height: 100%; + overflow: hidden; +} body { - margin: 0; - padding: 0; - background-color: #d3d3d3; + background-color: #ffffff; color: #000000; font-size: 15x; line-height: 2; - overflow: hidden; +} + +h1 { + font-size:100px; + line-height: 1; + color:#000000; + font-family: 'Bitter',serif; +} + +p { + font-family: 'Bitter',serif; } p,h1,h2,h3,h4,h5,h6 { @@ -19,6 +33,7 @@ img { } ul { + list-style: none; margin: 0; padding: 0; } @@ -36,28 +51,35 @@ a:hover { text-decoration: underline; } -header { +.header { width: 960px; - height: 100px; margin: 0 auto; border: solid 1px #000000; + height: 15%; } - -.backbtn { - float: left; +#wrap { + clear: both; + padding: 0; + margin: 0; + height: 85%; } -.friend-name { - text-align: center; - padding: 20px 0; - font-size: 20px; - font-family: 'Bitter',serif; - margin-right: 50px; +.content { + width: 960px; + margin: 0 auto; + height: 100%; + background-color: #fffacd; } .global-nav { + height: 10%; width: 100%; + + width: 960px; + margin: 0 auto; + position: fixed; + bottom: 0; } .global-nav li{ @@ -82,56 +104,64 @@ header { text-decoration: none; } -#wrap { - clear: both; -} +/* chat.html 部分*/ -.content { - width: 960px; - margin: 0 auto; +.friend-name { + font-size: 20px; + font-family: 'Bitter',serif; } - -footer { - width: 960px; - margin: 0 auto; - text-align: center; - padding: 20px 20px; +ul.header_ul{ + width: 100%; } - -header { - width: 960px; - height: 100px; - margin: 0 auto; - border: solid 1px #000000; +ul.header_ul li{ + display: inline-block; + vertical-align:middle; + margin: 0; + padding: 0; + width: 45%; } .emolog { + margin: 0; + width: 100%; + height: 30%; background-color: #f5f5f5; - padding: 10px 5px; - text-align: center; + padding: 5px 5px; } - -.emolog-date { - text-align: left; - margin: 10px 10px; - font-size: 20px; - font-family: 'Bitter',serif; -} - -.emoji { +.chat { + padding: 0; margin: 0; + background-color: #fffacd; + height: 55%; +} +.message { padding: 0; + margin: 0; + height: 15%; + background-color: #FFFFFF; } -.chat { - height: 300px; - background-color: #fffacd; +.emolog_ul { + width: 100%; + } -.message { - padding: 0; - text-align: center; +.emolog_ul li { + text-align: center; + display: inline-block; + vertical-align:middle; + margin: 0; + padding: 0; +} +.emolog_ul li.emolog-date-cover { + vertical-align:top; + width: 10%; } + +.emolog_ul li.emolog-show { + width: 80%; +} + .message-box { width: 77%; text-align: left; @@ -142,29 +172,15 @@ header { .message-btn { width: 20%; margin: 0 0; -} - -.message-btn{ background-color: #009cd3; color: #ffffff; font-size: 20px; font-family: 'Bitter',serif; } -h1 { - font-size:100px; - line-height: 1; - color:#000000; - font-family: 'Bitter',serif; -} - -p { - font-family: 'Bitter',serif; -} - /* emologlist.html*/ .emolog-list { - height: 400px; + height: 90%; background-color: #f5f5f5; overflow: auto; } @@ -173,5 +189,47 @@ p { list-style: none; text-align: center; } +.emolog-date { + float: left; + text-align: left; + margin: 5px -5px 0 0; + font-size: 18px; + font-family: 'Bitter',serif; +} /* emologlist.html 終わり*/ +/* friendlist.html*/ +.header_ul_friendlist { + width: 100%; + height: 100%; + text-align: center; +} +.header_ul_friendlist li{ + text-align: center; + display: inline-block; + vertical-align:middle; + margin: 0; + padding: 0; +} +li .add_img { + /*float: right;*/ + width: 50%; + padding: 5px; + height: auto; +} +.header_ul_friendlist li.add-img-wrap{ + width: 10%; +} +.header_ul_friendlist li.adjust-name { + margin:0; + width: 10%; + height: auto; +} +.header_ul_friendlist li.friend-header-name { + width: 70%; + /*text-align: center;*/ + font-size: 18px; + font-family: 'Bitter',serif; +} + +/* friendlist.html終わり*/ diff --git a/target/classes/templates/view.html b/target/classes/templates/view.html index 6cad663..3b1a5a3 100644 --- a/target/classes/templates/view.html +++ b/target/classes/templates/view.html @@ -1,17 +1,17 @@ - + チャットページ - +
- backbutton + backbutton

hogeさん

@@ -22,10 +22,10 @@

8/18

- -

🍉🍉🍉🍉🍉🍉🍉

-

emolog_arrow

+

🍉🍉🍉🍉🍉🍉🍉

+

emolog_arrow

+

🍉🍉🍉🍉🍉🍉🍉

diff --git a/target/demo-0.0.1-SNAPSHOT.jar b/target/demo-0.0.1-SNAPSHOT.jar deleted file mode 100644 index 89c86c4..0000000 Binary files a/target/demo-0.0.1-SNAPSHOT.jar and /dev/null differ diff --git a/target/demo-0.0.1-SNAPSHOT.jar.original b/target/demo-0.0.1-SNAPSHOT.jar.original deleted file mode 100644 index 7badc60..0000000 Binary files a/target/demo-0.0.1-SNAPSHOT.jar.original and /dev/null differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties deleted file mode 100644 index b665b7b..0000000 --- a/target/maven-archiver/pom.properties +++ /dev/null @@ -1,3 +0,0 @@ -artifactId=demo -groupId=com.example -version=0.0.1-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index 28d74ec..0000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ /dev/null @@ -1,2 +0,0 @@ -com/example/demo/ViewController.class -com/example/demo/DemoApplication.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index ebecdfb..0000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1,2 +0,0 @@ -/projects/java-web-spring/src/main/java/com/example/demo/ViewController.java -/projects/java-web-spring/src/main/java/com/example/demo/DemoApplication.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst deleted file mode 100644 index 0beff15..0000000 --- a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +++ /dev/null @@ -1 +0,0 @@ -com/example/demo/DemoApplicationTests.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst deleted file mode 100644 index 3af2bda..0000000 --- a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +++ /dev/null @@ -1 +0,0 @@ -/projects/java-web-spring/src/test/java/com/example/demo/DemoApplicationTests.java diff --git a/target/surefire-reports/TEST-com.example.demo.DemoApplicationTests.xml b/target/surefire-reports/TEST-com.example.demo.DemoApplicationTests.xml deleted file mode 100644 index ce2065b..0000000 --- a/target/surefire-reports/TEST-com.example.demo.DemoApplicationTests.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/target/surefire-reports/com.example.demo.DemoApplicationTests.txt b/target/surefire-reports/com.example.demo.DemoApplicationTests.txt deleted file mode 100644 index 3329809..0000000 --- a/target/surefire-reports/com.example.demo.DemoApplicationTests.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: com.example.demo.DemoApplicationTests -------------------------------------------------------------------------------- -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.925 s - in com.example.demo.DemoApplicationTests diff --git a/target/surefire/surefire8780732067722308554tmp b/target/surefire/surefire8780732067722308554tmp deleted file mode 100644 index dc2058b..0000000 --- a/target/surefire/surefire8780732067722308554tmp +++ /dev/null @@ -1,104 +0,0 @@ -#surefire -#Wed Aug 05 11:54:18 UTC 2020 -includes1=**/*Test.java -includes2=**/*Tests.java -includes0=**/Test*.java -classPathUrl.50=/home/user/.m2/repository/org/junit/jupiter/junit-jupiter/5.6.2/junit-jupiter-5.6.2.jar -classPathUrl.51=/home/user/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.6.2/junit-jupiter-api-5.6.2.jar -classPathUrl.52=/home/user/.m2/repository/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar -surefireClassPathUrl.0=/home/user/.m2/repository/org/apache/maven/surefire/surefire-junit-platform/2.22.2/surefire-junit-platform-2.22.2.jar -classPathUrl.53=/home/user/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar -classPathUrl.54=/home/user/.m2/repository/org/junit/platform/junit-platform-commons/1.6.2/junit-platform-commons-1.6.2.jar -classPathUrl.55=/home/user/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.6.2/junit-jupiter-params-5.6.2.jar -systemExitTimeout=30 -classPathUrl.56=/home/user/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.6.2/junit-jupiter-engine-5.6.2.jar -failFastCount=0 -classPathUrl.57=/home/user/.m2/repository/org/junit/platform/junit-platform-engine/1.6.2/junit-platform-engine-1.6.2.jar -includes3=**/*TestCase.java -classPathUrl.58=/home/user/.m2/repository/org/mockito/mockito-core/3.3.3/mockito-core-3.3.3.jar -classPathUrl.48=/home/user/.m2/repository/org/assertj/assertj-core/3.16.1/assertj-core-3.16.1.jar -classPathUrl.49=/home/user/.m2/repository/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar -runStatisticsFile=/projects/java-web-spring/.surefire-562CF7FF7C8FD0A0AE849BB2CF6B1351D40FD73C -classPathUrl.60=/home/user/.m2/repository/net/bytebuddy/byte-buddy-agent/1.10.13/byte-buddy-agent-1.10.13.jar -classPathUrl.61=/home/user/.m2/repository/org/objenesis/objenesis/2.6/objenesis-2.6.jar -classPathUrl.62=/home/user/.m2/repository/org/mockito/mockito-junit-jupiter/3.3.3/mockito-junit-jupiter-3.3.3.jar -classPathUrl.63=/home/user/.m2/repository/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar -classPathUrl.64=/home/user/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar -classPathUrl.65=/home/user/.m2/repository/org/springframework/spring-core/5.2.8.RELEASE/spring-core-5.2.8.RELEASE.jar -classPathUrl.66=/home/user/.m2/repository/org/springframework/spring-jcl/5.2.8.RELEASE/spring-jcl-5.2.8.RELEASE.jar -classPathUrl.67=/home/user/.m2/repository/org/springframework/spring-test/5.2.8.RELEASE/spring-test-5.2.8.RELEASE.jar -classPathUrl.68=/home/user/.m2/repository/org/xmlunit/xmlunit-core/2.7.0/xmlunit-core-2.7.0.jar -classPathUrl.59=/home/user/.m2/repository/net/bytebuddy/byte-buddy/1.10.13/byte-buddy-1.10.13.jar -surefireClassPathUrl.3=/home/user/.m2/repository/org/apache/maven/surefire/surefire-logger-api/2.22.2/surefire-logger-api-2.22.2.jar -surefireClassPathUrl.1=/home/user/.m2/repository/org/junit/platform/junit-platform-launcher/1.3.1/junit-platform-launcher-1.3.1.jar -surefireClassPathUrl.2=/home/user/.m2/repository/org/apache/maven/surefire/surefire-api/2.22.2/surefire-api-2.22.2.jar -enableAssertions=true -runOrder=filesystem -reportsDirectory=/projects/java-web-spring/target/surefire-reports -tc.0=com.example.demo.DemoApplicationTests -requestedTest= -testClassesDirectory=/projects/java-web-spring/target/test-classes -preferTestsFromInStream=false -providerConfiguration=org.apache.maven.surefire.junitplatform.JUnitPlatformProvider -rerunFailingTestsCount=0 -failIfNoTests=false -isTrimStackTrace=true -testSuiteDefinitionTestSourceDirectory=/projects/java-web-spring/src/test/java -mainCliOptions3=REACTOR_FAIL_FAST -classPathUrl.10=/home/user/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar -classPathUrl.11=/home/user/.m2/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar -mainCliOptions0=LOGGING_LEVEL_ERROR -classPathUrl.12=/home/user/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar -classPathUrl.13=/home/user/.m2/repository/org/yaml/snakeyaml/1.26/snakeyaml-1.26.jar -mainCliOptions2=LOGGING_LEVEL_INFO -classPathUrl.14=/home/user/.m2/repository/org/thymeleaf/thymeleaf-spring5/3.0.11.RELEASE/thymeleaf-spring5-3.0.11.RELEASE.jar -mainCliOptions1=LOGGING_LEVEL_WARN -useManifestOnlyJar=true -classPathUrl.20=/home/user/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.3.2.RELEASE/spring-boot-starter-web-2.3.2.RELEASE.jar -classPathUrl.21=/home/user/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.3.2.RELEASE/spring-boot-starter-json-2.3.2.RELEASE.jar -classPathUrl.22=/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.1/jackson-databind-2.11.1.jar -classPathUrl.23=/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.1/jackson-annotations-2.11.1.jar -classPathUrl.24=/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.1/jackson-core-2.11.1.jar -classPathUrl.25=/home/user/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.11.1/jackson-datatype-jdk8-2.11.1.jar -classPathUrl.15=/home/user/.m2/repository/org/thymeleaf/thymeleaf/3.0.11.RELEASE/thymeleaf-3.0.11.RELEASE.jar -classPathUrl.16=/home/user/.m2/repository/org/attoparser/attoparser/2.0.5.RELEASE/attoparser-2.0.5.RELEASE.jar -classPathUrl.17=/home/user/.m2/repository/org/unbescape/unbescape/1.1.6.RELEASE/unbescape-1.1.6.RELEASE.jar -classPathUrl.18=/home/user/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar -classPathUrl.19=/home/user/.m2/repository/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.4.RELEASE/thymeleaf-extras-java8time-3.0.4.RELEASE.jar -pluginPid=56 -shutdown=DEFAULT -classPathUrl.4=/home/user/.m2/repository/org/springframework/boot/spring-boot/2.3.2.RELEASE/spring-boot-2.3.2.RELEASE.jar -classPathUrl.5=/home/user/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.3.2.RELEASE/spring-boot-autoconfigure-2.3.2.RELEASE.jar -classPathUrl.6=/home/user/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.3.2.RELEASE/spring-boot-starter-logging-2.3.2.RELEASE.jar -classPathUrl.7=/home/user/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar -classPathUrl.8=/home/user/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar -classPathUrl.9=/home/user/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.13.3/log4j-to-slf4j-2.13.3.jar -classPathUrl.30=/home/user/.m2/repository/org/glassfish/jakarta.el/3.0.3/jakarta.el-3.0.3.jar -classPathUrl.31=/home/user/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.37/tomcat-embed-websocket-9.0.37.jar -classPathUrl.32=/home/user/.m2/repository/org/springframework/spring-web/5.2.8.RELEASE/spring-web-5.2.8.RELEASE.jar -classPathUrl.0=/projects/java-web-spring/target/test-classes -classPathUrl.33=/home/user/.m2/repository/org/springframework/spring-beans/5.2.8.RELEASE/spring-beans-5.2.8.RELEASE.jar -classPathUrl.1=/projects/java-web-spring/target/classes -classPathUrl.34=/home/user/.m2/repository/org/springframework/spring-webmvc/5.2.8.RELEASE/spring-webmvc-5.2.8.RELEASE.jar -classPathUrl.35=/home/user/.m2/repository/org/springframework/spring-aop/5.2.8.RELEASE/spring-aop-5.2.8.RELEASE.jar -classPathUrl.2=/home/user/.m2/repository/org/springframework/boot/spring-boot-starter-thymeleaf/2.3.2.RELEASE/spring-boot-starter-thymeleaf-2.3.2.RELEASE.jar -classPathUrl.3=/home/user/.m2/repository/org/springframework/boot/spring-boot-starter/2.3.2.RELEASE/spring-boot-starter-2.3.2.RELEASE.jar -classPathUrl.36=/home/user/.m2/repository/org/springframework/spring-context/5.2.8.RELEASE/spring-context-5.2.8.RELEASE.jar -classPathUrl.26=/home/user/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.1/jackson-datatype-jsr310-2.11.1.jar -classPathUrl.27=/home/user/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.1/jackson-module-parameter-names-2.11.1.jar -classPathUrl.28=/home/user/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.3.2.RELEASE/spring-boot-starter-tomcat-2.3.2.RELEASE.jar -classPathUrl.29=/home/user/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.37/tomcat-embed-core-9.0.37.jar -classPathUrl.40=/home/user/.m2/repository/org/springframework/boot/spring-boot-test/2.3.2.RELEASE/spring-boot-test-2.3.2.RELEASE.jar -classPathUrl.41=/home/user/.m2/repository/org/springframework/boot/spring-boot-test-autoconfigure/2.3.2.RELEASE/spring-boot-test-autoconfigure-2.3.2.RELEASE.jar -classPathUrl.42=/home/user/.m2/repository/com/jayway/jsonpath/json-path/2.4.0/json-path-2.4.0.jar -classPathUrl.43=/home/user/.m2/repository/net/minidev/json-smart/2.3/json-smart-2.3.jar -classPathUrl.44=/home/user/.m2/repository/net/minidev/accessors-smart/1.2/accessors-smart-1.2.jar -classPathUrl.45=/home/user/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar -classPathUrl.46=/home/user/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar -classPathUrl.47=/home/user/.m2/repository/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar -classPathUrl.37=/home/user/.m2/repository/org/springframework/spring-expression/5.2.8.RELEASE/spring-expression-5.2.8.RELEASE.jar -classPathUrl.38=/home/user/.m2/repository/com/h2database/h2/1.4.200/h2-1.4.200.jar -classPathUrl.39=/home/user/.m2/repository/org/springframework/boot/spring-boot-starter-test/2.3.2.RELEASE/spring-boot-starter-test-2.3.2.RELEASE.jar -excludes0=**/*$* -childDelegation=false -useSystemClassLoader=true diff --git a/target/surefire/surefire_02731617288050348722tmp b/target/surefire/surefire_02731617288050348722tmp deleted file mode 100644 index 9bb48be..0000000 --- a/target/surefire/surefire_02731617288050348722tmp +++ /dev/null @@ -1,5 +0,0 @@ -#surefire_0 -#Wed Aug 05 11:54:18 UTC 2020 -basedir=/projects/java-web-spring -user.dir=/projects/java-web-spring -localRepository=/home/user/.m2/repository diff --git a/target/surefire/surefirebooter5054598419114161296.jar b/target/surefire/surefirebooter5054598419114161296.jar deleted file mode 100644 index 47cd096..0000000 Binary files a/target/surefire/surefirebooter5054598419114161296.jar and /dev/null differ diff --git a/target/test-classes/com/example/demo/DemoApplicationTests.class b/target/test-classes/com/example/demo/DemoApplicationTests.class index 5756833..27b8e18 100644 Binary files a/target/test-classes/com/example/demo/DemoApplicationTests.class and b/target/test-classes/com/example/demo/DemoApplicationTests.class differ