Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2/25 오픈 테스트 #76

Merged
merged 111 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
bf7f913
Merge branch 'test' of https://github.com/1223v/readyBusinessBack int…
1223v Dec 3, 2023
8579058
Refactor: JwtService 추상화 (DIP, OCP)
1223v Jan 8, 2024
7e0ddff
Fix: 간편로그인 -> 자체로그인으로 변경
1223v Jan 8, 2024
5b491be
Merge pull request #36 from 1223v/login
1223v Jan 8, 2024
c69b670
Fix: Oauth password 추가
1223v Jan 9, 2024
ff73090
Fix: Oauth password 수정
1223v Jan 9, 2024
2cd2369
Merge pull request #38 from 1223v/auth
1223v Jan 9, 2024
843ec30
Fix: Cookie 인증 방식 -> Authorization Header 방식으로 변경
1223v Jan 9, 2024
77f844b
Refactor: Cookie 인증 방식 -> Authorization Header 방식으로 변경 테스트
1223v Jan 10, 2024
83209ef
Merge pull request #39 from 1223v/auth
1223v Jan 10, 2024
3b89230
Fix: Cookie, Header 호환 방식으로 변경
1223v Jan 10, 2024
57398d2
Merge pull request #40 from 1223v/test
1223v Jan 10, 2024
d27ab3e
Merge branch 'test' of https://github.com/1223v/readyBusinessBack int…
1223v Jan 11, 2024
667a6a4
Feat: redis 추가
1223v Jan 11, 2024
c2e0687
Feat: Redis 적용
1223v Jan 16, 2024
0cb36fc
Feat: Redis RefreshToken 코드 변경
1223v Jan 17, 2024
509f074
Fix: refreshtoken 이전 (RDB -> redis)
1223v Jan 17, 2024
9cb3367
Fix: auth error exceptioncode 수정
1223v Jan 20, 2024
edf87dd
Refactor: solAPI config 파일 이동
1223v Jan 23, 2024
40c6a86
Feat: sms 문자 인증 기능 추가
1223v Jan 23, 2024
4fe008a
Refactor: 코드 포멧팅 정리
1223v Jan 25, 2024
e1e86d6
Docs: action redis 추가
marinesnow34 Jan 25, 2024
6eb6a4a
Merge pull request #43 from readyvery/redis_action
marinesnow34 Jan 25, 2024
93738c1
Fix: redis 테스트 코드 수정
1223v Jan 25, 2024
5929363
Fix: redis 테스트 코드 주석
1223v Jan 25, 2024
d36978b
Fix: RedisConfig 로그 확인
1223v Jan 25, 2024
81a6d00
Merge pull request #42 from 1223v/auth
marinesnow34 Jan 25, 2024
acff0da
Fix: Sms 전화번호 타입 예외처리 추가
1223v Jan 26, 2024
79602fb
Merge pull request #45 from 1223v/auth
1223v Jan 26, 2024
ce7bbf7
Docs: swagger API 명세 추가
1223v Jan 26, 2024
0b43d2d
Fix: codeStyle 수정
1223v Jan 26, 2024
cb5aa7d
Fix: redis test코드 수정
1223v Jan 26, 2024
a9fae4a
Merge pull request #46 from 1223v/swagger
1223v Jan 26, 2024
5121890
Fix: API path 변경
1223v Jan 28, 2024
caf1b55
Merge pull request #47 from 1223v/swagger
1223v Jan 28, 2024
72d4822
Fix: swagger API path 변경
1223v Jan 28, 2024
3eda78a
Merge pull request #48 from 1223v/swaggerurl
1223v Jan 28, 2024
7b65325
Feat: 이메일 중복 검증 서비스 테스트 코드 추가
1223v Jan 30, 2024
ef57826
Fix: 회원 가입 파라미터 수정
1223v Feb 1, 2024
ba6ca43
Style: 코드 포멧팅
1223v Feb 1, 2024
7a3a687
Merge pull request #49 from 1223v/joinparameter
1223v Feb 1, 2024
1c5e776
Fix: 회원가입 프로세스 전체 수정
1223v Feb 1, 2024
cf63799
Style: 코드 포멧팅
1223v Feb 1, 2024
9a82284
Merge pull request #50 from 1223v/fixjoinprocess
1223v Feb 1, 2024
6b94e1a
Feat: 이메일 사용가능, 빈값에 대한 유닛테스트 추가
1223v Feb 2, 2024
5772d8c
Merge pull request #51 from 1223v/emailduplicateTest
1223v Feb 2, 2024
dbe31bc
Feat: 이메일 통합테스트 추가
1223v Feb 2, 2024
192a9bf
Fix: store API url 수정
1223v Feb 2, 2024
0b4cfec
Style: 코드 포멧팅
1223v Feb 2, 2024
1b0deb3
Merge pull request #52 from 1223v/ceoService
1223v Feb 2, 2024
db9186b
Fix: ROLE 항목 추가 및 OrderDto progress 추가
1223v Feb 4, 2024
e8646af
Merge pull request #53 from 1223v/ceoService
1223v Feb 4, 2024
ed6d118
Fix: 회원가입 존재하는 이메일 exception 추가
1223v Feb 4, 2024
565c6e5
Merge pull request #54 from 1223v/ceoService
1223v Feb 4, 2024
2b73a25
Fix: 로그인 role 추가
1223v Feb 4, 2024
621b86f
Style: 코드 포멧팅
1223v Feb 4, 2024
1fec851
Merge pull request #55 from 1223v/ceoService
1223v Feb 4, 2024
ffea6b1
Feat: 입점신청서 AWS S3 비동기 Multipart 파일 업로드 기능 추가
1223v Feb 16, 2024
74e026b
Feat: build.gradle 의존성 추가
1223v Feb 16, 2024
ffc196a
Fix: 로컬 파일 업로드 기능 삭제
1223v Feb 16, 2024
423cb96
Merge pull request #56 from 1223v/fileupload
1223v Feb 16, 2024
84bc28b
Feat: reject 권한 변경 API 추가
1223v Feb 19, 2024
7382dd5
Merge pull request #57 from 1223v/rolechange
1223v Feb 19, 2024
59a92bd
Fix: Ceo 의존성 수정
1223v Feb 19, 2024
1132483
Merge pull request #58 from 1223v/test
1223v Feb 19, 2024
76b6b34
Feat: 포인트 도메인 추가
marinesnow34 Feb 28, 2024
3a047c9
Feat: 유저 파사드 생성
marinesnow34 Feb 28, 2024
d657950
Feat: 포인트 계산 구현
marinesnow34 Feb 28, 2024
4fe271b
Test: 포인트 계산 테스트 코드 작성
marinesnow34 Feb 28, 2024
9bf3a37
Fix: 포인트 계산 %적용 누락 수정
marinesnow34 Feb 28, 2024
036a811
Test: 작은, 중간, 큰 금액 포인트 계산 테스트
marinesnow34 Feb 28, 2024
eecfe3f
Refactor: 포인트 의존성 분리
marinesnow34 Feb 28, 2024
c337aad
Refactor: 코드 컨벤션 준수
marinesnow34 Feb 28, 2024
640fbe5
Merge pull request #59 from marinesnow34/point
marinesnow34 Feb 28, 2024
a6152f2
Fix: 실행 불가 수정
marinesnow34 Feb 28, 2024
527c31b
Merge pull request #60 from marinesnow34/test
marinesnow34 Feb 28, 2024
c749217
Feat: 결제 취소 포인트 회수 구현
marinesnow34 Mar 3, 2024
b04077e
Merge pull request #61 from marinesnow34/test
marinesnow34 Mar 3, 2024
202d6e2
Fix: 주문 취소 트랜잭션 설정
marinesnow34 Mar 3, 2024
15b5abb
Merge pull request #62 from marinesnow34/test
marinesnow34 Mar 3, 2024
f4dd91b
Feat: 아이디 찾기, 비밀번호 찾기 기능 추가
1223v Mar 5, 2024
fb3ee06
Fix: sms 의존성 수정
1223v Mar 5, 2024
bef4a67
Fix: 테스트 코드 Facade 의존성 수정
1223v Mar 5, 2024
87e5099
Merge branch 'test' into findemail
1223v Mar 5, 2024
b19da1d
Merge branch 'findemail' of https://github.com/1223v/readyBusinessBac…
1223v Mar 5, 2024
f425f91
Merge pull request #63 from 1223v/findemail
1223v Mar 5, 2024
fe797f6
Fix: 아이디,비번 찾기 Post 방식 수정
1223v Mar 5, 2024
8cb75d7
Merge pull request #64 from 1223v/findemail
1223v Mar 5, 2024
359ebe4
Fix: Dto 역직렬화 에러 수정
1223v Mar 5, 2024
58d1131
Merge pull request #65 from 1223v/test
1223v Mar 5, 2024
0726953
Fix: 아이디 찾기 JPQL 쿼리 수정
1223v Mar 6, 2024
a9715a8
Merge pull request #66 from 1223v/test
1223v Mar 6, 2024
6342152
Fix: 로그인성공 response 버그 수정
1223v Mar 6, 2024
5adc317
Merge pull request #67 from 1223v/test
1223v Mar 6, 2024
9718319
Feat: 총 매출, 주문건수 API 추가
1223v Mar 6, 2024
486a07f
Merge pull request #68 from 1223v/test
1223v Mar 6, 2024
44981e4
Fix: 아이디 찾기 API res boolean 값 수정
1223v Mar 7, 2024
a7d6809
Merge pull request #69 from 1223v/test
1223v Mar 7, 2024
8dce445
Fix: JWT 인증 방식 헤더로 변경
1223v Mar 8, 2024
ffce8b7
Merge pull request #70 from 1223v/test
1223v Mar 8, 2024
97cdaf0
Refactor: 쿠폰 멀티 유니크 설정
marinesnow34 Mar 9, 2024
5e4d47c
Merge pull request #71 from marinesnow34/coupon
marinesnow34 Mar 9, 2024
5ab28f7
Feat: 비밀번호 변경 아이디로 SMS 인증 번호 발급 API 추가
1223v Mar 9, 2024
594c29c
Merge branch 'test' of https://github.com/1223v/readyBusinessBack int…
1223v Mar 9, 2024
238160c
Merge pull request #72 from 1223v/test
1223v Mar 10, 2024
763aa86
Fix: ceoServiceFacade 참조 에러 해결
1223v Mar 10, 2024
96b4f72
Merge pull request #73 from 1223v/test
1223v Mar 10, 2024
f737f05
Fix: 비밀번호 찾기 검증 수정
1223v Mar 11, 2024
7a5f440
Merge pull request #74 from 1223v/test
1223v Mar 11, 2024
0c0356c
Config: action 메인 ci/cd 구축
marinesnow34 Mar 22, 2024
9099b45
Merge pull request #75 from marinesnow34/test
marinesnow34 Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions .github/workflows/main_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,57 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: test #임시
- name: Checkout source code. # Repo checkout
uses: actions/checkout@v3

- name: Set application.properties from secrets
run: |
echo "${{ secrets.MAIN_APPLICATION_PROPERTIES }}" > src/main/resources/application.properties

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean build

- name: remove plain.jar
run: rm -rf build/libs/*plain.jar

# - name: file copy
# uses: actions/upload-artifact@v3
# with:
# name: libs
# path: build/libs
- name: Upload to Cloudflare
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
BUCKET_NAME: ${{ secrets.CF_BUCKET_NAME }}
ENDPOINT_URL: ${{ secrets.CF_ENDPOINT_URL }}
run: |
echo "test"
aws s3 sync build/libs/ s3://$BUCKET_NAME/java/main/ceo \
--endpoint-url $ENDPOINT_URL --delete --exact-timestamps

- name: SSH and deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.MAIN_HOST }}
username: ${{ secrets.MAIN_USERNAME }}
key: ${{ secrets.MAIN_SSH_KEY }}
port: ${{ secrets.TEST_PORT }}

timeout: 40s # 30초 기본
script: |
aws s3 sync s3://readyvery-dev-server/java/main/ceo ./docker/readyvery/jar \
--endpoint-url https://29c6e4b55b1ddb8d2b6e69df21141caa.r2.cloudflarestorage.com \
--delete --exact-timestamps

docker-compose build readyvery
docker-compose up -d readyvery
14 changes: 14 additions & 0 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- name: Checkout source code. # Repo checkout
uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ out/

### VS Code ###
.vscode/


```
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'


// mysql driver
runtimeOnly 'com.mysql:mysql-connector-j'

Expand All @@ -42,9 +43,21 @@ dependencies {
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'

// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'


//SOLAPI
implementation 'net.nurigo:sdk:4.2.7'

//AWS S3
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.1'

// //Querydsl 추가
// implementation 'com.querydsl:querydsl-core:5.0.0'
// implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/readyvery/readyverydemo/config/CeoApiConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.readyvery.readyverydemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import lombok.Getter;

@Configuration
@Getter
public class CeoApiConfig {
@Value("${jwt.refresh.cookie}")
private String refreshCookie;
@Value("${service.app.admin.key}")
private String serviceAppAdminKey;

}
55 changes: 55 additions & 0 deletions src/main/java/com/readyvery/readyverydemo/config/JwtConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.readyvery.readyverydemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import com.auth0.jwt.algorithms.Algorithm;

import lombok.Getter;

@Configuration
@Getter
public class JwtConfig {

private final String secretKey;
private final Long accessTokenExpirationPeriod;
private final Long refreshTokenExpirationPeriod;
private final String accessTokenName;
private final String refreshTokenName;
private final String frontendUrl;
private final String cookieDomain;
private final Algorithm algorithm;

public static final String ACCESS_TOKEN_SUBJECT = "AccessToken";
public static final String REFRESH_TOKEN_SUBJECT = "RefreshToken";
public static final String EMAIL_CLAIM = "email";
public static final String USER_NUMBER = "userNumber";
public static final String BEARER = "Bearer ";
public static final String AUTHORIZATION = "Authorization";

public JwtConfig(
@Value("${jwt.secretKey}") String secretKey,
@Value("${jwt.access.expiration}") Long accessTokenExpirationPeriod,
@Value("${jwt.refresh.expiration}") Long refreshTokenExpirationPeriod,
@Value("${jwt.access.cookie}") String accessTokenName,
@Value("${jwt.refresh.cookie}") String refreshTokenName,
@Value("${jwt.redirect-uri}") String frontendUrl,
@Value("${jwt.refresh.cookie.domain}") String cookieDomain
) {
this.secretKey = secretKey;
this.accessTokenExpirationPeriod = accessTokenExpirationPeriod;
this.refreshTokenExpirationPeriod = refreshTokenExpirationPeriod;
this.accessTokenName = accessTokenName;
this.refreshTokenName = refreshTokenName;
this.frontendUrl = frontendUrl;
this.cookieDomain = cookieDomain;
this.algorithm = initializeAlgorithm(secretKey);
}

private Algorithm initializeAlgorithm(String secretKey) {
if (secretKey == null || secretKey.trim().isEmpty()) {
throw new IllegalArgumentException("Secret key must not be null or empty");
}
return Algorithm.HMAC512(secretKey);
}
}
29 changes: 29 additions & 0 deletions src/main/java/com/readyvery/readyverydemo/config/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.readyvery.readyverydemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Configuration
public class RedisConfig {

@Value("${spring.data.redis.host}")
private String host;

@Value("${spring.data.redis.port}")
private int port;

@Bean
public RedisConnectionFactory redisConnectionFactory() {

LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(host, port);
log.info("RedisConfig.redisConnectionFactory() called" + lettuceConnectionFactory);
return lettuceConnectionFactory;
}

}
34 changes: 34 additions & 0 deletions src/main/java/com/readyvery/readyverydemo/config/S3Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.readyvery.readyverydemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;

import lombok.Getter;

@Getter
@Configuration
public class S3Config {
@Value("${cloud.aws.credentials.access-key}")
private String accessKey;
@Value("${cloud.aws.credentials.secret-key}")
private String secretKey;
@Value("${cloud.aws.region.static}")
private String region;
@Value("${cloud.aws.s3.bucket}")
private String bucket;

@Bean
public AmazonS3Client amazonS3Client() {
BasicAWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey);
return (AmazonS3Client)AmazonS3ClientBuilder.standard()
.withRegion(region)
.withCredentials(new AWSStaticCredentialsProvider(awsCredentials))
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package com.readyvery.readyverydemo.src.order.config;
package com.readyvery.readyverydemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import net.nurigo.sdk.NurigoApp;
import net.nurigo.sdk.message.service.DefaultMessageService;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
@Configuration
public class SolApiConfig {
public static final String SOLAPI_URL = "https://api.solapi.com";
Expand All @@ -27,4 +33,12 @@ public class SolApiConfig {

@Value("${solapi.kakao.pfid}")
private String kakaoPfid;

@Value("${solapi.phone_number}")
private String phoneNumber;

@Bean
public DefaultMessageService defaultMessageService() {
return NurigoApp.INSTANCE.initialize(apiKey, apiSecret, SOLAPI_URL);
}
}
Loading
Loading