Skip to content

Commit

Permalink
API - v1.0.0
Browse files Browse the repository at this point in the history
API - v1.0.0
  • Loading branch information
wjdtkdgns authored Sep 8, 2023
2 parents ed2c45e + a48fc0e commit 3297138
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ out/
.env
.env.*

mysqldata/

Domain/src/main/generated/**/*.java
Core/src/main/resources/static/apple/**.p8
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public OauthRegisterResponse execute(String refreshToken) {
RefreshTokenEntity oldToken = refreshTokenAdaptor.findTokenByRefreshToken(refreshToken);
Long userId = jwtTokenProvider.parseRefreshToken(oldToken.getRefreshToken());
User user = userAdaptor.findById(userId);
refreshTokenAdaptor.delete(oldToken);
return OauthRegisterResponse.from(tokenGenerateHelper.execute(user));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ public RefreshTokenEntity findTokenByRefreshToken(String refreshToken) {
.findByRefreshToken(refreshToken)
.orElseThrow(() -> ExpiredRefreshTokenException.EXCEPTION);
}

public void delete(RefreshTokenEntity token) {
refreshTokenRepository.delete(token);
}
}
64 changes: 52 additions & 12 deletions Domain/src/main/resources/application-domain.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# common

---
# local
spring:
config:
activate:
on-profile: local
datasource:
url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${DB_NAME}?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&tinyInt1isBit=false
url: jdbc:mysql://localhost:3306/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&tinyInt1isBit=false
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
username: root
password: test
hikari:
maxLifetime: 580000
maximum-pool-size: 20
jpa:
show-sql: ${SHOW_SQL:true}
show-sql: true
properties:
hibernate:
format_sql: ${FORMAT_SQL:true}
default_batch_fetch_size: ${JPA_BATCH_FETCH_SIZE:100}
format_sql: true
default_batch_fetch_size: 100
hibernate:
ddl-auto: update
defer-datasource-initialization: true
open-in-view: false
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
database: mysql
---
# local
spring:
config:
activate:
on-profile: local

logging:
level:
Expand All @@ -41,6 +41,26 @@ spring:
config:
activate:
on-profile: dev
datasource:
url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${DB_NAME}?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&tinyInt1isBit=false
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
hikari:
maxLifetime: 580000
maximum-pool-size: 20
jpa:
show-sql: ${SHOW_SQL:true}
properties:
hibernate:
format_sql: ${FORMAT_SQL:true}
default_batch_fetch_size: ${JPA_BATCH_FETCH_SIZE:100}
hibernate:
ddl-auto: update
defer-datasource-initialization: true
open-in-view: false
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
database: mysql

logging:
level:
Expand All @@ -56,6 +76,26 @@ spring:
config:
activate:
on-profile: prod
datasource:
url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${DB_NAME}?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&tinyInt1isBit=false
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
hikari:
maxLifetime: 580000
maximum-pool-size: 20
jpa:
show-sql: ${SHOW_SQL:true}
properties:
hibernate:
format_sql: ${FORMAT_SQL:true}
default_batch_fetch_size: ${JPA_BATCH_FETCH_SIZE:100}
hibernate:
ddl-auto: update
defer-datasource-initialization: true
open-in-view: false
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
database: mysql

logging:
level:
Expand Down
15 changes: 14 additions & 1 deletion docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,17 @@ services:
container_name: redis
hostname: redis
ports:
- "6379:6379"
- "6379:6379"

mysql:
image: mysql
container_name: mysql
hostname: mysql
volumes:
- ./mysqldata:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=test
- MYSQL_HOST=localhost
- MYSQL_PORT=3306
ports:
- "3306:3306"

0 comments on commit 3297138

Please sign in to comment.