diff --git a/demo.iml b/demo.iml
new file mode 100644
index 0000000..b5292df
--- /dev/null
+++ b/demo.iml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7b731cf..0b5a1a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,6 +18,20 @@
11
+
+
+ twitter4j.org
+ twitter4j.org Repository
+ http://twitter4j.org/maven2
+
+ true
+
+
+ true
+
+
+
+
org.springframework.boot
@@ -58,6 +72,11 @@
+
+ org.twitter4j
+ twitter4j-core
+ [4.0,)
+
@@ -65,6 +84,11 @@
org.springframework.boot
spring-boot-maven-plugin
+
+
+ src/main/resources/twitter4j.properties
+
+
diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java
index 452d348..7969051 100644
--- a/src/main/java/com/example/demo/DemoApplication.java
+++ b/src/main/java/com/example/demo/DemoApplication.java
@@ -9,20 +9,20 @@
@SpringBootApplication
public class DemoApplication implements CommandLineRunner {
- public static void main(String[] args) {
- SpringApplication.run(DemoApplication.class, args);
- }
+ public static void main(String[] args) {
+ SpringApplication.run(DemoApplication.class, args);
+ }
+q
+ @Autowired
+ JdbcTemplate jdbcTemplate;
- @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')");
- }
+ @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/controller/ViewController.java b/src/main/java/com/example/demo/controller/ViewController.java
index 902156b..8e5b2e2 100644
--- a/src/main/java/com/example/demo/controller/ViewController.java
+++ b/src/main/java/com/example/demo/controller/ViewController.java
@@ -7,10 +7,9 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import twitter4j.*;
@RestController
@RequestMapping(path = "/")
@@ -28,9 +27,49 @@ public String index() {
}
@RequestMapping(path = "/users/{id}", method = RequestMethod.GET)
- public String read(@PathVariable String id) {
+ public String read(@PathVariable("id") String id) {
List