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

Review #102

Merged
merged 213 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
9fa94e1
feat : ProductController 클래스 작성
peacefullyquietly Nov 1, 2024
7af8385
feat : ProductService 로직 내 전체 상품 조회(getAllProducts) 메서드 추가
peacefullyquietly Nov 1, 2024
88bbe51
refactor : 정렬 로직 레이어 이동(controller -> service)
peacefullyquietly Nov 1, 2024
fe4f5f7
feat : @EqualsAndHashCode에 callSuper 값 false로 설정
peacefullyquietly Nov 1, 2024
b1997d5
chore : 주석 수정
peacefullyquietly Nov 1, 2024
8e6096b
feat : ProductRepository에 필요한 메서드 추가
peacefullyquietly Nov 1, 2024
5e8553d
refactor : String 타입의 allergy, freeFroms를 List로 수정
peacefullyquietly Nov 1, 2024
9ff4de7
feat : getAllProducts 메서드 분리
peacefullyquietly Nov 1, 2024
a5f67e9
chore : 주석 수정
peacefullyquietly Nov 1, 2024
d6a3d01
feat : ProductRepository 커스텀 쿼리 추가
peacefullyquietly Nov 1, 2024
8f47798
Merge pull request #67 from peacefullyquietly/weekly/9
jjh4450 Nov 1, 2024
757144d
feat : 상품 명세에 따라 pageInfo DTO 생성
peacefullyquietly Nov 1, 2024
7ee39d5
feat : 추가된 dto에 따른 코드 수정
peacefullyquietly Nov 1, 2024
b1635e3
refactor : 코드 컨벤션에 따른 코드 수정
peacefullyquietly Nov 1, 2024
af99817
Merge remote-tracking branch 'upstream/weekly/9' into test/entity
Nov 1, 2024
85dfbe0
Merge remote-tracking branch 'upstream/tmp' into test/entity
Nov 2, 2024
b1b5edb
refactor : DTO를 RequestBody로 받도록 수정
peacefullyquietly Nov 2, 2024
df6983d
refactor : productAllergies, productFreeFroms 필드 빈 리스트로 초기화
peacefullyquietly Nov 2, 2024
556c6e4
refactor : 변수명 오타 수정 및 파라미터 추가
peacefullyquietly Nov 2, 2024
d8135a0
feat : 상품 생성에 관한 테스트 코드 작성
peacefullyquietly Nov 2, 2024
ee18a0e
refactor : 불필요한 DTO 제거
peacefullyquietly Nov 2, 2024
e1f353d
Merge pull request #70 from peacefullyquietly/weekly/9
jjh4450 Nov 2, 2024
bc7f8a2
Merge remote-tracking branch 'upstream/tmp' into test/entity
Nov 3, 2024
ee67cb7
Merge pull request #69 from kakao-tech-campus-2nd-step3/weekly/9
nimunsang Nov 3, 2024
1ba4e18
Merge remote-tracking branch 'upstream/weekly/9' into test/entity
Nov 3, 2024
2efee30
Merge remote-tracking branch 'upstream/weekly/9' into test/entity
Nov 3, 2024
3e84fb3
chore : 불필요한 필드 삭제
peacefullyquietly Nov 3, 2024
92f0587
Merge pull request #76 from peacefullyquietly/weekly/9
jjh4450 Nov 3, 2024
113ce4d
Merge remote-tracking branch 'upstream/weekly/9' into fix/productResp…
Nov 3, 2024
ec238f1
chore : productResponseDTO 필드 삭제에 따른 테스트 코드 수정
peacefullyquietly Nov 3, 2024
1906e99
Merge pull request #77 from peacefullyquietly/weekly/9
jjh4450 Nov 3, 2024
a666906
Merge remote-tracking branch 'upstream/weekly/9' into fix/productResp…
Nov 4, 2024
b49790c
refactor : reviewDTO 내 productImgUrl 필드 타입 변경
peacefullyquietly Nov 4, 2024
123376b
Merge pull request #78 from peacefullyquietly/refactor/review
jjh4450 Nov 4, 2024
28a6f16
Merge branch 'weekly/9' of https://github.com/kakao-tech-campus-2nd-s…
peacefullyquietly Nov 5, 2024
95ea6e7
refactor: loginUserInfo 주입으로 리팩토링
youcastle03 Nov 4, 2024
d2442b7
refactor: loginUserInfo주입으로 컨트롤러들 변경
youcastle03 Nov 4, 2024
557a8f9
fix: jwt유효시간 10시간->1시간 변경
youcastle03 Nov 4, 2024
84ad5c2
fix: conflict해결
youcastle03 Nov 5, 2024
a58f21d
feat:RefreshToken도 같이 반환
youcastle03 Nov 5, 2024
52e3a7a
refactor: UserEntity KakaoToken으로 명시
youcastle03 Nov 5, 2024
1de7c58
feat:jwtRefreshToken 로그인시 DB저장
youcastle03 Nov 5, 2024
8586cd3
feat:jwtRefreshToken 로그아웃시 DB삭제
youcastle03 Nov 5, 2024
9665cd9
feat:RefreshToken재발급 구현 완료
youcastle03 Nov 5, 2024
7971a22
Merge pull request #83 from kakao-tech-campus-2nd-step3/dev
jjh4450 Nov 6, 2024
f1d9ce2
Merge remote-tracking branch 'upstream/weekly/10' into fix/productRes…
Nov 6, 2024
47e8358
chore:필요없는 주석 삭제
youcastle03 Nov 6, 2024
051ef20
feat: 유저 정보 업데이트 구현
youcastle03 Nov 6, 2024
33e5c11
chore: 속성 수정
youcastle03 Nov 6, 2024
b68bfdf
chore: 주석 추가
youcastle03 Nov 6, 2024
e81afcc
chore: 주석 삭제
youcastle03 Nov 6, 2024
4c9bc67
Merge pull request #84 from youcastle03/weekly/10
jjh4450 Nov 6, 2024
b396303
fix: 에러난 부분 간단히 수정
Nov 6, 2024
4c8d1f8
test: 에러 테스트 우선 주석처리
Nov 6, 2024
4832490
refactor: 리뷰 반영 및 nextPageToken 삭제
Nov 6, 2024
51d391e
Merge remote-tracking branch 'upstream/weekly/10' into fix/productRes…
Nov 6, 2024
bb92a8f
Merge branch 'weekly/10' of https://github.com/kakao-tech-campus-2nd-…
peacefullyquietly Nov 6, 2024
4acbd89
refactor: 파라미터 변경에 따른 주석 수정
Nov 6, 2024
0bc2c1d
Update application.yml
jjh4450 Nov 6, 2024
72d7956
Update application.yml
jjh4450 Nov 6, 2024
6145f53
Merge pull request #85 from kakao-tech-campus-2nd-step3/jjh4450-patch-1
jjh4450 Nov 6, 2024
4efcfa4
Merge branch 'weekly/10' of https://github.com/kakao-tech-campus-2nd-…
peacefullyquietly Nov 6, 2024
3a3c6bc
feat:Token setCookie
youcastle03 Nov 6, 2024
4d7b099
Merge remote-tracking branch 'upstream/weekly/10' into fix/productRes…
Nov 6, 2024
50b2b3e
chore:주석 수정
youcastle03 Nov 6, 2024
47c6037
refactor: 파라미터 변경에 따른 주석 수정
Nov 6, 2024
de71e26
refactor: 페이지네이션 변경에 따른 테스트 수정
Nov 6, 2024
372c357
fix
jjh4450 Nov 7, 2024
bca4712
fix
jjh4450 Nov 7, 2024
d8c601f
변수 정상화
jjh4450 Nov 7, 2024
4e68d74
fix(dockerfile): HEALTHCHECK 정상화
jjh4450 Nov 7, 2024
ad9e9d0
feat : Product Entity내 @Builder.Default 추가
peacefullyquietly Nov 7, 2024
24ccf24
test : 테스트 코드 주석 해제 및 에러 해결
peacefullyquietly Nov 7, 2024
cd606c6
refactor : ArticleLikeRepository 내 @Repository 추가
peacefullyquietly Nov 7, 2024
4e68bf5
Merge pull request #89 from peacefullyquietly/tmp_branch
jjh4450 Nov 7, 2024
921e2f8
refactor : productImgUrl 필드 타입 변경
peacefullyquietly Nov 7, 2024
9b9a822
Merge branch 'feat/product' into tmp_branch
peacefullyquietly Nov 7, 2024
5d92e85
Merge pull request #90 from peacefullyquietly/tmp_branch
jjh4450 Nov 7, 2024
2e28765
fix: 유저 이미지 변경
youcastle03 Nov 7, 2024
1b87dce
refactor: default image 추가
youcastle03 Nov 7, 2024
b51c61d
feat:리뷰 인터셉터에 경로 추가
youcastle03 Nov 7, 2024
8c8cc20
chore: 주석 수정
youcastle03 Nov 7, 2024
00d2416
comment: 주석 추가
youcastle03 Nov 7, 2024
2861770
fix: test error 수정
youcastle03 Nov 7, 2024
b838fd3
Merge pull request #86 from youcastle03/weekly/10
jjh4450 Nov 7, 2024
d0b0e21
fix: merge하면서 생긴 충돌 해결
Nov 7, 2024
441a4e3
refactor: ci오류에 따른 테스트 임시 주석 처리
Nov 7, 2024
02ee8a9
Merge pull request #88 from kakao-tech-campus-2nd-step3/hotfix/db_img
jjh4450 Nov 7, 2024
6f843ad
Merge pull request #87 from humpose/refactor/pagination
jjh4450 Nov 7, 2024
85ace01
Merge branch 'weekly/10' into feat/product
peacefullyquietly Nov 7, 2024
bcad8bc
Merge pull request #93 from kakao-tech-campus-2nd-step3/feat/product
jjh4450 Nov 7, 2024
5cdb593
feat:Article_Likes 인덱싱 추가
youcastle03 Nov 8, 2024
a757c42
feat:Article 인덱싱추가
youcastle03 Nov 8, 2024
1f08808
feat: freeFromCategories 인덱싱 추가
youcastle03 Nov 8, 2024
19dc85d
feat: products 인덱싱 추가
youcastle03 Nov 8, 2024
ede16a5
feat(application): 리다이렉트 url 확정
jjh4450 Nov 8, 2024
d5ec83c
Merge branch 'weekly/10' of https://github.com/kakao-tech-campus-2nd-…
jjh4450 Nov 8, 2024
afd2665
Merge pull request #94 from kakao-tech-campus-2nd-step3/feat/logout_r…
jjh4450 Nov 8, 2024
8b39c5a
feat:review 인덱싱추가
youcastle03 Nov 8, 2024
aa87ebc
faat:wishlist 인덱싱 추가
youcastle03 Nov 8, 2024
81d0ac2
feat:Article_Likes 인덱싱 추가
youcastle03 Nov 8, 2024
3e6ba9b
feat:Article 인덱싱추가
youcastle03 Nov 8, 2024
a545095
feat: freeFromCategories 인덱싱 추가
youcastle03 Nov 8, 2024
bf34af5
feat: products 인덱싱 추가
youcastle03 Nov 8, 2024
1723682
feat:review 인덱싱추가
youcastle03 Nov 8, 2024
0148fb2
faat:wishlist 인덱싱 추가
youcastle03 Nov 8, 2024
655ad5f
chore : webClient 사용과 파싱을 위한 의존성 추가
peacefullyquietly Nov 8, 2024
6341a48
fix(compose): 500 예외 수정
jjh4450 Nov 8, 2024
0395e6a
refactor 바뀐 명세에 따른 dto변경
youcastle03 Nov 8, 2024
e934f1a
fix(): ReviewResponseDTO 완성
jjh4450 Nov 8, 2024
7a348c5
chore : haccp api 호출을 위한 수정
peacefullyquietly Nov 8, 2024
ed3ea6c
feat : HaccpService 클래스 작성
peacefullyquietly Nov 8, 2024
344bbb3
feat : haccp 서비스 호출을 위한 컨트롤러 클래스 작성
peacefullyquietly Nov 8, 2024
220f1d6
feat : haccp api parsing service 클래스 작성
peacefullyquietly Nov 8, 2024
16f38f2
feat(ReviewNotFoundException): ReviewNotFoundException 구성
jjh4450 Nov 8, 2024
87a2cbe
feat : api 호출을 위한 어노테이션 추가 및 필드 수정
peacefullyquietly Nov 8, 2024
8d0cf26
fix(ReviewDTO): 리뷰 DTO를 완벽하게 구성
jjh4450 Nov 8, 2024
a625ab3
feat(ReviewResponseMapper): ReviewResponseMapper 구성
jjh4450 Nov 8, 2024
bae5e14
feat : product price 기본 값 설정
peacefullyquietly Nov 8, 2024
6df6956
feat : 알러지 기본 값 추가
peacefullyquietly Nov 8, 2024
6202952
feat(Review): Review에 빌더 추가
jjh4450 Nov 8, 2024
b32e36f
chore : 서비스 키 값 추가
peacefullyquietly Nov 8, 2024
989e305
refatcor: 바뀐 dto들에 따라 연관관계 편의 메서드 수정 및 서비스 로직 수정
youcastle03 Nov 8, 2024
817a1a1
chore : spring_test.yml 수정
peacefullyquietly Nov 8, 2024
4e33c3c
chore : 현재 사용하지 않는 test code 주석처리
peacefullyquietly Nov 8, 2024
0cc9a8b
fix: resolve conflict
youcastle03 Nov 8, 2024
96c239e
chore : test application.yml에 키 추가
peacefullyquietly Nov 8, 2024
94c6c73
feat(Review): ReviewMapper 추가
jjh4450 Nov 8, 2024
62d5b46
fix(Review): rate를 Long으로 변경
jjh4450 Nov 8, 2024
30bb946
chore:redis의존성 추가
youcastle03 Nov 8, 2024
f310c47
chore:redis 기본설정
youcastle03 Nov 8, 2024
85126f8
refactor:OSIV=false에 따른 컨트롤러에서의 articleLike처리 삭제
youcastle03 Nov 8, 2024
154d77a
fix: 쿠키이름 수정
youcastle03 Nov 8, 2024
d2ef6ee
chore: 주석 수정
youcastle03 Nov 8, 2024
75806e1
fix: 쿠키설정 변경
youcastle03 Nov 8, 2024
861da69
fix:CORS OriginPatterns변경
youcastle03 Nov 8, 2024
75d9a87
feat: 쿠키도메인에 서브도메인 추가
youcastle03 Nov 8, 2024
6e4bad4
Merge pull request #95 from youcastle03/weekly/10
jjh4450 Nov 8, 2024
d405c90
feat : product DTO, Entity 내 tag 필드 추가
peacefullyquietly Nov 8, 2024
fc100de
feat : Product Entity 내 tag 필드 추가
peacefullyquietly Nov 8, 2024
34903cc
feat : mapper 내 tag 생성 코드 추가
peacefullyquietly Nov 8, 2024
4668814
feat : 태그 랜덤 생성 값을 생성하는 메서드 추가
peacefullyquietly Nov 8, 2024
84d3712
feat : 상품 조회 시 비어있는 쿼리에 한하여 가나다순 정렬
peacefullyquietly Nov 8, 2024
f5597f6
fix: 공백 제거
youcastle03 Nov 8, 2024
0f3cd05
chore : 보안을 위해 api 테스트용 컨트롤러 주석처리
peacefullyquietly Nov 8, 2024
1d8c8e4
Merge pull request #98 from youcastle03/weekly/10
jjh4450 Nov 8, 2024
39b977e
feat:exposeHeader설정
youcastle03 Nov 8, 2024
a518312
feat:exposeHeader설정
youcastle03 Nov 8, 2024
4079e3c
Merge pull request #99 from youcastle03/weekly/10
jjh4450 Nov 8, 2024
6b60e7f
refactor: 리뷰 반영해서 dto 엔티티 역할 확실히 분리
Nov 8, 2024
b32af02
test: 테스트 주석 제거 및 변경에 맞게 테스트 수정
Nov 8, 2024
9b728fb
Merge remote-tracking branch 'upstream/weekly/10' into refactor/pagin…
Nov 8, 2024
68ff6e7
refactor: 코치님 리뷰 반영해서 영속성 컨텍스트 변경 감지 기능 활성화
Nov 9, 2024
f41c780
feat(ReviewRequest): ReviewRequest 구성
jjh4450 Nov 9, 2024
eb50a45
fix(ReviewMapper): 불필요한 static 삭제
jjh4450 Nov 9, 2024
9a1c070
fix(ReviewController): ReviewResponseDTO를 사용 하도록 구성
jjh4450 Nov 9, 2024
e94a327
fix(ReviewController): component 빈 추가
jjh4450 Nov 9, 2024
2849cdf
fix(ReviewService): 리뷰 서비스 및 컨트롤러 추가
jjh4450 Nov 9, 2024
fa82494
fix(ReviewService): 순환 참조 문제 해결
jjh4450 Nov 9, 2024
259b4f4
refactor: 메서드 주석 복구
Nov 9, 2024
c8e2587
refactor : product entity내 price 기본 값 수정
peacefullyquietly Nov 9, 2024
288034e
Merge pull request #96 from peacefullyquietly/tmp_branch
jjh4450 Nov 9, 2024
e47f989
refactor: mapper로 dto<->entity 변환 메서드 관리
Nov 9, 2024
ccfed8d
refactor: 불변객체로 인한 setter삭제 및 업데이트 메서드 변경 취소
Nov 9, 2024
86b5dcb
refactor: 미사용 import 삭제
Nov 9, 2024
5171d1e
fix(ReviewService): static 삭제
jjh4450 Nov 9, 2024
44ae87f
fix(ReviewService): builder 추가
jjh4450 Nov 9, 2024
5e84071
fix(User): 안전한 테스트로직 추가
jjh4450 Nov 9, 2024
1358693
test(Review): Review 테스트 구성 완료
jjh4450 Nov 9, 2024
eaec63f
merge
jjh4450 Nov 9, 2024
5e7ee54
fix: 불필요한 id반환 제거
Nov 9, 2024
d858106
Merge remote-tracking branch 'upstream/weekly/10' into refactor/wishlist
Nov 9, 2024
2db48bc
fix(Entity): 안전하게 엔티티 기본 값을 설정
jjh4450 Nov 9, 2024
ee1357b
fix(Entity): 안전하게 엔티티 기본 값을 설정
jjh4450 Nov 9, 2024
b6005d1
fix(Entity): spy 객체 적용 준비
jjh4450 Nov 9, 2024
42257bb
fix: 위시리스트 예외에 대해 적절한 httpStatus설정
Nov 9, 2024
698cc6e
fix(User): 안전한 setId 생성
jjh4450 Nov 9, 2024
d2d97da
Merge pull request #101 from jjh4450/fix/review_fix
jjh4450 Nov 9, 2024
d7e1408
feat:sameSite:None
youcastle03 Nov 9, 2024
5a98cc6
fix: 리프레시토큰 쿠키 만료싲간 재설정
youcastle03 Nov 9, 2024
abdf3eb
fix:ExceptionHandler Return raw type
youcastle03 Nov 9, 2024
16b5f7d
fix:wishListNotFoundException httpStatus type
youcastle03 Nov 9, 2024
2e304f3
feat: redis config
youcastle03 Nov 9, 2024
2a0d0de
feat: redis config
youcastle03 Nov 9, 2024
ff5e368
fix:오타 수정
youcastle03 Nov 10, 2024
662ecdc
Merge pull request #97 from kakao-tech-campus-2nd-step3/weekly/10
nimunsang Nov 10, 2024
50c38c8
feat:BlackListRepository
youcastle03 Nov 10, 2024
c8b0a0f
feat:TokenService
youcastle03 Nov 10, 2024
f9dc815
feat:로그아웃시 블랙리스트 등록
youcastle03 Nov 10, 2024
ee0507e
refactor: cookie 반환 취소
youcastle03 Nov 10, 2024
2a02980
feat: blackList
youcastle03 Nov 10, 2024
06cedc0
feat:sameSite:None
youcastle03 Nov 9, 2024
6af155f
fix: 리프레시토큰 쿠키 만료싲간 재설정
youcastle03 Nov 9, 2024
0e3eba3
fix:ExceptionHandler Return raw type
youcastle03 Nov 9, 2024
362c3b6
fix:wishListNotFoundException httpStatus type
youcastle03 Nov 9, 2024
5d28de9
feat: redis config
youcastle03 Nov 9, 2024
7590486
feat: redis config
youcastle03 Nov 9, 2024
4e8205e
fix:오타 수정
youcastle03 Nov 10, 2024
a217d0c
feat:BlackListRepository
youcastle03 Nov 10, 2024
bd74d07
feat:TokenService
youcastle03 Nov 10, 2024
5b7670c
feat:로그아웃시 블랙리스트 등록
youcastle03 Nov 10, 2024
ac02e1a
refactor: cookie 반환 취소
youcastle03 Nov 10, 2024
1f526f6
feat: blackList
youcastle03 Nov 10, 2024
ead10d9
chore: 빈칸 수정
youcastle03 Nov 10, 2024
ce7b582
충돌 해결
youcastle03 Nov 10, 2024
491241b
fix: merge 컨플릭트 해결
Nov 11, 2024
7823f9f
fix: test용 url수정
youcastle03 Nov 11, 2024
c89b328
fix: url수정
youcastle03 Nov 11, 2024
b340dd2
feat:testyml에 redis정보 수정
youcastle03 Nov 11, 2024
d4717e2
fix:test yml수정
youcastle03 Nov 11, 2024
6e158a6
Merge pull request #103 from youcastle03/weekly/10
jjh4450 Nov 11, 2024
587004d
Merge pull request #104 from humpose/fix/mergeConflict
jjh4450 Nov 11, 2024
b202bbc
Merge pull request #105 from kakao-tech-campus-2nd-step3/weekly/10
jjh4450 Nov 11, 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
9 changes: 8 additions & 1 deletion .github/workflows/spring_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
DB_NAME=super_poo
DB_CONTAINER_NAME=super_poo_container
JWT_SECRET_KEY=top_secret_key_for_ci
SERVICE_KEY = test_key
REDIS_PORT = 1111
REDIS_URL = jdbc:redis://aaa/superfoo:1111
REDIS_HOST = yeah
REDIS_ID = hello
REDIS_PASSWORD = redis

EOF

- name: Set up JDK 21
Expand All @@ -53,7 +60,7 @@ jobs:
run: ./gradlew build -x test

- name: Run Tests
run: ./gradlew test --info
run: ./gradlew test

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ out/
compose.yml.network.yml

## dev options
.env*
.env*
*.network.yml
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ repositories {
}

dependencies {
implementation ("com.googlecode.json-simple:json-simple:1.1")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation ("io.netty:netty-resolver-dns-native-macos:4.1.70.Final:osx-aarch_64")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
compileOnly("org.projectlombok:lombok")
Expand All @@ -34,9 +37,15 @@ dependencies {
testImplementation("org.springframework.boot:spring-boot-starter-test")
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

//jwt
implementation("io.jsonwebtoken:jjwt-api:0.12.6")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.12.6")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.12.6")


//redis
implementation("org.springframework.boot:spring-boot-starter-data-redis")
}

tasks.withType<Test> {
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ COPY --from=build /app/build/libs/*.jar app.jar
USER appuser

HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost:8080 || exit 1
CMD nc -z localhost 8080 || exit 1

ENTRYPOINT sh -c "java -Xms${JAVA_MIN_MEM} -Xmx${JAVA_MAX_MEM} -XX:MaxMetaspaceSize=${JAVA_MAX_METASPACE} -jar app.jar"
2 changes: 0 additions & 2 deletions docker/compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# $docker compose -f compose.yml -f compose.prod.yml -p aeat_prod up --build

version: '3.8'

services:
db:
volumes:
Expand Down
8 changes: 6 additions & 2 deletions docker/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
services:
db:
image: mysql:latest #MySQL 이미지 버전맞춰서하면될듯
env_file:
- .env
image: mysql:latest
container_name: ${DB_CONTAINER_NAME}
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
Expand All @@ -15,8 +17,10 @@ services:
start_period: 30s
ports:
- ${DB_HOST_PORT}:${DB_CONTAINER_PORT}
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', '--lower_case_table_names=1']

# app:
# depends_on:
# - db
# env_file:
# - .env
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#Fri Nov 08 21:33:23 KST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
57 changes: 57 additions & 0 deletions src/main/java/jeje/work/aeatbe/config/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package jeje.work.aeatbe.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.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
import org.springframework.data.redis.serializer.StringRedisSerializer;

@Configuration
@EnableRedisRepositories
public class RedisConfig {

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

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

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

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

@Bean
public RedisConnectionFactory redisConnectionFactory() {
RedisStandaloneConfiguration config = new RedisStandaloneConfiguration(host, port);
config.setUsername(username);
config.setPassword(password);
return new LettuceConnectionFactory(config);

}


@Bean
public RedisTemplate<String, Object> redisTemplate() {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(redisConnectionFactory());

redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(new StringRedisSerializer());

redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.setHashValueSerializer(new StringRedisSerializer());

redisTemplate.setDefaultSerializer(new StringRedisSerializer());

return redisTemplate;
}



}
9 changes: 7 additions & 2 deletions src/main/java/jeje/work/aeatbe/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(jwtInterceptor)
.addPathPatterns("/api/article/likes/**")
.addPathPatterns("/api/users/logout/**")
. addPathPatterns("/api/wishlist/**");
. addPathPatterns("/api/wishlist/**")
.addPathPatterns("/api/reviews/my/**")
.addPathPatterns("/api/users/info/**");
}

@Override
Expand All @@ -37,11 +39,14 @@ public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentRes
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowedOriginPatterns("https://aeat.jeje.work", "http://localhost","*")
.allowedMethods("*")
.allowedHeaders("*")
.allowCredentials(true)
.exposedHeaders("Set-Cookie", "Access-Control-Allow-Origin",
"Access-Control-Allow-Credentials","Authorization")
.maxAge(3600);
}


}
13 changes: 6 additions & 7 deletions src/main/java/jeje/work/aeatbe/controller/ArticleController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import jeje.work.aeatbe.dto.article.ArticleResponseDTO;
import jeje.work.aeatbe.service.ArticleService;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand Down Expand Up @@ -33,21 +36,17 @@ public ResponseEntity<ArticleDTO> createArticle(@RequestBody ArticleDTO articleD
* @param category 칼럼의 카테고리
* @param title 칼럼의 제목
* @param subtitle 칼럼의 소제목
* @param sortby 정렬 기준
* @param pageToken 페이지 토큰
* @param maxResults 한 페이지당 가져올 칼럼의 최대 개수 (기본값: 10)
* @param pageable 페이지네이션 정보 (기본값: 페이지 크기 10, 날짜 기준 내림차순 정렬)
* @return 칼럼 목록과 페이지 정보가 포함된 DTO와 상태 코드 200 (OK)
*/
@GetMapping
public ResponseEntity<ArticleListResponseDTO> getArticles(
@RequestParam(required = false) String category,
@RequestParam(required = false) String title,
@RequestParam(required = false) String subtitle,
@RequestParam(defaultValue = "new") String sortby,
@RequestParam(defaultValue = "0") String pageToken,
@RequestParam(defaultValue = "10") int maxResults) {
@PageableDefault(size = 10, sort = "date", direction = Sort.Direction.DESC) Pageable pageable) {

ArticleListResponseDTO articles = articleService.getArticles(category, title, subtitle, sortby, pageToken, maxResults);
ArticleListResponseDTO articles = articleService.getArticles(category, title, subtitle, pageable);
return ResponseEntity.ok(articles);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jeje.work.aeatbe.annotation.LoginUser;
import jeje.work.aeatbe.dto.articleLike.ArticleLikeRequestDTO;
import jeje.work.aeatbe.dto.articleLike.ArticleLikeResponseDTO;
import jeje.work.aeatbe.dto.user.LoginUserInfo;
import jeje.work.aeatbe.entity.ArticleLike;
import jeje.work.aeatbe.service.ArticleLikeService;
import lombok.RequiredArgsConstructor;
Expand All @@ -25,14 +26,14 @@ public class ArticleLikeController {
/**
* 좋아요를 가져온다
* @param articleId
* @param loginUserId
* @param loginUserInfo
* @return ArticleLikeResponseDTO
*/
@GetMapping
public ResponseEntity<ArticleLikeResponseDTO> getArticleLikes(@RequestParam Long articleId, @LoginUser Long loginUserId) {
ArticleLike articlelike = articleLikeService.findArticleLikeByUserAndArticle(loginUserId, articleId);
public ResponseEntity<ArticleLikeResponseDTO> getArticleLikes(@RequestParam Long articleId, @LoginUser LoginUserInfo loginUserInfo) {
Long articleLikeId = articleLikeService.findArticleLikeByUserAndArticle(loginUserInfo.userId(), articleId);
int like = articleLikeService.getArticleLikeCount(articleId);
return ResponseEntity.ok().body(new ArticleLikeResponseDTO(articlelike.getId(),like));
return ResponseEntity.ok().body(new ArticleLikeResponseDTO(articleLikeId,like));
}


Expand All @@ -42,21 +43,21 @@ public ResponseEntity<ArticleLikeResponseDTO> getArticleLikes(@RequestParam Long
* @return ArticleLikePostResponseDTO
*/
@PostMapping
public ResponseEntity<ArticleLikeResponseDTO> addArticleLike(@RequestBody ArticleLikeRequestDTO articleLikeRequestDTO, @LoginUser Long loginUserId) {
ArticleLike articleLike = articleLikeService.likeArticle(loginUserId, articleLikeRequestDTO.articleId());
public ResponseEntity<ArticleLikeResponseDTO> addArticleLike(@RequestBody ArticleLikeRequestDTO articleLikeRequestDTO, @LoginUser LoginUserInfo loginUserInfo) {
Long articleLikeId = articleLikeService.likeArticle(loginUserInfo.userId(), articleLikeRequestDTO.articleId());
int like = articleLikeService.getArticleLikeCount(articleLikeRequestDTO.articleId());
return ResponseEntity.ok().body(new ArticleLikeResponseDTO(articleLike.getId(),like));
return ResponseEntity.ok().body(new ArticleLikeResponseDTO(articleLikeId,like));
}

/**
* 좋아요 삭제
* @param articleLikeId
* @param loginUserId
* @param loginUserInfo
* @return HTTP.status.OK
*/
@DeleteMapping("/{articleLikeId}")
public ResponseEntity<?> deleteArticleLike(@PathVariable Long articleLikeId, @LoginUser Long loginUserId) {
articleLikeService.deleteArticleLike(articleLikeId);
public ResponseEntity<?> deleteArticleLike(@PathVariable Long articleLikeId, @LoginUser LoginUserInfo loginUserInfo) {
articleLikeService.deleteArticleLike(loginUserInfo.userId());
return ResponseEntity.ok().build();
}

Expand Down
36 changes: 36 additions & 0 deletions src/main/java/jeje/work/aeatbe/controller/HaccpController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//package jeje.work.aeatbe.controller;
//
//import jeje.work.aeatbe.service.HaccpService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.servlet.view.RedirectView;
//
//
///**
// * haccp api 호출용 컨트롤러
// */
//@RestController
//@RequestMapping("/api/test")
//public class HaccpController {
//
// private final HaccpService haccpService;
//
// @Autowired
// public HaccpController(HaccpService haccpService) {
// this.haccpService = haccpService;
// }
//
// /**
// * api 호출
// */
// @GetMapping
// public void redirectToHaccpApi() {
//// String apiUrl = haccpService.getProductApiUrl(); // 생성된 URL 가져오기
//// System.out.println("Redirecting to: " + apiUrl); // 리다이렉트할 URL 로그 출력
//
// haccpService.getProductApi();
//// return new RedirectView(apiUrl); // 해당 URL로 리다이렉트
// }
//}
24 changes: 15 additions & 9 deletions src/main/java/jeje/work/aeatbe/controller/KakaoAuthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
import jeje.work.aeatbe.domian.KakaoProperties;
import jeje.work.aeatbe.domian.KakaoTokenResponsed;
import jeje.work.aeatbe.dto.Kakao.LogoutResponseDto;
import jeje.work.aeatbe.dto.Kakao.TokenResponseDto;
import jeje.work.aeatbe.dto.user.TokenResponseDTO;
import jeje.work.aeatbe.dto.user.LoginUserInfo;
import jeje.work.aeatbe.service.KakaoService;
import jeje.work.aeatbe.service.TokenService;
import jeje.work.aeatbe.service.UserService;
import jeje.work.aeatbe.utility.JwtUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -28,6 +31,7 @@ public class KakaoAuthController {
private final JwtUtil jwtUtil;
private final KakaoProperties kakaoProperties;
private final KakaoService kakaoService;
private final TokenService tokenService;

/**
* 카카오 로그인페이지로 리다이렉션
Expand All @@ -45,26 +49,28 @@ public void redirectKakaoLogin(HttpServletResponse response) throws IOException
/**
* 카카오 로그인후 jwt토큰 발급
* @param code
* @return
* @return httpHeader(Cookie)
*/
@GetMapping("/callback")
public ResponseEntity<TokenResponseDto> getAccessToken(@RequestParam String code){
public ResponseEntity<TokenResponseDTO> getAccessToken(@RequestParam String code) {
KakaoTokenResponsed token = kakaoService.getKakaoTokenResponse(code);
String jwt = kakaoService.login(token.accessToken(), token.refreshToken());
return ResponseEntity.ok(new TokenResponseDto(jwt));
TokenResponseDTO tokenResponseDto = kakaoService.login(token.accessToken(), token.refreshToken());
HttpHeaders httpHeaders = userService.setCookie(tokenResponseDto);
return ResponseEntity.ok().body(tokenResponseDto);
}

/**
* 카카오 로그아웃후 카카오계정과 함께 로그아웃으로 리다이렉션
* @param response
* @param userid
* @param loginUserInfo
* @throws IOException
*/
@PostMapping("/logout")
public void logout(HttpServletResponse response, @LoginUser Long userid) throws IOException{
public void logout(HttpServletResponse response, @RequestHeader("Authorization") String token, @LoginUser LoginUserInfo loginUserInfo) throws IOException{
String url = kakaoProperties.logoutUrl() +
"?client_id=" + kakaoProperties.clientId() + "&logout_redirect_uri=" + kakaoProperties.logoutRedirectUrl();
LogoutResponseDto logoutResponseDto = kakaoService.logout(userid);
tokenService.addBlackList(tokenService.removePrefix(token), loginUserInfo.userId().toString());
LogoutResponseDto logoutResponseDto = kakaoService.logout(loginUserInfo.userId());
response.sendRedirect(url);
}

Expand Down
Loading
Loading