From cbff25eecef4058587d031474c3b536f578c338b Mon Sep 17 00:00:00 2001 From: seheonnn Date: Wed, 13 Mar 2024 14:11:31 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20=EC=9D=B4?= =?UTF-8?q?=EB=A9=94=EC=9D=BC=20=EB=AA=A8=EB=93=88=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci_gradle.yml | 12 ++- api/build.gradle | 10 +-- .../resources/application-local.yml | 14 ---- api/out/production/resources/application.yml | 14 ---- .../service/OrganizationService.java | 59 +------------- api/src/main/resources/application-prod.yml | 15 ---- api/src/main/resources/application.yml | 4 +- .../src/main/resources/application-db.yml | 42 +++++----- core/core-infra-email/build.gradle | 7 ++ .../sponus/coreinfraemail}/EmailConfig.java | 6 +- .../com/sponus/coreinfraemail/EmailUtil.java | 76 +++++++++++++++++++ .../src/main/resources/application-email.yml | 14 ++++ settings.gradle | 1 + src/main/resources/application-local.yml | 33 ++++++++ .../main}/resources/application-prod.yml | 27 +++++++ src/main/resources/application.yml | 9 +++ src/main/resources/data.sql | 62 +++++++++++++++ .../main}/resources/templates/payment.html | 0 18 files changed, 271 insertions(+), 134 deletions(-) delete mode 100644 api/out/production/resources/application-local.yml delete mode 100644 api/out/production/resources/application.yml create mode 100644 core/core-infra-email/build.gradle rename {api/src/main/java/com/sponus/sponusbe/global/config => core/core-infra-email/src/main/java/com/sponus/coreinfraemail}/EmailConfig.java (91%) create mode 100644 core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailUtil.java create mode 100644 core/core-infra-email/src/main/resources/application-email.yml create mode 100644 src/main/resources/application-local.yml rename {api/out/production => src/main}/resources/application-prod.yml (59%) create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/data.sql rename {api/out/production => src/main}/resources/templates/payment.html (100%) diff --git a/.github/workflows/ci_gradle.yml b/.github/workflows/ci_gradle.yml index dda82537..a1a0170b 100644 --- a/.github/workflows/ci_gradle.yml +++ b/.github/workflows/ci_gradle.yml @@ -49,9 +49,6 @@ jobs: spring.jwt.secret: ${{ secrets.JWT_SECRET }} spring.jwt.token.access-expiration-time: ${{ secrets.JWT_ACCESS_EXPIRATION_TIME }} spring.jwt.token.refresh-expiration-time: ${{ secrets.JWT_REFRESH_EXPIRATION_TIME }} - mail.smtp.port: ${{ secrets.EMAIL_PORT }} - AdminMail.id: ${{ secrets.EMAIL_ID }} - AdminMail.password: ${{ secrets.EMAIL_PASSWORD }} firebase.fcmUrl: ${{ secrets.FIREBASE_URL}} firebase.firebaseConfigPath: ${{ secrets.FIREBASE_PATH}} PORT_ONE_KEY: ${{ secrets.PORT_ONE_KEY}} @@ -84,6 +81,15 @@ jobs: spring.data.redis.host: ${{ secrets.REDIS_HOST }} spring.data.redis.port: ${{ secrets.REDIS_PORT }} + - name: 7) Set application-email.yml + uses: microsoft/variable-substitution@v1 + with: + files: ./core/core-infra-email/src/main/resources/application-email.yml + env: + mail.smtp.port: ${{ secrets.EMAIL_PORT }} + AdminMail.id: ${{ secrets.EMAIL_ID }} + AdminMail.password: ${{ secrets.EMAIL_PASSWORD }} + - name: Grant execute permission for gradlew and build run: | chmod +x ./gradlew diff --git a/api/build.gradle b/api/build.gradle index 73f1a778..24fedb47 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -4,6 +4,7 @@ dependencies { implementation project(':core:core-infra-db'); implementation project(':core:core-infra-s3'); implementation project(':core:core-infra-redis'); + implementation project(':core:core-infra-email'); // Core implementation 'org.springframework.boot:spring-boot-starter-data-jpa' @@ -15,9 +16,9 @@ dependencies { implementation 'org.slf4j:slf4j-api:2.0.7' // Lombok - implementation 'org.projectlombok:lombok:1.18.22' - annotationProcessor('org.projectlombok:lombok') - testAnnotationProcessor('org.projectlombok:lombok') +// implementation 'org.projectlombok:lombok:1.18.22' +// annotationProcessor('org.projectlombok:lombok') +// testAnnotationProcessor('org.projectlombok:lombok') // Jwt implementation 'io.jsonwebtoken:jjwt-api:0.12.3' @@ -31,9 +32,6 @@ dependencies { // Validation implementation 'org.springframework.boot:spring-boot-starter-validation' - // email - implementation 'org.springframework.boot:spring-boot-starter-mail' - // FCM implementation 'com.google.firebase:firebase-admin:9.1.1' implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2' diff --git a/api/out/production/resources/application-local.yml b/api/out/production/resources/application-local.yml deleted file mode 100644 index fc0720fc..00000000 --- a/api/out/production/resources/application-local.yml +++ /dev/null @@ -1,14 +0,0 @@ -server: - port: 8080 - -spring: - jwt: - secret: EENY5W0eegTf1naQB2eDeyCLl5kRS2b8xa5c4qLdS0hmVjtbvo8tOyhPMcAmtPuQ - token: - access-expiration-time: 999999999 - refresh-expiration-time: 999999999 - - data: - redis: - host: localhost - port: 6379 diff --git a/api/out/production/resources/application.yml b/api/out/production/resources/application.yml deleted file mode 100644 index 0a6b6276..00000000 --- a/api/out/production/resources/application.yml +++ /dev/null @@ -1,14 +0,0 @@ -server: - port: 8080 - -spring: - profiles: - group: - "local": "db, s3, secret" - "prod": "db, s3" - default: local - - servlet: - multipart: - max-file-size: 20MB - max-request-size: 20MB diff --git a/api/src/main/java/com/sponus/sponusbe/domain/organization/service/OrganizationService.java b/api/src/main/java/com/sponus/sponusbe/domain/organization/service/OrganizationService.java index 69466215..0c44cf49 100644 --- a/api/src/main/java/com/sponus/sponusbe/domain/organization/service/OrganizationService.java +++ b/api/src/main/java/com/sponus/sponusbe/domain/organization/service/OrganizationService.java @@ -3,9 +3,7 @@ import static com.sponus.sponusbe.domain.organization.exception.OrganizationErrorCode.*; import java.util.List; -import java.util.Random; -import org.springframework.mail.javamail.JavaMailSender; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -15,6 +13,7 @@ import com.sponus.coredomain.domain.notification.repository.NotificationRepository; import com.sponus.coredomain.domain.organization.Organization; import com.sponus.coredomain.domain.organization.repository.OrganizationRepository; +import com.sponus.coreinfraemail.EmailUtil; import com.sponus.coreinfras3.S3Util; import com.sponus.sponusbe.domain.notification.exception.NotificationErrorCode; import com.sponus.sponusbe.domain.notification.exception.NotificationException; @@ -24,8 +23,6 @@ import com.sponus.sponusbe.domain.organization.dto.OrganizationUpdateRequest; import com.sponus.sponusbe.domain.organization.exception.OrganizationException; -import jakarta.mail.internet.InternetAddress; -import jakarta.mail.internet.MimeMessage; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -38,8 +35,8 @@ public class OrganizationService { private final OrganizationRepository organizationRepository; private final NotificationRepository notificationRepository; private final PasswordEncoder passwordEncoder; - private final JavaMailSender emailSender; private final S3Util s3Util; + private final EmailUtil emailUtil; public OrganizationJoinResponse join(OrganizationJoinRequest request) { final Organization organization = organizationRepository.save( @@ -72,57 +69,7 @@ public void deactivateOrganization(Long organizationId) { } public String sendEmail(String to) throws Exception { - String code = createEmailCode(); - MimeMessage message = createEmail(to, code); - emailSender.send(message); - return code; - } - - private MimeMessage createEmail(String to, String code) throws Exception { - log.info("보내는 대상 : " + to); - log.info("인증 코드 : " + code); - MimeMessage message = emailSender.createMimeMessage(); - message.addRecipients(MimeMessage.RecipientType.TO, to); // 보내는 대상 - message.setSubject("Spon-us 인증 코드 발급입니다."); // 제목 - - String msgg = ""; - msgg += "
"; - msgg += "

Spon-us 인증 코드입니다.

"; // 동적으로 메시지 내용 변경 - msgg += "
"; - msgg += "
"; - msgg += "

인증 코드

"; - msgg += "
"; - msgg += "인증 코드 : "; - msgg += code + "

"; - msgg += "
"; - message.setText(msgg, "utf-8", "html"); // 내용 - message.setFrom(new InternetAddress("Spon-us_team", "Spon-us")); // 보내는 사람 - - return message; - } - - public static String createEmailCode() { - StringBuilder code = new StringBuilder(); - Random rnd = new Random(); - - for (int i = 0; i < 6; i++) { // 인증 코드 6자리 - int index = rnd.nextInt(3); // 0~2 까지 랜덤 - switch (index) { - case 0: - code.append((char)((rnd.nextInt(26)) + 97)); - // a~z (ex. 1+97=98 => (char)98 = 'b') - break; - case 1: - code.append((char)((rnd.nextInt(26)) + 65)); - // A~Z - break; - default: - code.append((rnd.nextInt(10))); - // 0~9 - break; - } - } - return code.toString(); + return emailUtil.sendEmail(to); } public List searchOrganization(String keyword) { diff --git a/api/src/main/resources/application-prod.yml b/api/src/main/resources/application-prod.yml index a0da6eef..9d8e7a74 100644 --- a/api/src/main/resources/application-prod.yml +++ b/api/src/main/resources/application-prod.yml @@ -8,21 +8,6 @@ spring: access-expiration-time: ${JWT_ACCESS_EXPIRATION_TIME} refresh-expiration-time: ${JWT_REFRESH_EXPIRATION_TIME} -mail: - smtp: - port: ${EMAIL_PORT} - auth: true - starttls: - required: true - enable: true - socketFactory: - class: javax.net.ssl.SSLSocketFactory - fallback: false - -AdminMail: - id: ${EMAIL_ID} - password: ${EMAIL_PASSWORD} - firebase: fcmUrl: ${FIREBASE_URL} firebaseConfigPath: ${FIREBASE_PATH} diff --git a/api/src/main/resources/application.yml b/api/src/main/resources/application.yml index 91850ab6..5faad105 100644 --- a/api/src/main/resources/application.yml +++ b/api/src/main/resources/application.yml @@ -4,8 +4,8 @@ server: spring: profiles: group: - "local": "db, s3, secret" - "prod": "db, s3, redis" + "local": "db, s3, email, secret" + "prod": "db, s3, redis, email" default: local servlet: diff --git a/core/core-infra-db/src/main/resources/application-db.yml b/core/core-infra-db/src/main/resources/application-db.yml index 648fea1a..e126dc4f 100644 --- a/core/core-infra-db/src/main/resources/application-db.yml +++ b/core/core-infra-db/src/main/resources/application-db.yml @@ -1,24 +1,24 @@ -#spring: -# config: -# activate: -# on-profile: local -# datasource: -# driver-class-name: org.postgresql.Driver -# url: jdbc:postgresql://localhost:5432/postgres -# username: postgres -# password: postgres! -# jpa: -# database: postgresql -# hibernate: -# ddl-auto: create-drop -# open-in-view: false -# show-sql: true -# generate-ddl: true -# defer-datasource-initialization: true -# -# sql: -# init: -# mode: always +spring: + config: + activate: + on-profile: local + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://localhost:5432/postgres + username: postgres + password: postgres! + jpa: + database: postgresql + hibernate: + ddl-auto: create-drop + open-in-view: false + show-sql: true + generate-ddl: true + defer-datasource-initialization: true + + sql: + init: + mode: always --- diff --git a/core/core-infra-email/build.gradle b/core/core-infra-email/build.gradle new file mode 100644 index 00000000..a87592dd --- /dev/null +++ b/core/core-infra-email/build.gradle @@ -0,0 +1,7 @@ +dependencies { + // email + implementation 'org.springframework.boot:spring-boot-starter-mail' +} + +bootJar { enabled = false } +jar { enabled = true } diff --git a/api/src/main/java/com/sponus/sponusbe/global/config/EmailConfig.java b/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailConfig.java similarity index 91% rename from api/src/main/java/com/sponus/sponusbe/global/config/EmailConfig.java rename to core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailConfig.java index 1be3e0b1..1fded965 100644 --- a/api/src/main/java/com/sponus/sponusbe/global/config/EmailConfig.java +++ b/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailConfig.java @@ -1,4 +1,4 @@ -package com.sponus.sponusbe.global.config; +package com.sponus.coreinfraemail; import java.util.Properties; @@ -20,7 +20,7 @@ public class EmailConfig { @Value("${mail.smtp.starttls.enable}") private boolean starttls; @Value("${mail.smtp.starttls.required}") - private boolean startlls_required; + private boolean startllsRequired; @Value("${mail.smtp.socketFactory.fallback}") private boolean fallback; @Value("${AdminMail.id}") @@ -45,7 +45,7 @@ private Properties getMailProperties() { pt.put("mail.smtp.socketFactory.port", socketPort); pt.put("mail.smtp.auth", auth); pt.put("mail.smtp.starttls.enable", starttls); - pt.put("mail.smtp.starttls.required", startlls_required); + pt.put("mail.smtp.starttls.required", startllsRequired); pt.put("mail.smtp.socketFactory.fallback", fallback); pt.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); return pt; diff --git a/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailUtil.java b/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailUtil.java new file mode 100644 index 00000000..8f66d70a --- /dev/null +++ b/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailUtil.java @@ -0,0 +1,76 @@ +package com.sponus.coreinfraemail; + +import java.util.Random; + +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.stereotype.Component; + +import jakarta.mail.Message; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMessage; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +@Component +@RequiredArgsConstructor +@Slf4j +public class EmailUtil { + + private final JavaMailSender emailSender; + + private static final Random RANDOM = new Random(); + + public String sendEmail(String to) throws Exception { + String code = createEmailCode(); + MimeMessage message = createEmail(to, code); + emailSender.send(message); + return code; + } + + private MimeMessage createEmail(String to, String code) throws Exception { + log.info("보내는 대상 : " + to); + log.info("인증 코드 : " + code); + MimeMessage message = emailSender.createMimeMessage(); + InternetAddress[] recipients = {new InternetAddress(to)}; + message.setRecipients(Message.RecipientType.TO, recipients); // 보내는 대상 + message.setSubject("Spon-us 인증 코드 발급입니다."); // 제목 + + String msgg = ""; + msgg += "
"; + msgg += "

Spon-us 인증 코드입니다.

"; // 동적으로 메시지 내용 변경 + msgg += "
"; + msgg += "
"; + msgg += "

인증 코드

"; + msgg += "
"; + msgg += "인증 코드 : "; + msgg += code + "

"; + msgg += "
"; + message.setText(msgg, "utf-8", "html"); // 내용 + message.setFrom(new InternetAddress("Spon-us_team", "Spon-us")); // 보내는 사람 + + return message; + } + + public static String createEmailCode() { + StringBuilder code = new StringBuilder(); + + for (int i = 0; i < 6; i++) { // 인증 코드 6자리 + int index = RANDOM.nextInt(3); // 0~2 까지 랜덤 + switch (index) { + case 0: + code.append((char)((RANDOM.nextInt(26)) + 97)); + // a~z (ex. 1+97=98 => (char)98 = 'b') + break; + case 1: + code.append((char)((RANDOM.nextInt(26)) + 65)); + // A~Z + break; + default: + code.append((RANDOM.nextInt(10))); + // 0~9 + break; + } + } + return code.toString(); + } +} diff --git a/core/core-infra-email/src/main/resources/application-email.yml b/core/core-infra-email/src/main/resources/application-email.yml new file mode 100644 index 00000000..af8e0cdc --- /dev/null +++ b/core/core-infra-email/src/main/resources/application-email.yml @@ -0,0 +1,14 @@ +mail: + smtp: + port: ${EMAIL_PORT} + auth: true + starttls: + required: true + enable: true + socketFactory: + class: javax.net.ssl.SSLSocketFactory + fallback: false + +AdminMail: + id: ${EMAIL_ID} + password: ${EMAIL_PASSWORD} diff --git a/settings.gradle b/settings.gradle index 4c44e610..6ca2846f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,3 +4,4 @@ include 'core:core-domain' include 'core:core-infra-db' include 'core:core-infra-s3' include 'core:core-infra-redis' +include 'core:core-infra-email' diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 00000000..99c85845 --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,33 @@ +server: + port: 8080 + +spring: + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://localhost:5432/postgres + username: postgres + password: postgres! + + jpa: + database: postgresql + hibernate: + ddl-auto: create-drop + open-in-view: false + show-sql: true + generate-ddl: true + defer-datasource-initialization: true + + sql: + init: + mode: always + + jwt: + secret: EENY5W0eegTf1naQB2eDeyCLl5kRS2b8xa5c4qLdS0hmVjtbvo8tOyhPMcAmtPuQ + token: + access-expiration-time: 999999999 + refresh-expiration-time: 999999999 + + data: + redis: + host: localhost + port: 6379 diff --git a/api/out/production/resources/application-prod.yml b/src/main/resources/application-prod.yml similarity index 59% rename from api/out/production/resources/application-prod.yml rename to src/main/resources/application-prod.yml index 8dcd5ffd..83bd1e3b 100644 --- a/api/out/production/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -2,6 +2,20 @@ server: port: 8080 spring: + datasource: + driver-class-name: org.postgresql.Driver + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PW} + + jpa: + database: postgresql + hibernate: + ddl-auto: update + open-in-view: false + show-sql: true + generate-ddl: true + jwt: secret: ${JWT_SECRET} token: @@ -13,6 +27,19 @@ spring: host: ${REDIS_HOST} port: ${REDIS_PORT} +cloud: + aws: + s3: + bucket: ${BUCKET} + folder: images/ + stack: + auto: false + region: + static: ${REGION} + credentials: + accessKey: ${S3_ACCESS_KEY} + secretKey: ${S3_SECRET_KEY} + mail: smtp: port: ${EMAIL_PORT} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 00000000..c2ebeda7 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,9 @@ +spring: + profiles: + active: local + include: secret + + servlet: + multipart: + max-file-size: 20MB + max-request-size: 20MB diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 00000000..ccb5a27b --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,62 @@ +INSERT INTO organization (organization_name, + organization_email, + organization_password, + organization_location, + organization_type, + suborganization_type, + manager_name, + manager_position, + manager_email, + manager_phone, + manager_available_day, + manager_available_hour, + manager_contact_preference, + organization_status, + organization_image_url) +VALUES ('팀 스포너스', + 'sponus@gmail.com', + '$2a$10$tzrzG/BSFrrye7Kbm4qPYuP6jaQcj5TX5ER1.X/THqkudiSjtEmWW', + '서울특별시 강남구 테헤란로 427', + 'STUDENT', + 'STUDENT_COUNCIL', + '이가은', + 'Project Manager', + 'test@gmail.com', + '01012345678', + '월-금', + '09:00-18:00', + 'EMAIL', + 'ACTIVE', + 'https://sponus.s3.ap-northeast-2.amazonaws.com/images/sponus.png'); + +INSERT INTO announcement (announcement_title, + announcement_type, + announcement_category, + announcement_content, + announcement_status, + view_count, + organization_id, + created_at, + updated_at) +VALUES ('무신사 스폰서십', + 'SPONSORSHIP', + 'MARKETING', + '무신사 스폰서십을 진행할 대학교 학생회를 모집합니다.', + 'OPENED', + 0, + 1, + '2024-02-12 15:29:19.000000', + '2024-02-12 15:29:19.000000'); + +INSERT INTO tag (organization_id, tag_name) +VALUES (1, '#무신사'), + (1, '#스폰서쉽'); + + + +INSERT INTO announcement_image (image_name, + image_url, + announcement_id) +VALUES ('무신사 스폰서십', + 'https://sponus.s3.ap-northeast-2.amazonaws.com/images/sponus.png', + 1); diff --git a/api/out/production/resources/templates/payment.html b/src/main/resources/templates/payment.html similarity index 100% rename from api/out/production/resources/templates/payment.html rename to src/main/resources/templates/payment.html From 16244c9b703c5a6c21fb3620902cd5634c47a698 Mon Sep 17 00:00:00 2001 From: seheonnn Date: Wed, 13 Mar 2024 14:15:16 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=90=9B=20fix:=20db.yml=20local=20prof?= =?UTF-8?q?ile=20=EC=A3=BC=EC=84=9D=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-db.yml | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/core/core-infra-db/src/main/resources/application-db.yml b/core/core-infra-db/src/main/resources/application-db.yml index e126dc4f..648fea1a 100644 --- a/core/core-infra-db/src/main/resources/application-db.yml +++ b/core/core-infra-db/src/main/resources/application-db.yml @@ -1,24 +1,24 @@ -spring: - config: - activate: - on-profile: local - datasource: - driver-class-name: org.postgresql.Driver - url: jdbc:postgresql://localhost:5432/postgres - username: postgres - password: postgres! - jpa: - database: postgresql - hibernate: - ddl-auto: create-drop - open-in-view: false - show-sql: true - generate-ddl: true - defer-datasource-initialization: true - - sql: - init: - mode: always +#spring: +# config: +# activate: +# on-profile: local +# datasource: +# driver-class-name: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/postgres +# username: postgres +# password: postgres! +# jpa: +# database: postgresql +# hibernate: +# ddl-auto: create-drop +# open-in-view: false +# show-sql: true +# generate-ddl: true +# defer-datasource-initialization: true +# +# sql: +# init: +# mode: always --- From cd407a13c6f6d97fee244bafcc6d0770d34845f6 Mon Sep 17 00:00:00 2001 From: seheonnn Date: Wed, 13 Mar 2024 14:38:16 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20EmailConfi?= =?UTF-8?q?g=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/sponus/coreinfraemail/EmailConfig.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailConfig.java b/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailConfig.java index 1fded965..a00a329a 100644 --- a/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailConfig.java +++ b/core/core-infra-email/src/main/java/com/sponus/coreinfraemail/EmailConfig.java @@ -13,14 +13,15 @@ public class EmailConfig { @Value("${mail.smtp.port}") private int port; - @Value("${mail.smtp.port}") - private int socketPort; @Value("${mail.smtp.auth}") private boolean auth; @Value("${mail.smtp.starttls.enable}") private boolean starttls; @Value("${mail.smtp.starttls.required}") private boolean startllsRequired; + + @Value("${mail.smtp.socketFactory.class}") + private String socketFactory; @Value("${mail.smtp.socketFactory.fallback}") private boolean fallback; @Value("${AdminMail.id}") @@ -42,12 +43,12 @@ public JavaMailSender javaMailService() { private Properties getMailProperties() { Properties pt = new Properties(); - pt.put("mail.smtp.socketFactory.port", socketPort); + pt.put("mail.smtp.socketFactory.port", port); pt.put("mail.smtp.auth", auth); pt.put("mail.smtp.starttls.enable", starttls); pt.put("mail.smtp.starttls.required", startllsRequired); pt.put("mail.smtp.socketFactory.fallback", fallback); - pt.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); + pt.put("mail.smtp.socketFactory.class", socketFactory); return pt; } } From cfff7d810b27eb186226fb29a0a836976bc0cb8a Mon Sep 17 00:00:00 2001 From: seheonnn Date: Wed, 13 Mar 2024 14:45:13 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=92=9A=20ci:=20email.yml=20=EC=84=B8?= =?UTF-8?q?=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci_gradle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_gradle.yml b/.github/workflows/ci_gradle.yml index a1a0170b..6e65e364 100644 --- a/.github/workflows/ci_gradle.yml +++ b/.github/workflows/ci_gradle.yml @@ -24,8 +24,8 @@ jobs: echo "spring:" > application.yml echo " profiles:" >> application.yml echo " group:" >> application.yml - echo " "local": "db, s3, secret"" >> application.yml - echo " "prod": "db, s3, redis"" >> application.yml + echo " "local": "db, s3, email, secret"" >> application.yml + echo " "prod": "db, s3, redis, email"" >> application.yml echo " default: prod" >> application.yml echo " servlet:" >> application.yml From 4a6d7e14ff2109aed862430654e515cea3e8d560 Mon Sep 17 00:00:00 2001 From: seheonnn Date: Wed, 13 Mar 2024 16:07:18 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20=ED=8F=AC?= =?UTF-8?q?=ED=8A=B8=EC=9B=90=20=EA=B2=B0=EC=A0=9C=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci_gradle.yml | 14 +++- api/build.gradle | 5 +- .../payment/controller/PaymentController.java | 30 -------- .../controller/PaymentViewController.java | 12 --- .../propose/exception/ProposeErrorCode.java | 4 +- api/src/main/resources/application-prod.yml | 3 - api/src/main/resources/application.yml | 4 +- core/core-infra-portone/build.gradle | 13 ++++ .../coreinfraportone/PaymentErrorCode.java | 29 +++++++ .../coreinfraportone/PaymentException.java | 15 ++++ .../coreinfraportone}/PaymentRequest.java | 2 +- .../sponus/coreinfraportone/PaymentUtil.java | 18 ++--- .../main/resources/appplication-portone.yml | 2 + .../src/main/resources/templates/payment.html | 0 settings.gradle | 1 + src/main/resources/application-local.yml | 33 -------- src/main/resources/application-prod.yml | 64 --------------- src/main/resources/application.yml | 9 --- src/main/resources/data.sql | 62 --------------- src/main/resources/templates/payment.html | 77 ------------------- 20 files changed, 82 insertions(+), 315 deletions(-) delete mode 100644 api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentController.java delete mode 100644 api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentViewController.java create mode 100644 core/core-infra-portone/build.gradle create mode 100644 core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentErrorCode.java create mode 100644 core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentException.java rename {api/src/main/java/com/sponus/sponusbe/domain/payment/dto => core/core-infra-portone/src/main/java/com/sponus/coreinfraportone}/PaymentRequest.java (65%) rename api/src/main/java/com/sponus/sponusbe/domain/payment/service/PaymentService.java => core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentUtil.java (77%) create mode 100644 core/core-infra-portone/src/main/resources/appplication-portone.yml rename {api => core/core-infra-portone}/src/main/resources/templates/payment.html (100%) delete mode 100644 src/main/resources/application-local.yml delete mode 100644 src/main/resources/application-prod.yml delete mode 100644 src/main/resources/application.yml delete mode 100644 src/main/resources/data.sql delete mode 100644 src/main/resources/templates/payment.html diff --git a/.github/workflows/ci_gradle.yml b/.github/workflows/ci_gradle.yml index 6e65e364..e51c1b50 100644 --- a/.github/workflows/ci_gradle.yml +++ b/.github/workflows/ci_gradle.yml @@ -24,8 +24,8 @@ jobs: echo "spring:" > application.yml echo " profiles:" >> application.yml echo " group:" >> application.yml - echo " "local": "db, s3, email, secret"" >> application.yml - echo " "prod": "db, s3, redis, email"" >> application.yml + echo " "local": "db, s3, email, portone, secret"" >> application.yml + echo " "prod": "db, s3, redis, email, portone"" >> application.yml echo " default: prod" >> application.yml echo " servlet:" >> application.yml @@ -51,8 +51,6 @@ jobs: spring.jwt.token.refresh-expiration-time: ${{ secrets.JWT_REFRESH_EXPIRATION_TIME }} firebase.fcmUrl: ${{ secrets.FIREBASE_URL}} firebase.firebaseConfigPath: ${{ secrets.FIREBASE_PATH}} - PORT_ONE_KEY: ${{ secrets.PORT_ONE_KEY}} - PORT_ONE_SECRET: ${{ secrets.PORT_ONE_SECRET}} - name: 4) Set application-db.yml uses: microsoft/variable-substitution@v1 @@ -90,6 +88,14 @@ jobs: AdminMail.id: ${{ secrets.EMAIL_ID }} AdminMail.password: ${{ secrets.EMAIL_PASSWORD }} + - name: 7) Set application-portone.yml + uses: microsoft/variable-substitution@v1 + with: + files: ./core/core-infra-portone/src/main/resources/application-portone.yml + env: + PORT_ONE_KEY: ${{ secrets.PORT_ONE_KEY}} + PORT_ONE_SECRET: ${{ secrets.PORT_ONE_SECRET}} + - name: Grant execute permission for gradlew and build run: | chmod +x ./gradlew diff --git a/api/build.gradle b/api/build.gradle index 24fedb47..5129809c 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -5,6 +5,7 @@ dependencies { implementation project(':core:core-infra-s3'); implementation project(':core:core-infra-redis'); implementation project(':core:core-infra-email'); + implementation project(':core:core-infra-portone'); // Core implementation 'org.springframework.boot:spring-boot-starter-data-jpa' @@ -35,10 +36,6 @@ dependencies { // FCM implementation 'com.google.firebase:firebase-admin:9.1.1' implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2' - - // Iamport - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - implementation 'com.github.iamport:iamport-rest-client-java:0.2.23' } bootJar { enabled = true } jar { enabled = false } diff --git a/api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentController.java b/api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentController.java deleted file mode 100644 index bf7b017a..00000000 --- a/api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentController.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sponus.sponusbe.domain.payment.controller; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import com.siot.IamportRestClient.response.Payment; -import com.sponus.coredomain.domain.common.ApiResponse; -import com.sponus.coredomain.domain.organization.Organization; -import com.sponus.sponusbe.auth.annotation.AuthOrganization; -import com.sponus.sponusbe.domain.payment.dto.PaymentRequest; -import com.sponus.sponusbe.domain.payment.service.PaymentService; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@RestController -@RequiredArgsConstructor -public class PaymentController { - - private final PaymentService paymentService; - - @PostMapping("/api/v1/payments") - public ApiResponse paymentByImpUid( - @AuthOrganization Organization authOrganization, - @RequestBody PaymentRequest request) { - return ApiResponse.onSuccess(paymentService.paymentByImpUid(request, authOrganization)); - } -} diff --git a/api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentViewController.java b/api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentViewController.java deleted file mode 100644 index a1364911..00000000 --- a/api/src/main/java/com/sponus/sponusbe/domain/payment/controller/PaymentViewController.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sponus.sponusbe.domain.payment.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -@Controller -public class PaymentViewController { - @GetMapping("/payment") - public String payment() { - return "payment"; - } -} diff --git a/api/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeErrorCode.java b/api/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeErrorCode.java index 608001d1..50aa9b25 100644 --- a/api/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeErrorCode.java +++ b/api/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeErrorCode.java @@ -17,9 +17,7 @@ public enum ProposeErrorCode implements BaseErrorCode { INVALID_PROPOSED_ORGANIZATION(HttpStatus.BAD_REQUEST, "PROP4003", "제안을 받은 단체만 접근이 가능합니다."), PROPOSE_STATUS_NOT_PENDING(HttpStatus.BAD_REQUEST, "PROP4004", "수락 대기 중인 제안만 수정이 가능합니다."), INVALID_PROPOSE_STATUS(HttpStatus.BAD_REQUEST, "PROP4005", "유효하지 않은 제안 상태입니다."), - PROPOSE_ALREADY_PAID(HttpStatus.BAD_REQUEST, "PROP4006", "이미 결제된 제안입니다."), - PROPOSE_NOT_FOUND(HttpStatus.NOT_FOUND, "PROP4040", "해당 제안이 존재하지 않습니다."), - PAYMENT_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "PROP5001", "결제 중 에러가 발생했습니다."); + PROPOSE_NOT_FOUND(HttpStatus.NOT_FOUND, "PROP4040", "해당 제안이 존재하지 않습니다."); private final HttpStatus httpStatus; private final String code; diff --git a/api/src/main/resources/application-prod.yml b/api/src/main/resources/application-prod.yml index 9d8e7a74..767a31df 100644 --- a/api/src/main/resources/application-prod.yml +++ b/api/src/main/resources/application-prod.yml @@ -12,6 +12,3 @@ firebase: fcmUrl: ${FIREBASE_URL} firebaseConfigPath: ${FIREBASE_PATH} scope: https://www.googleapis.com/auth/cloud-platform - -PORT_ONE_KEY: ${PORT_ONE_KEY} -PORT_ONE_SECRET: ${PORT_ONE_SECRET} diff --git a/api/src/main/resources/application.yml b/api/src/main/resources/application.yml index 5faad105..3c8d8a08 100644 --- a/api/src/main/resources/application.yml +++ b/api/src/main/resources/application.yml @@ -4,8 +4,8 @@ server: spring: profiles: group: - "local": "db, s3, email, secret" - "prod": "db, s3, redis, email" + "local": "db, s3, email, portone, secret" + "prod": "db, s3, redis, email, portone" default: local servlet: diff --git a/core/core-infra-portone/build.gradle b/core/core-infra-portone/build.gradle new file mode 100644 index 00000000..6e812e69 --- /dev/null +++ b/core/core-infra-portone/build.gradle @@ -0,0 +1,13 @@ +dependencies { + + implementation project(':core:core-domain'); + + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + // Iamport + implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' + implementation 'com.github.iamport:iamport-rest-client-java:0.2.23' +} + +bootJar { enabled = false } +jar { enabled = true } diff --git a/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentErrorCode.java b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentErrorCode.java new file mode 100644 index 00000000..55cbc6f3 --- /dev/null +++ b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentErrorCode.java @@ -0,0 +1,29 @@ +package com.sponus.coreinfraportone; + +import org.springframework.http.HttpStatus; + +import com.sponus.coredomain.domain.common.ApiResponse; +import com.sponus.coredomain.domain.common.BaseErrorCode; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum PaymentErrorCode implements BaseErrorCode { + PAYMENT_ERROR(HttpStatus.BAD_REQUEST, "PAY4000", "결제 중 에러가 발생했습니다."), + + PROPOSE_ALREADY_PAID(HttpStatus.BAD_REQUEST, "PAY4001", "이미 결제된 제안입니다."), + + PROPOSE_NOT_FOUND(HttpStatus.NOT_FOUND, "PAY4002", "해당 제안이 존재하지 않습니다."), + INVALID_PROPOSED_ORGANIZATION(HttpStatus.BAD_REQUEST, "PAY4003", "제안을 받은 단체만 접근이 가능합니다."); + + private final HttpStatus httpStatus; + private final String code; + private final String message; + + @Override + public ApiResponse getErrorResponse() { + return ApiResponse.onFailure(code, message); + } +} diff --git a/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentException.java b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentException.java new file mode 100644 index 00000000..5d5900ef --- /dev/null +++ b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentException.java @@ -0,0 +1,15 @@ +package com.sponus.coreinfraportone; + +import com.sponus.coredomain.domain.common.BaseErrorCode; + +import lombok.Getter; + +@Getter +public class PaymentException extends RuntimeException { + + private final BaseErrorCode errorCode; + + public PaymentException(BaseErrorCode errorCode) { + this.errorCode = errorCode; + } +} diff --git a/api/src/main/java/com/sponus/sponusbe/domain/payment/dto/PaymentRequest.java b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentRequest.java similarity index 65% rename from api/src/main/java/com/sponus/sponusbe/domain/payment/dto/PaymentRequest.java rename to core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentRequest.java index 3c29eac9..4032ecb1 100644 --- a/api/src/main/java/com/sponus/sponusbe/domain/payment/dto/PaymentRequest.java +++ b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentRequest.java @@ -1,4 +1,4 @@ -package com.sponus.sponusbe.domain.payment.dto; +package com.sponus.coreinfraportone; public record PaymentRequest( String impUid, diff --git a/api/src/main/java/com/sponus/sponusbe/domain/payment/service/PaymentService.java b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentUtil.java similarity index 77% rename from api/src/main/java/com/sponus/sponusbe/domain/payment/service/PaymentService.java rename to core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentUtil.java index e86626f3..8fd5c210 100644 --- a/api/src/main/java/com/sponus/sponusbe/domain/payment/service/PaymentService.java +++ b/core/core-infra-portone/src/main/java/com/sponus/coreinfraportone/PaymentUtil.java @@ -1,9 +1,7 @@ -package com.sponus.sponusbe.domain.payment.service; +package com.sponus.coreinfraportone; import java.io.IOException; -import javax.annotation.PostConstruct; - import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -15,10 +13,8 @@ import com.sponus.coredomain.domain.organization.Organization; import com.sponus.coredomain.domain.propose.Propose; import com.sponus.coredomain.domain.propose.repository.ProposeRepository; -import com.sponus.sponusbe.domain.payment.dto.PaymentRequest; -import com.sponus.sponusbe.domain.propose.exception.ProposeErrorCode; -import com.sponus.sponusbe.domain.propose.exception.ProposeException; +import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -26,7 +22,7 @@ @Service @Transactional @RequiredArgsConstructor -public class PaymentService { +public class PaymentUtil { @Value("${PORT_ONE_KEY}") private String restApiKey; @@ -45,12 +41,12 @@ public Payment paymentByImpUid(PaymentRequest request, Organization authOrganiza try { log.info("Payment Request : {}", request.toString()); final Propose propose = proposeRepository.findById(request.proposeId()) - .orElseThrow(() -> new ProposeException(ProposeErrorCode.PROPOSE_NOT_FOUND)); + .orElseThrow(() -> new PaymentException(PaymentErrorCode.PROPOSE_NOT_FOUND)); if (!isProposingOrganization(propose, authOrganization)) { - throw new ProposeException(ProposeErrorCode.INVALID_PROPOSING_ORGANIZATION); + throw new PaymentException(PaymentErrorCode.INVALID_PROPOSED_ORGANIZATION); } if (propose.isPaid()) { - throw new ProposeException(ProposeErrorCode.PROPOSE_ALREADY_PAID); + throw new PaymentException(PaymentErrorCode.PROPOSE_ALREADY_PAID); } propose.updateToPaid(request.impUid()); final IamportResponse paymentIamportResponse = iamportClient.paymentByImpUid(request.impUid()); @@ -58,7 +54,7 @@ public Payment paymentByImpUid(PaymentRequest request, Organization authOrganiza return paymentIamportResponse.getResponse(); } catch (IamportResponseException | IOException e) { log.error("Payment Error : {}", e.getMessage()); - throw new ProposeException(ProposeErrorCode.PAYMENT_ERROR); + throw new PaymentException(PaymentErrorCode.PAYMENT_ERROR); } } diff --git a/core/core-infra-portone/src/main/resources/appplication-portone.yml b/core/core-infra-portone/src/main/resources/appplication-portone.yml new file mode 100644 index 00000000..77e26fcf --- /dev/null +++ b/core/core-infra-portone/src/main/resources/appplication-portone.yml @@ -0,0 +1,2 @@ +PORT_ONE_KEY: ${PORT_ONE_KEY} +PORT_ONE_SECRET: ${PORT_ONE_SECRET} diff --git a/api/src/main/resources/templates/payment.html b/core/core-infra-portone/src/main/resources/templates/payment.html similarity index 100% rename from api/src/main/resources/templates/payment.html rename to core/core-infra-portone/src/main/resources/templates/payment.html diff --git a/settings.gradle b/settings.gradle index 6ca2846f..b420afa4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,3 +5,4 @@ include 'core:core-infra-db' include 'core:core-infra-s3' include 'core:core-infra-redis' include 'core:core-infra-email' +include 'core:core-infra-portone' diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml deleted file mode 100644 index 99c85845..00000000 --- a/src/main/resources/application-local.yml +++ /dev/null @@ -1,33 +0,0 @@ -server: - port: 8080 - -spring: - datasource: - driver-class-name: org.postgresql.Driver - url: jdbc:postgresql://localhost:5432/postgres - username: postgres - password: postgres! - - jpa: - database: postgresql - hibernate: - ddl-auto: create-drop - open-in-view: false - show-sql: true - generate-ddl: true - defer-datasource-initialization: true - - sql: - init: - mode: always - - jwt: - secret: EENY5W0eegTf1naQB2eDeyCLl5kRS2b8xa5c4qLdS0hmVjtbvo8tOyhPMcAmtPuQ - token: - access-expiration-time: 999999999 - refresh-expiration-time: 999999999 - - data: - redis: - host: localhost - port: 6379 diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml deleted file mode 100644 index 83bd1e3b..00000000 --- a/src/main/resources/application-prod.yml +++ /dev/null @@ -1,64 +0,0 @@ -server: - port: 8080 - -spring: - datasource: - driver-class-name: org.postgresql.Driver - url: ${DB_URL} - username: ${DB_USERNAME} - password: ${DB_PW} - - jpa: - database: postgresql - hibernate: - ddl-auto: update - open-in-view: false - show-sql: true - generate-ddl: true - - jwt: - secret: ${JWT_SECRET} - token: - access-expiration-time: ${JWT_ACCESS_EXPIRATION_TIME} - refresh-expiration-time: ${JWT_REFRESH_EXPIRATION_TIME} - - data: - redis: - host: ${REDIS_HOST} - port: ${REDIS_PORT} - -cloud: - aws: - s3: - bucket: ${BUCKET} - folder: images/ - stack: - auto: false - region: - static: ${REGION} - credentials: - accessKey: ${S3_ACCESS_KEY} - secretKey: ${S3_SECRET_KEY} - -mail: - smtp: - port: ${EMAIL_PORT} - auth: true - starttls: - required: true - enable: true - socketFactory: - class: javax.net.ssl.SSLSocketFactory - fallback: false - -AdminMail: - id: ${EMAIL_ID} - password: ${EMAIL_PASSWORD} - -firebase: - fcmUrl: ${FIREBASE_URL} - firebaseConfigPath: ${FIREBASE_PATH} - scope: https://www.googleapis.com/auth/cloud-platform - -PORT_ONE_KEY: ${PORT_ONE_KEY} -PORT_ONE_SECRET: ${PORT_ONE_SECRET} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index c2ebeda7..00000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,9 +0,0 @@ -spring: - profiles: - active: local - include: secret - - servlet: - multipart: - max-file-size: 20MB - max-request-size: 20MB diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql deleted file mode 100644 index ccb5a27b..00000000 --- a/src/main/resources/data.sql +++ /dev/null @@ -1,62 +0,0 @@ -INSERT INTO organization (organization_name, - organization_email, - organization_password, - organization_location, - organization_type, - suborganization_type, - manager_name, - manager_position, - manager_email, - manager_phone, - manager_available_day, - manager_available_hour, - manager_contact_preference, - organization_status, - organization_image_url) -VALUES ('팀 스포너스', - 'sponus@gmail.com', - '$2a$10$tzrzG/BSFrrye7Kbm4qPYuP6jaQcj5TX5ER1.X/THqkudiSjtEmWW', - '서울특별시 강남구 테헤란로 427', - 'STUDENT', - 'STUDENT_COUNCIL', - '이가은', - 'Project Manager', - 'test@gmail.com', - '01012345678', - '월-금', - '09:00-18:00', - 'EMAIL', - 'ACTIVE', - 'https://sponus.s3.ap-northeast-2.amazonaws.com/images/sponus.png'); - -INSERT INTO announcement (announcement_title, - announcement_type, - announcement_category, - announcement_content, - announcement_status, - view_count, - organization_id, - created_at, - updated_at) -VALUES ('무신사 스폰서십', - 'SPONSORSHIP', - 'MARKETING', - '무신사 스폰서십을 진행할 대학교 학생회를 모집합니다.', - 'OPENED', - 0, - 1, - '2024-02-12 15:29:19.000000', - '2024-02-12 15:29:19.000000'); - -INSERT INTO tag (organization_id, tag_name) -VALUES (1, '#무신사'), - (1, '#스폰서쉽'); - - - -INSERT INTO announcement_image (image_name, - image_url, - announcement_id) -VALUES ('무신사 스폰서십', - 'https://sponus.s3.ap-northeast-2.amazonaws.com/images/sponus.png', - 1); diff --git a/src/main/resources/templates/payment.html b/src/main/resources/templates/payment.html deleted file mode 100644 index 23407b7b..00000000 --- a/src/main/resources/templates/payment.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - Sample Payment - - - - - From c8e6642d31b1d159edc72850aa813715eda61949 Mon Sep 17 00:00:00 2001 From: seheonnn Date: Wed, 13 Mar 2024 16:14:18 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20portone.ym?= =?UTF-8?q?l=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci_gradle.yml | 2 +- .../{appplication-portone.yml => application-portone.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename core/core-infra-portone/src/main/resources/{appplication-portone.yml => application-portone.yml} (100%) diff --git a/.github/workflows/ci_gradle.yml b/.github/workflows/ci_gradle.yml index e51c1b50..1b3ac95e 100644 --- a/.github/workflows/ci_gradle.yml +++ b/.github/workflows/ci_gradle.yml @@ -88,7 +88,7 @@ jobs: AdminMail.id: ${{ secrets.EMAIL_ID }} AdminMail.password: ${{ secrets.EMAIL_PASSWORD }} - - name: 7) Set application-portone.yml + - name: 8) Set application-portone.yml uses: microsoft/variable-substitution@v1 with: files: ./core/core-infra-portone/src/main/resources/application-portone.yml diff --git a/core/core-infra-portone/src/main/resources/appplication-portone.yml b/core/core-infra-portone/src/main/resources/application-portone.yml similarity index 100% rename from core/core-infra-portone/src/main/resources/appplication-portone.yml rename to core/core-infra-portone/src/main/resources/application-portone.yml