-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from shortintern2020-A-labyrinth/develop
Authorを記述
- Loading branch information
Showing
80 changed files
with
2,564 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
target/ | ||
*.iml | ||
.idea/ | ||
demo.iml | ||
*.class | ||
src/main/resources/twitter4j.properties | ||
.gradle/ | ||
.vscode | ||
.settings/ |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#Wed Aug 26 19:54:40 JST 2020 | ||
gradle.version=6.5 |
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "automatic" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', '[email protected]', 1), | ||
('banana.chocomint', '[email protected]', 2), | ||
('pinapple.chocomint', '[email protected]', 3), | ||
('apple.chocomint', '[email protected]', 4), | ||
('lemon.chocomint', '[email protected]', 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', '[email protected]', 1), | ||
('banana.chocomint', '[email protected]', 2), | ||
('pinapple.chocomint', '[email protected]', 3) | ||
; | ||
|
||
/* END:nakamura */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
Oops, something went wrong.