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

Dev #40

Open
wants to merge 121 commits into
base: main
Choose a base branch
from
Open

Dev #40

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
d84017c
Update actions.yml
MinchoGreenT Oct 20, 2023
ae467b5
[feat] ꡬ글 μ†Œμ…œ 둜그인
MinchoGreenT Oct 20, 2023
317c79a
Merge branch 'dev' into feature_1/μœ μ €-auth-κ΅¬ν˜„(-토큰-μž¬λ°œκΈ‰,-λ‘œκ·Έμ•„μ›ƒ)
Ryeolee Oct 20, 2023
fa308a6
Merge pull request #4 from Mojacknong/feature_1/μœ μ €-auth-κ΅¬ν˜„(-토큰-μž¬λ°œκΈ‰,-λ‘œβ€¦
Ryeolee Oct 20, 2023
4da5562
Merge branch 'google-login'
MinchoGreenT Oct 20, 2023
9fbf6be
Merge branch 'dev' into feature_2/google-login
MinchoGreenT Oct 20, 2023
0ebc1a7
Merge pull request #5 from Mojacknong/feature_2/google-login
MinchoGreenT Oct 20, 2023
747f3c2
Merge remote-tracking branch 'origin/feature_1/μœ μ €-auth-κ΅¬ν˜„(-토큰-μž¬λ°œκΈ‰,-λ‘œκ·Έβ€¦
MinchoGreenT Oct 21, 2023
9f30539
[fix] μž¬λ°œκΈ‰, λ‘œκ·Έμ•„μ›ƒ 컨트둀러 λ³€κ²½
MinchoGreenT Oct 21, 2023
275a2b3
Merge branch 'dev' into feature_1/μœ μ €-auth-κ΅¬ν˜„(-토큰-μž¬λ°œκΈ‰,-λ‘œκ·Έμ•„μ›ƒ)
MinchoGreenT Oct 21, 2023
0120979
Merge pull request #6 from Mojacknong/feature_1/μœ μ €-auth-κ΅¬ν˜„(-토큰-μž¬λ°œκΈ‰,-λ‘œβ€¦
MinchoGreenT Oct 21, 2023
c48078a
[fix] μž¬λ°œκΈ‰ λ©”μ„œλ“œ userId ν˜•λ³€ν™˜ μˆ˜μ •
MinchoGreenT Oct 21, 2023
63e6e99
Merge remote-tracking branch 'origin/feature_1/μœ μ €-auth-κ΅¬ν˜„(-토큰-μž¬λ°œκΈ‰,-λ‘œκ·Έβ€¦
MinchoGreenT Oct 21, 2023
b5e5a0b
[fix]
MinchoGreenT Oct 21, 2023
a615cef
[fix] λ¦¬ν”„λ ˆμ‰¬ 토큰 μ €μž₯ μ‹œ bearer 제거
MinchoGreenT Oct 21, 2023
559e9c5
[fix] UserRepository의 findUserRole λ©”μ„œλ“œ λ°˜ν™˜κ°’ User -> String λ³€κ²½
MinchoGreenT Oct 22, 2023
69e0948
[fix] 둜그인, λ‘œκ·Έμ•„μ›ƒ μ‹œ Bearer 뢙이지 μ•Šκ³  토큰 λ°˜ν™˜
MinchoGreenT Oct 23, 2023
7a8197f
Merge pull request #10 from Mojacknong/feature_1/μœ μ €-auth-κ΅¬ν˜„(-토큰-μž¬λ°œκΈ‰,-…
MinchoGreenT Oct 23, 2023
5744641
[feat] μ—λŸ¬μ²˜λ¦¬ μΆ”κ°€
Ryeolee Oct 27, 2023
d9506d3
[feat] μž¬λ°œκΈ‰ μ—λŸ¬μ²˜λ¦¬ 적용 확인 ν…ŒμŠ€νŠΈ
Ryeolee Oct 27, 2023
72233dd
[fix] μΈμŠ€ν„΄μŠ€ 도컀 κΆŒν•œ 적용
Ryeolee Oct 27, 2023
b976adf
[fix] jwt secret λ³€κ²½
Ryeolee Oct 27, 2023
9997370
[fix] 포트번호 λ³€κ²½
Ryeolee Oct 27, 2023
5c88fb2
[fix] 포트번호 λ³€κ²½
Ryeolee Oct 27, 2023
9b2181b
[fix] 포트번호 λ³€κ²½
Ryeolee Oct 27, 2023
99cd678
[fix] 포트번호 λ³€κ²½ 8081
Ryeolee Oct 27, 2023
885b27b
[fix] unauthorizedException μ—λŸ¬ μ‚­μ œ
Ryeolee Oct 27, 2023
217f533
[fix] 토큰 μž¬λ°œκΈ‰ μ‹œ λ¦¬ν”„λ ˆμ‹œ 토큰 빈 κ°’ 처리
Ryeolee Oct 27, 2023
b1503a5
[fix] 토큰 μž¬λ°œκΈ‰ μ‹œ λ¦¬ν”„λ ˆμ‹œ 토큰 빈 κ°’ 처리
Ryeolee Oct 27, 2023
8dcb729
[fix] 토큰 μž¬λ°œκΈ‰ μ‹œ λ¦¬ν”„λ ˆμ‹œ 토큰 빈 κ°’ 처리
Ryeolee Oct 27, 2023
4c168cd
[fix] 토큰 μž¬λ°œκΈ‰ μ‹œ λ¦¬ν”„λ ˆμ‹œ 토큰 빈 κ°’ 처리
Ryeolee Oct 27, 2023
1ef7e7a
[fix] 토큰 μž¬λ°œκΈ‰ μ‹œ λ¦¬ν”„λ ˆμ‹œ 토큰 빈 κ°’ 처리
Ryeolee Oct 27, 2023
627687f
[fix] μž¬λ°œκΈ‰ api μœ νš¨μ„± 검사 μ—λŸ¬μ²˜λ¦¬ μˆ˜μ •
Ryeolee Oct 28, 2023
335c43d
Merge pull request #12 from Mojacknong/feature_11/μ—λŸ¬μ²˜λ¦¬-μΆ”κ°€
Ryeolee Oct 29, 2023
19f40ba
[fix] 카카였, ꡬ글 둜그인 ν”„λ‘œν•„ 이미지 가져와 μ €μž₯, 주석 μ½”λ“œ μ‚­μ œ
Ryeolee Oct 29, 2023
fee7553
[fix] 둜그인 μ‹œ 초기 μœ μ €, κΈ°μ‘΄ μœ μ € ꡬ뢄 boolean μΆ”κ°€
Ryeolee Oct 29, 2023
e95e184
Merge pull request #15 from Mojacknong/feature_13/카카였,-ꡬ글-둜그인-μˆ˜μ •
MinchoGreenT Oct 29, 2023
da64130
[feat] μœ μ € λ‹‰λ„€μž„ 생성 API
Ryeolee Oct 29, 2023
e335fa0
[feat] μœ μ € λ‹‰λ„€μž„ μˆ˜μ • API
Ryeolee Oct 29, 2023
10473ae
[feat] μœ μ € μ‚­μ œ API 및 λ‹‰λ„€μž„ μ—…λ°μ΄νŠΈ put -> patch
Ryeolee Oct 29, 2023
be6b4b1
[feat] μ˜¨λ³΄λ”© 초기 λžœλ”λ§ API, ResponseDto 상속ꡬ쑰
Ryeolee Oct 29, 2023
c533aea
[feat] ν”„λ‘œν•„ 사진 μ—…λ‘œλ“œ api λ―Έμ™„μ„±, s3 연동
Ryeolee Oct 29, 2023
cc0d093
[fix] ci/cd μž¬μ‹œλ„
Ryeolee Oct 29, 2023
e86eb10
[fix] ci/cd μž¬μ‹œλ„
Ryeolee Oct 29, 2023
66518d8
[fix] ci/cd μž¬μ‹œλ„
Ryeolee Oct 29, 2023
32546c0
[fix] form-data ν˜•μ‹ μΆ”κ°€
Ryeolee Oct 30, 2023
9066ea3
[feat] 이미지 μ—…λ‘œλ“œ API 및 둜그인 early λ³€μˆ˜ μœ„μΉ˜ μˆ˜μ •
Ryeolee Oct 30, 2023
13f00d4
Merge pull request #16 from Mojacknong/feature_14/-μœ μ €-κ΄€λ ¨-API-κ΅¬ν˜„
MinchoGreenT Oct 30, 2023
a066a36
[feat] μœ μ € 도메인 db, μ—”ν‹°ν‹° 적용
Ryeolee Nov 1, 2023
5e6b3b4
[feat] 이전 컀밋 ci/cd 적용
Ryeolee Nov 1, 2023
55d6884
[feat] μ˜¨λ³΄λ”© 동기 API
Ryeolee Nov 1, 2023
e6c5021
[fix] BaseResponse μ—λŸ¬μ²˜λ¦¬ μΆ”κ°€
Ryeolee Nov 2, 2023
dc83598
[fix] BaseResponse μ—λŸ¬μ²˜λ¦¬ isSuccess
Ryeolee Nov 2, 2023
36cc499
[fix] λΉ„λ‹ˆμ§€μŠ€ μ—λŸ¬μ²˜λ¦¬, μ‹œμŠ€ν…œ μ—λŸ¬μ²˜λ¦¬
Ryeolee Nov 3, 2023
8c44355
[fix] 응닡 data λ³€κ²½
Ryeolee Nov 3, 2023
a175a54
[feat] μ˜¨λ³΄λ”© λ‚œμ΄λ„ 쑰회
Ryeolee Nov 3, 2023
705327a
[fix] μœ μ € μ—”ν‹°ν‹° μˆ˜μ •(동기 μ—”ν‹°ν‹° μΆ”κ°€)
Ryeolee Nov 3, 2023
0f37a0f
[fix] μ˜¨λ³΄λ”© λ‚œμ΄λ„ API μˆ˜μ •
Ryeolee Nov 3, 2023
c88304d
[fix] μ˜¨λ³΄λ”© 동기 API μˆ˜μ •
Ryeolee Nov 3, 2023
dbbef1a
[fix] μ˜¨λ³΄λ”© uri μˆ˜μ • /user -> /user/on-boarding
Ryeolee Nov 3, 2023
716d9cd
[feat] λ‹‰λ„€μž„, ν”„λ‘œν•„ 이미지 μ—…λ‘œλ“œ API,이전 λ‹‰λ„€μž„ API, ν”„λ‘œν•„ 이미지 μ—…λ‘œλ“œ API μ£Όμ„μ²˜λ¦¬
Ryeolee Nov 3, 2023
33faa73
[fix] λ‹‰λ„€μž„ μ—…λ°μ΄νŠΈ ν•¨μˆ˜ μ£Όμ„μ²˜λ¦¬ ν•΄μ œ
Ryeolee Nov 3, 2023
fac1466
[fix] 포트 번호 λ³€κ²½
Ryeolee Nov 5, 2023
198a18c
[fix] redis host μˆ˜μ •
Ryeolee Nov 5, 2023
b6f63e6
[fix] ipλ³€κ²½
Ryeolee Nov 6, 2023
3a7d159
[fix] ipλ³€κ²½
Ryeolee Nov 6, 2023
e89d216
Merge pull request #18 from Mojacknong/feature_17/μœ μ €-db적용-및-μ˜¨λ³΄λ”©-κ΅¬ν˜„
Ryeolee Nov 8, 2023
a43fdb4
[fix] 둜그인 API early μˆ˜μ • μ™„λ£Œ
Ryeolee Nov 8, 2023
7070c95
[feat] νšŒμ›κ°€μž…, μ˜¨λ³΄λ”© μ™„λ£Œ API
Ryeolee Nov 8, 2023
c098f44
Merge pull request #20 from Mojacknong/feature_19/νšŒμ›,-둜그인-API
Ryeolee Nov 8, 2023
c3201c9
[fix] ν”„λ‘œν•„, λ‹‰λ„€μž„ μ„€μ • api μˆ˜μ • isEmpty -> null
Ryeolee Nov 9, 2023
ae19ad1
[fix] ν”„λ‘œν•„, λ‹‰λ„€μž„ μ„€μ • api μˆ˜μ • null -> isEmpty
Ryeolee Nov 9, 2023
4237d02
[fix] ν”„λ‘œν•„, λ‹‰λ„€μž„ μ„€μ • api μˆ˜μ •
Ryeolee Nov 9, 2023
b2b0c18
[feat] λ‹‰λ„€μž„ μ„€μ • api ν™œμ„±ν™”
Ryeolee Nov 9, 2023
6304c23
[fix] μ˜¨λ³΄λ”© λ‚œμ΄λ„ λ°°μ—΄ μ„€μ •
Ryeolee Nov 9, 2023
c0e3f53
[fix] λ‚œμ΄λ„ 이름 λ³€κ²½
Ryeolee Nov 9, 2023
fcbf9a7
[feat] μ˜€ν”ˆνŽ˜μΈ λͺ¨λ“  μœ μ € 쑰회 API κ΅¬ν˜„
Ryeolee Nov 9, 2023
93cc260
[feat] μ˜€ν”ˆνŽ˜μΈ νŠΉμ • μœ μ € 쑰회 API
Ryeolee Nov 10, 2023
0220434
[fix] return λ³€κ²½
Ryeolee Nov 10, 2023
004a6e0
[fix] action.yml 파일 ν΄λΌμš°λ“œ 배포
Ryeolee Nov 10, 2023
4b3efd6
[fix] action.yml 파일 ν΄λΌμš°λ“œ 배포
Ryeolee Nov 10, 2023
af16044
Merge pull request #22 from Mojacknong/feature_21/-μœ μ €-μ˜€ν”ˆ-페인-API
Ryeolee Nov 11, 2023
65b0f3f
[fix] μ˜¨λ³΄λ”© λ‚œμ΄λ„ μΈ‘μ • ν•¨μˆ˜ μˆ˜μ •
Ryeolee Nov 11, 2023
811a21c
[fix] νšŒμ›κ°€μž… ν”„λ‘œν•„ μ•ˆκ°€μ Έμ˜€κΈ° 쀑볡 ν•¨μˆ˜ 제거
Ryeolee Nov 11, 2023
70809d8
[fix] 동기 λ‹€λŒ€λ‹€ db μˆ˜μ •, 동기 api μˆ˜μ •
Ryeolee Nov 11, 2023
0bd2ee0
Merge pull request #24 from Mojacknong/feature_23/11/11회의-μˆ˜μ •
Ryeolee Nov 11, 2023
38dea30
[feat] μœ μ € 정보(+κ°€μž… ν›„ κ²½κ³Ό κΈ°κ°„) API μ™„λ£Œ
Ryeolee Nov 11, 2023
c0588d9
[fix] μœ μ € ν”„λ‘œν•„ 사진 등둝 μ‹œ null 처리 μ—λŸ¬ ν•΄κ²°
Ryeolee Nov 12, 2023
93d5f89
[feat] μœ μ € ν”„λ‘œν•„ μ‚­μ œ API μ™„λ£Œ
Ryeolee Nov 13, 2023
6759a6e
Merge pull request #26 from Mojacknong/feature_25/μœ μ €-정보-쑰회
Ryeolee Nov 15, 2023
f7a17c3
[feat] νŒŒμ΄μ–΄λ² μ΄μŠ€ 토큰 μ‚½μž… API μ™„λ£Œ
Ryeolee Nov 15, 2023
41e5a15
[feat] νŒŒμ΄μ–΄λ² μ΄μŠ€ 토큰 μ‚­μ œ API μ™„λ£Œ
Ryeolee Nov 15, 2023
e2b0644
[feat] νŒŒμ΄μ–΄λ² μ΄μŠ€ λ©”μ‹œμ§€ 보내기
Ryeolee Nov 17, 2023
e0e8449
Merge pull request #28 from Mojacknong/feature_27/νŒŒμ΄μ–΄λ² μ΄μŠ€-관리
Ryeolee Nov 17, 2023
9d7022d
[fix] 전체적인 μ½”λ“œ λ¦¬νŒ©ν† λ§ (κ²½κ³  μ—†μ• κΈ°)
Ryeolee Nov 17, 2023
72004f0
[fix] 배포 ν™˜κ²½μ— push
Ryeolee Nov 17, 2023
5245dd8
[fix] config redis μˆ˜μ •
Ryeolee Nov 17, 2023
87c5d15
[fix] 유레카 적용
Ryeolee Nov 20, 2023
59ab095
Merge pull request #30 from Mojacknong/feature_29/μ½”λ“œ-정리
Ryeolee Nov 20, 2023
c67af56
Merge pull request #31 from Mojacknong/feature_27/νŒŒμ΄μ–΄λ² μ΄μŠ€-관리
Ryeolee Nov 20, 2023
103f4eb
[feat] farm, community μ˜€ν”ˆ 페인 적용
Ryeolee Nov 20, 2023
6129d9a
[feat] farm, community μ˜€ν”ˆ 페인 적용
Ryeolee Nov 20, 2023
6ee84f3
[fix] 유레카 ν•΄μ œ
Ryeolee Nov 20, 2023
3060bed
[fix] 유레카 적용
Ryeolee Nov 20, 2023
608f44f
[fix] 팜 μ‚­μ œ μ£Όμ„μ²˜λ¦¬
Ryeolee Nov 20, 2023
f5c01d2
[fix] entity cascade μˆ˜μ •
Ryeolee Nov 20, 2023
8e4eb8f
[feat] 페인용 μœ μ € λ‚œμ΄λ„ 쑰회 api μž‘μ„±
MinchoGreenT Nov 20, 2023
02b16fc
Merge pull request #34 from Mojacknong/feature_33/μœ μ €-λ‚œμ΄λ„-쑰회-api
MinchoGreenT Nov 20, 2023
2629ab7
[feat] 페인용 μœ μ € λ‚œμ΄λ„ 및 별λͺ… 쑰회 api
MinchoGreenT Nov 20, 2023
d67d072
Merge pull request #35 from Mojacknong/feature_33/μœ μ €-λ‚œμ΄λ„-쑰회-api
MinchoGreenT Nov 20, 2023
32d26b1
[fix] μœ μ € μ•‘μ„ΈμŠ€ 토큰 κΈ°ν•œ μˆ˜μ •
MinchoGreenT Nov 21, 2023
c010e44
Merge pull request #37 from Mojacknong/feature_36/μ•‘μ„ΈμŠ€-토큰-κΈ°ν•œ-μˆ˜μ •
MinchoGreenT Nov 21, 2023
7641dd7
[feat] 페인용 μœ μ € λ‚œμ΄λ„ 쑰회 api μž‘μ„±
MinchoGreenT Nov 20, 2023
5e91ee8
[feat] 페인용 μœ μ € λ‚œμ΄λ„ 및 별λͺ… 쑰회 api
MinchoGreenT Nov 20, 2023
3ef3694
[fix] μœ μ € μ•‘μ„ΈμŠ€ 토큰 κΈ°ν•œ μˆ˜μ •
MinchoGreenT Nov 21, 2023
9cfea35
[fix] μœ μ € μ‚­μ œ μ‹œ κ²Œμ‹œκΈ€κ³Ό μ±„μ†Œ μ „λΆ€ μ‚­μ œ
MinchoGreenT Nov 21, 2023
9945f0e
Merge pull request #39 from Mojacknong/feature_32/계정-μ‚­μ œ-api
Ryeolee Nov 22, 2023
e97844d
[feat] 동기뢀여 메세지 api
MinchoGreenT Nov 23, 2023
37c4546
Update actions.yml
MinchoGreenT Nov 23, 2023
4d906ea
[feat] 동기뢀여 메세지 api
MinchoGreenT Nov 23, 2023
80dd2e6
Merge remote-tracking branch 'origin/dev' into dev
MinchoGreenT Nov 23, 2023
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
6 changes: 4 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ModernFarmer CI/CD

on:
push:
branches: ["dev"]
branches: ["feature_32/계정-μ‚­μ œ-api", "dev"]

permissions:
contents: read
Expand Down Expand Up @@ -49,6 +49,7 @@ jobs:
echo "${{ secrets.PROPERTIES_YML }}" > ./application.yml
shell: bash


# λΉŒλ“œ(ν…ŒμŠ€νŠΈ μŠ€ν‚΅)
- name: Build with Gradle
run: ./gradlew build -x test
Expand All @@ -68,8 +69,9 @@ jobs:
username: ubuntu
key: ${{ secrets.EC2_PRIVATE_KEY }}
script: |

docker stop ModernFarmerUser
docker rm ModernFarmerUser
docker rmi ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:1.0
docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:1.0
docker run -d -p 80:8080 --name ModernFarmerUser ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:1.0
docker run -d -p 8081:8081 --name ModernFarmerUser ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:1.0
10 changes: 10 additions & 0 deletions .jpb/jpb-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JpaPluginProjectSettings">
<option name="entityNameTemplate" />
<option name="isLombokBuilder" value="true" />
<option name="isLombokAllArgsConstructor" value="true" />
<option name="isLombokNoArgsConstructor" value="true" />
<option name="scaffoldingLanguage" />
</component>
</project>
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ repositories {
mavenCentral()
}

ext {
set('springCloudVersion', "2021.0.8")
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
Expand All @@ -39,6 +45,19 @@ dependencies {
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.2'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.2'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2'

implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'

// firebase sdk
implementation 'com.google.firebase:firebase-admin:6.8.1'
// okhttp
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@EnableJpaAuditing
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
public class FarmusUserApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package modernfarmer.server.farmususer.community;


import modernfarmer.server.farmususer.user.dto.response.BaseResponseDto;
import modernfarmer.server.farmususer.user.entity.BaseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(url = "http://3.38.2.59:8082", name = "community-service")
public interface CommunityServiceFeignClient {

@DeleteMapping("/api/community/posting/all-posting/{userId}")
void deleteAllPosting(@PathVariable("userId") Long userId);




}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package modernfarmer.server.farmususer.farm;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(url = "http://3.36.221.140:8081", name = "farm-service")
public interface FarmServiceFeignClient {

@DeleteMapping("/api/veggie/{userId}")
void deleteAllVeggies(@PathVariable("userId") Long userId);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package modernfarmer.server.farmususer.global.config.Firebase;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;

@Builder
@AllArgsConstructor
@Getter
public class FcmMessage {
private boolean validate_only;
private Message message;
@Builder
@AllArgsConstructor
@Getter
public static class Message {

private Notification notification;

private String token;
}
@Builder
@AllArgsConstructor
@Getter
public static class Notification {
private String title;
private String body;
private String image;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package modernfarmer.server.farmususer.global.config.Firebase;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.auth.oauth2.GoogleCredentials;
import lombok.RequiredArgsConstructor;
import okhttp3.*;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.List;

@Component
@RequiredArgsConstructor
public class FirebaseCloudMessageService {

private final String API_URL = "https://fcm.googleapis.com/v1/projects/tourcash-13092/messages:send"; // ν”„λ‘ νŠΈμ—μ„œ μ œκ³΅ν•œ url
private final ObjectMapper objectMapper;

public void sendMessageTo(String targetToken, String title, String body) throws IOException {
String message = makeMessage(targetToken, title, body);
OkHttpClient client = new OkHttpClient();
RequestBody requestBody = RequestBody.create(message, MediaType.get("application/json; charset=utf-8"));
Request request = new Request.Builder()
.url(API_URL)
.post(requestBody)
.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + getAccessToken())
.addHeader(HttpHeaders.CONTENT_TYPE, "application/json; UTF-8")
.build();
Response response = client.newCall(request)
.execute();

System.out.println(response.body().string());

}
private String makeMessage(String targetToken, String title, String body) throws JsonProcessingException {
FcmMessage fcmMessage = FcmMessage.builder()
.message(FcmMessage.Message.builder()
.token(targetToken)
.notification(FcmMessage.Notification.builder()
.title(title)
.body(body)
.image(null)
.build()
).build()
)
.validate_only(false)
.build();
return objectMapper.writeValueAsString(fcmMessage);
}


private String getAccessToken() throws IOException {
String firebaseConfigPath = "firebase/firebase_service_key.json"; // ν”„λ‘ νŠΈμ—μ„œ 받은 νŒŒμΌμ„ ν•΄λ‹Ή μœ„μΉ˜μ— λ„£κΈ°
GoogleCredentials googleCredentials = GoogleCredentials
.fromStream(new ClassPathResource(firebaseConfigPath).getInputStream())
.createScoped(List.of("https://www.googleapis.com/auth/cloud-platform"));
googleCredentials.refreshIfExpired();
return googleCredentials.getAccessToken().getTokenValue();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public RedisConnectionFactory redisConnectionFactory() {
RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration();
redisStandaloneConfiguration.setHostName(redisHost);
redisStandaloneConfiguration.setPort(Integer.parseInt(redisPort));
LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisStandaloneConfiguration);
return lettuceConnectionFactory;
return new LettuceConnectionFactory(redisStandaloneConfiguration);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package modernfarmer.server.farmususer.global.config.s3;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@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;

@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
@@ -0,0 +1,68 @@
package modernfarmer.server.farmususer.global.config.s3;

import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.PutObjectRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Optional;
import java.util.UUID;

@Slf4j
@Component
public class S3Uploader {
private final AmazonS3Client amazonS3Client;

@Value("${cloud.aws.s3.bucket}")
private String bucket;

public S3Uploader(AmazonS3Client amazonS3Client) {
this.amazonS3Client = amazonS3Client;
}

public String uploadFiles(
MultipartFile multipartFile, String dirName) throws IOException {
File uploadFile = convert(multipartFile).orElseThrow(() ->
new IllegalArgumentException("error: MultipartFile -> File convert fail"));
return upload(uploadFile, dirName);
}

public String upload(File uploadFile, String filePath) {
String fileName = filePath + "/" + UUID.randomUUID() + uploadFile.getName();
String uploadImageUrl = putS3(uploadFile, fileName);
removeNewFile(uploadFile);
return uploadImageUrl;
}

private String putS3(File uploadFile, String fileName) {
amazonS3Client.putObject(
new PutObjectRequest(bucket, fileName, uploadFile)
.withCannedAcl(CannedAccessControlList.PublicRead));
return amazonS3Client.getUrl(bucket, fileName).toString();
}

private void removeNewFile(File targetFile) {
if (targetFile.delete()) {
System.out.println("File delete success");
return;
}
System.out.println("File delete fail");
}

private Optional<File> convert(MultipartFile file) throws IOException {
File convertFile = new File(System.getProperty("user.dir") + "/" + file.getOriginalFilename());
if (convertFile.createNewFile()) {
try (FileOutputStream fileOutputStream = new FileOutputStream(convertFile)) {
fileOutputStream.write(file.getBytes());
}
return Optional.of(convertFile);
}
return Optional.empty();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package modernfarmer.server.farmususer.global.enums;

public class Motivations {

public enum Motive_1 {
MOTIVE1_1("μ±„μ†Œλ₯Ό 직접 길러\n식비λ₯Ό μ€„μ—¬λ³΄μ„Έμš”!"),
MOTIVE1_2("직접 κΈ°λ₯Έ μ±„μ†Œλ‘œ\nμ•Œλœ°ν•˜κ³  ν˜„λͺ…ν•œ 식사λ₯Ό ν•΄λ΄μš”!"),
MOTIVE1_3("μ˜€λŠ˜λ„ μ±„μ†Ÿκ°’\nμ•Œλœ°ν•˜κ²Œ μ•„λΌλŠ” 쀑!"),
MOTIVE1_4("ν™ˆνŒŒλ°μœΌλ‘œ μ§€μΆœμ€ 쀄이고\n성취감은 λ”ν•΄λ΄μš”"),
MOTIVE1_5("직접 κΈ°λ₯Έ μ±„μ†Œλ‘œ\n맀일 μ•Œλœ°ν•˜κ²Œ, 맀일 νŠΉλ³„ν•˜κ²Œ!");

private final String motive1;

Motive_1(String motive1) {
this.motive1 = motive1;
}

public String getMotive() {
return motive1;
}
}
public enum Motive_2 {
MOTIVE2_1("직접 κΈ°λ₯Έ μ±„μ†Œλ₯Ό\n먹을 수 μžˆλŠ” κ·Έλ‚ κΉŒμ§€!"),
MOTIVE2_2("μ‹ μ„ ν•¨μœΌλ‘œ 가득 μ±„μ›Œμ§€λŠ” 식탁, \n늘 ν•¨κ»˜ν• κ²Œμš”!"),
MOTIVE2_3("눈으둜 λ³΄λŠ” 재미, μž…μœΌλ‘œ λ§›λ³΄λŠ”\nν™ˆνŒŒλ°μ˜ 즐거움!");

private final String motive2;

Motive_2(String motive2) {
this.motive2 = motive2;
}

public String getMotive() {
return motive2;
}
}
public enum Motive_3 {
MOTIVE3_1("λ°”μœ μΌμƒμ—μ„œ 잠깐 λ²—μ–΄λ‚˜\n텃밭을 κ°€κΏ”λ΄μš”"),
MOTIVE3_2("ν™ˆνŒŒλ°μ„ ν•˜λ©°\n마음의 μ•ˆμ •μ„ λŠκ»΄λ΄μš”!"),
MOTIVE3_3("슀트레슀 λ°›λŠ” ν•˜λ£¨, \nν™ˆνŒŒλ°μœΌλ‘œ νžλ§ν•˜μ„Έμš”"),
MOTIVE3_4("λ‚˜λ§Œμ˜ μ±„μ†Œλ₯Ό ν‚€μš°λ©°\nμ†Œμ†Œν•œ 성취감을 λŠκ»΄λ³΄μ„Έμš”"),
MOTIVE3_5("성취감은 κΎΈμ€€ν•¨μ—μ„œ! \nμ˜€λŠ˜λ„ ν•¨κ»˜ μ„±μž₯ν•΄μš”");

private final String motive3;

Motive_3(String motive3) {
this.motive3 = motive3;
}

public String getMotive() {
return motive3;
}
}
}
Loading