Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/binchoo/paimonganyu
Browse files Browse the repository at this point in the history
  • Loading branch information
binchoo committed Jul 23, 2022
2 parents 7fb2beb + 5800e49 commit 3669433
Show file tree
Hide file tree
Showing 237 changed files with 205 additions and 188 deletions.
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
main:

paimonganyu-skill-prod: build
paimonganyu-skill-prod: build-paimonganyu-skill
cd sam/paimonganyu-skill; sam deploy --guided \
--stack-name paimonganyu-skill \
--profile serverless \
--region ap-northeast-2 \
--parameter-overrides Env=prod

paimonganyu-prod: build
paimonganyu-prod: build-paimonganyu
cd sam/paimonganyu; sam deploy --guided \
--stack-name paimonganyu \
--profile serverless \
--region ap-northeast-2 \
--parameter-overrides Env=prod

paimonganyu-test: build
paimonganyu-test: build-paimonganyu
cd sam/paimonganyu; sam deploy --guided \
--stack-name paimonganyu-test
--profile serverless \
--region ap-northeast-1 \
--parameter-overrides Env=test

build: build-template
cd PaimonGanyu; ./gradlew -Pversion=$(version) -x test clean :application:copyBuiltZipNoTomcat :application:copyBootJar

build-template:
build-paimonganyu:
cd sam/paimonganyu; sam build --profile serverless
cd PaimonGanyu; ./gradlew -Pversion=$(version) -x test clean :paimonganyu-app:paimonganyu:copyZipNoTomcat

build-paimonganyu-skill:
cd sam/paimonganyu-skill; sam build --profile serverless
cd PaimonGanyu; ./gradlew -Pversion=$(version) -x test clean :paimonganyu-app:paimonganyu-skill:copyBootJar

localtest:
cd PaimonGanyu; ./gradlew -PlocalTest=true :application:test
cd PaimonGanyu; ./gradlew -PlocalTest=true clean test
99 changes: 0 additions & 99 deletions PaimonGanyu/application/build.gradle

This file was deleted.

12 changes: 1 addition & 11 deletions PaimonGanyu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ allprojects {
bootVersion = '2.4.2'
awsSdkVersion = '1.11.914'
jacksonVersion = '2.11.4'
lombokVersion = '1.18.22'
lombokVersion = '1.18.24'
}

repositories {
Expand Down Expand Up @@ -40,14 +40,4 @@ allprojects {

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

project(':application').dependencies {
implementation project(':hoyoapi')
implementation project(':awsutils')
implementation (project(':ikakao')) {
because 'to render skill response of kakao chatbot'
}
implementation project(':domain')
testImplementation(testFixtures(project(':domain')))
}
9 changes: 0 additions & 9 deletions PaimonGanyu/domain/build.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

PaimonGanyu :application module
PaimonGanyu :paimonganyu-app module
Copyright (C) 2022 jbinchoo

This program is free software: you can redistribute it and/or modify
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

PaimonGanyu :application module Copyright (C) 2022 jbinchoo
PaimonGanyu :paimonganyu-app module Copyright (C) 2022 jbinchoo
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
3 changes: 3 additions & 0 deletions PaimonGanyu/paimonganyu-app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def samBuildDir(Project project, String stackName) {
'../'.repeat(project.depth + 1) + "sam/${stackName}/.aws-sam/build"
}
59 changes: 59 additions & 0 deletions PaimonGanyu/paimonganyu-app/paimonganyu-skill/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
plugins {
id "org.springframework.boot" version "${bootVersion}"
id "io.spring.dependency-management" version '1.0.11.RELEASE'
}

dependencies {
implementation project(':paimonganyu-infra')
implementation project(':ikakao')

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'com.amazonaws.serverless:aws-serverless-java-container-springboot2:1.8.1'

testImplementation(testFixtures(project(':paimonganyu-domain')))
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}

bootJar {
archiveBaseName='paimonganyu-skill'
}

task copyBootJar(type: Copy) {
def dest = samBuildDir(project, 'paimonganyu-skill')
from bootJar
into(dest)
doLast {
println "$project.name:$name has moved bootJar into $dest"
}
}

task stopRunningDynamoDBContainer(type: Exec) {
standardOutput = new ByteArrayOutputStream()
commandLine = ['bash', '-c',
'docker ps -q | while read line; do if [[ $(docker port $line) == *"3306"* ]]; then docker stop $line; fi; done;']
doLast {
println "Container stopped: ${standardOutput.toString()}"
}
}

task startDynamoDBContainer(type: Exec) {
dependsOn stopRunningDynamoDBContainer
standardOutput = new ByteArrayOutputStream()
commandLine = ['docker', 'run', '-p', '3306:8000', '-d', 'amazon/dynamodb-local']
doLast {
println "Container started: ${standardOutput.toString()}"
}
}

test {
def isLocalTest = Boolean.parseBoolean(project.findProperty('localTest'))
if (isLocalTest) {
dependsOn startDynamoDBContainer
} else {
filter {
excludeTestsMatching("org.binchoo.paimonganyu.integration.hoyopass.SecuredHoyopassRegistryLocalSystemTest")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* @author jbinchoo
* @since 2022/06/12
*/
@Deprecated(forRemoval = true)
@Slf4j
public class PaimonGanyuLambda implements RequestStreamHandler {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.binchoo.paimonganyu.chatbot.configs.resource;

import lombok.Setter;
import org.binchoo.paimonganyu.chatbot.configs.YamlPropertySourceFactory;
import org.binchoo.paimonganyu.chatbot.resources.BlockSpec;
import org.binchoo.paimonganyu.chatbot.resources.Blocks;
import org.binchoo.paimonganyu.chatbot.resources.FallbackMethods;
import lombok.Setter;
import org.binchoo.paimonganyu.chatbot.resources.QuickReplies;
import org.binchoo.paimonganyu.ikakao.type.QuickReply;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.binchoo.paimonganyu.chatbot.configs.resource;

import lombok.Setter;
import org.binchoo.paimonganyu.chatbot.configs.YamlPropertySourceFactory;
import org.binchoo.paimonganyu.chatbot.resources.Images;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.binchoo.paimonganyu.chatbot.configs.web;

import org.binchoo.paimonganyu.chatbot.controllers.resolvers.clientextra.ClientExtraResolver;
import org.binchoo.paimonganyu.chatbot.controllers.resolvers.id.UserIdResolver;
import org.binchoo.paimonganyu.chatbot.controllers.resolvers.clientextra.ClientExtraResolver;
import org.binchoo.paimonganyu.chatbot.controllers.resolvers.param.ActionParamResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.binchoo.paimonganyu.chatbot.controllers;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.binchoo.paimonganyu.chatbot.errorbinders.ErrorContextBinders;
import org.binchoo.paimonganyu.chatbot.views.error.DefaultErrorExplain;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.binchoo.paimonganyu.chatbot.views.error.ErrorResponseView;
import org.binchoo.paimonganyu.error.ErrorContextBinder;
import org.binchoo.paimonganyu.error.ErrorExplain;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.binchoo.paimonganyu.chatbot.controllers;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import org.binchoo.paimonganyu.chatbot.controllers.resolvers.clientextra.ClientExtra;
import org.binchoo.paimonganyu.chatbot.controllers.resolvers.id.UserId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.binchoo.paimonganyu.chatbot.controllers.resolvers.clientextra;

import lombok.RequiredArgsConstructor;
import org.binchoo.paimonganyu.chatbot.controllers.resolvers.SkillPayloadResolver;
import lombok.RequiredArgsConstructor;
import org.binchoo.paimonganyu.ikakao.SkillPayload;
import org.springframework.core.MethodParameter;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.binchoo.paimonganyu.chatbot.views;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.binchoo.paimonganyu.chatbot.resources.Blocks;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.binchoo.paimonganyu.chatbot.resources.Images;
import org.binchoo.paimonganyu.chatbot.resources.QuickReplies;
import org.binchoo.paimonganyu.ikakao.SkillResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.binchoo.paimonganyu.chatbot.views.hoyopass;

import org.binchoo.paimonganyu.chatbot.resources.Blocks;
import org.binchoo.paimonganyu.chatbot.views.SkillResponseView;
import org.binchoo.paimonganyu.chatbot.resources.FallbackMethods;
import org.binchoo.paimonganyu.chatbot.resources.Images;
import org.binchoo.paimonganyu.chatbot.resources.QuickReplies;
import org.binchoo.paimonganyu.chatbot.views.SkillResponseView;
import org.binchoo.paimonganyu.error.FallbackMethod;
import org.binchoo.paimonganyu.hoyopass.Hoyopass;
import org.binchoo.paimonganyu.hoyopass.Uid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.binchoo.paimonganyu.chatbot.views.traveler;

import org.binchoo.paimonganyu.chatbot.views.SkillResponseView;
import org.binchoo.paimonganyu.chatbot.resources.FallbackMethods;
import org.binchoo.paimonganyu.chatbot.resources.Images;
import org.binchoo.paimonganyu.chatbot.resources.QuickReplies;
import org.binchoo.paimonganyu.chatbot.views.SkillResponseView;
import org.binchoo.paimonganyu.ikakao.SkillResponse;
import org.binchoo.paimonganyu.ikakao.component.CanCarousel;
import org.binchoo.paimonganyu.ikakao.component.CarouselView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.binchoo.paimonganyu.chatbot.views.uid;

import org.binchoo.paimonganyu.chatbot.views.SkillResponseView;
import org.binchoo.paimonganyu.chatbot.resources.FallbackMethods;
import org.binchoo.paimonganyu.chatbot.resources.Images;
import org.binchoo.paimonganyu.chatbot.resources.QuickReplies;
import org.binchoo.paimonganyu.chatbot.views.SkillResponseView;
import org.binchoo.paimonganyu.error.FallbackMethod;
import org.binchoo.paimonganyu.hoyopass.Uid;
import org.binchoo.paimonganyu.ikakao.SkillResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.binchoo.paimonganyu.infra.hoyopass;
package org.binchoo.paimonganyu.integration.hoyopass;

import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
import com.amazonaws.services.dynamodbv2.model.CreateTableRequest;
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
import org.binchoo.paimonganyu.chatbot.PaimonGanyu;
import org.binchoo.paimonganyu.testconfig.TestHoyopassCredentialsConfig;
import org.binchoo.paimonganyu.hoyopass.Hoyopass;
import org.binchoo.paimonganyu.hoyopass.HoyopassCredentials;
import org.binchoo.paimonganyu.hoyopass.Uid;
Expand All @@ -18,7 +19,6 @@
import org.binchoo.paimonganyu.infra.hoyopass.dynamo.item.UserHoyopassItem;
import org.binchoo.paimonganyu.service.hoyopass.SecureHoyopassRegister;
import org.binchoo.paimonganyu.testconfig.TestAmazonClientsConfig;
import org.binchoo.paimonganyu.testconfig.TestHoyopassCredentialsConfig;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
Loading

0 comments on commit 3669433

Please sign in to comment.