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

fix: 보유금액이 선결제 금액보다 작을 경우 상태값 변경(200->400) #167

Merged
merged 110 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
754b1c0
feat: 장바구니 추가 기능 구현
LEEJaeHyeok97 Nov 19, 2024
9c2f259
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 19, 2024
b5de2ba
feat: 장바구니 조회 기능 구현
LEEJaeHyeok97 Nov 19, 2024
ca6b405
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 19, 2024
5b563b5
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 19, 2024
b4dbfe4
feat: 상품 주문과 식권 사용 기능 구현
LEEJaeHyeok97 Nov 19, 2024
fc50cd6
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 19, 2024
d97a8de
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 19, 2024
74c8af5
style: 포인트트랜잭션 레포지토리명 변경
LEEJaeHyeok97 Nov 19, 2024
25cb8d0
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 19, 2024
4b89797
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 19, 2024
5976f75
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 19, 2024
eae3903
deploy: 재배포
LEEJaeHyeok97 Nov 19, 2024
7e1ada5
deploy: 재배포2
LEEJaeHyeok97 Nov 19, 2024
ca608fb
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
63413e0
deploy: 로그인 로직 수정에 따른 재배포
LEEJaeHyeok97 Nov 20, 2024
e20a015
deploy: 로그인 로직 수정에 따른 재배포2
LEEJaeHyeok97 Nov 20, 2024
c627cc2
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
9829a4b
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
2f66ad9
feat: 식권 사용 기능 구현
LEEJaeHyeok97 Nov 20, 2024
163d698
feat: yml 수정 사항 반영
LEEJaeHyeok97 Nov 20, 2024
3de7376
feat: 식권 사용 로직 수정
LEEJaeHyeok97 Nov 20, 2024
ccc6df3
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 20, 2024
f791988
feat: 주문 로직 수정 완료
LEEJaeHyeok97 Nov 20, 2024
36965a7
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 20, 2024
6bc0d02
fix: 장바구니에 아무것도 없을 때 주문 시 active 되는 현상 수정
LEEJaeHyeok97 Nov 20, 2024
7ae17ee
feat: 주문 완료 시 리턴 값 수정
LEEJaeHyeok97 Nov 20, 2024
9ca3a35
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 20, 2024
2ffe327
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 20, 2024
e82f58c
feat: 내 그룹 조회 기능 구현
LEEJaeHyeok97 Nov 20, 2024
a98d6f0
feat: 기본 프로필 이미지 url 추가
LEEJaeHyeok97 Nov 20, 2024
9376ed6
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 20, 2024
4c73bf5
feat: 그룹 멤버 전체 조회 기능 구현
LEEJaeHyeok97 Nov 21, 2024
125752b
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 21, 2024
9f89029
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 21, 2024
32836c3
feat: 1인당 사용 가능 금액 설정 컬럼 추가
LEEJaeHyeok97 Nov 21, 2024
ca2a8dc
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 21, 2024
16c56a3
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 21, 2024
f30aa7c
feat: 내 지갑 조회 기능 구현
LEEJaeHyeok97 Nov 21, 2024
5ec891e
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 21, 2024
44827ce
feat: 선결제 기능 구현
LEEJaeHyeok97 Nov 21, 2024
74ca8b0
feat: 유저 홈 화면 조회 기능 구현
LEEJaeHyeok97 Nov 21, 2024
dc09775
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 21, 2024
2864139
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 22, 2024
aef871a
feat: 그룹 상세 조회 기능 구현
LEEJaeHyeok97 Nov 22, 2024
f19e93f
feat: 가게 상세 조회 쿼리 수정
LEEJaeHyeok97 Nov 23, 2024
d15f3a2
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 23, 2024
6109e9f
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
47e29b4
deploy: 변경사항 반영을 위한 커밋
LEEJaeHyeok97 Nov 23, 2024
90ba864
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
9400ff1
deploy: 수정 사항 반영 재배포
LEEJaeHyeok97 Nov 23, 2024
8609c35
deploy: rds 교체로 인한 재배포
LEEJaeHyeok97 Nov 23, 2024
3e79389
deploy: rds 교체로 인한 재배포2
LEEJaeHyeok97 Nov 23, 2024
8e7a2a5
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
6aea111
feat: 홈 화면 소속팀 조회 쿼리 제대로 안되던 현상 해결, 대표이미지 반환 추가
LEEJaeHyeok97 Nov 23, 2024
ab8d7d2
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
a53ef21
feat: 그룹 상세 조회 응답 컬럼명 변경
LEEJaeHyeok97 Nov 23, 2024
f4b31c2
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
83c7f69
feat: memberLimit 컬럼 삭제
LEEJaeHyeok97 Nov 23, 2024
25be727
feat: 선결제 시 기존 결제 내역과 멱등성 문제 해결
LEEJaeHyeok97 Nov 23, 2024
afdbfbe
fix: 팀 상세 조회 시 이미지 쿼리가 의미 없이 join 되던 쿼리 수정
LEEJaeHyeok97 Nov 23, 2024
1f65811
feat: 가게 검색 기능 대폭 수정
LEEJaeHyeok97 Nov 23, 2024
08f03f7
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
530ca13
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
5a674fb
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
aae5ff4
feat: 프론트 요구사 반영
LEEJaeHyeok97 Nov 23, 2024
f2ec318
:wq
LEEJaeHyeok97 Nov 23, 2024
47de53b
feat: searchcondition 삭제
LEEJaeHyeok97 Nov 23, 2024
1ca86f0
feat: 팀타입 desription 리턴 하도록 수정
LEEJaeHyeok97 Nov 23, 2024
713efe9
feat: 카테고리별 팀 조회 시 팀 생성일 컬럼 추가
LEEJaeHyeok97 Nov 23, 2024
ef61b17
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 23, 2024
dcfa727
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
4c7bd3c
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 23, 2024
7f1f36e
feat: 매장찾기_상세 페이지 조회 기능 구현
LEEJaeHyeok97 Nov 23, 2024
906596b
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 23, 2024
d874384
feat: 비밀 코드 조회 기능 엔드 포인트 수정
LEEJaeHyeok97 Nov 23, 2024
fb598b8
fix: conflict fix
LEEJaeHyeok97 Nov 23, 2024
1caba7e
hotfix: 서버 복구
LEEJaeHyeok97 Nov 25, 2024
eacfa91
hotfix: 서버 복구2
LEEJaeHyeok97 Nov 25, 2024
4204711
Merge branch 'develop' into develop
LEEJaeHyeok97 Nov 25, 2024
6a23c61
feat: Barobill api 연동
LEEJaeHyeok97 Nov 26, 2024
191ccbe
fix: 홈 화면에 같은 데이터가 중복되는 현상 수정
LEEJaeHyeok97 Nov 26, 2024
cbdc42c
infra: ElastiCache 연결을 위한 docker-compose 설정
LEEJaeHyeok97 Nov 27, 2024
1a22d38
infra: cicd script 수정
LEEJaeHyeok97 Nov 27, 2024
05a6fcb
infra: cicd script ec2 주소 설정
LEEJaeHyeok97 Nov 27, 2024
5213ccb
infra: cicd script 수정2
LEEJaeHyeok97 Nov 27, 2024
b3d2fac
infra: cicd script 수정3
LEEJaeHyeok97 Nov 27, 2024
fe275dd
infra: cicd script 수정4
LEEJaeHyeok97 Nov 27, 2024
525bf16
infra: cicd script 수정5
LEEJaeHyeok97 Nov 27, 2024
b096362
infra: cicd script 수정6
LEEJaeHyeok97 Nov 27, 2024
bf19d26
infra: cicd script 수정7
LEEJaeHyeok97 Nov 27, 2024
a54a681
infra: cicd script 수정7
LEEJaeHyeok97 Nov 27, 2024
1218ffd
infra: cicd script 수정8
LEEJaeHyeok97 Nov 27, 2024
1f1b075
infra: cicd script 수정9
LEEJaeHyeok97 Nov 27, 2024
30ff013
infra: cicd script 수정10
LEEJaeHyeok97 Nov 27, 2024
9465c6b
infra: cicd script 수정11
LEEJaeHyeok97 Nov 27, 2024
7dbb131
infra: cicd script 수정12
LEEJaeHyeok97 Nov 27, 2024
30714d3
infra: cicd script 수정13
LEEJaeHyeok97 Nov 27, 2024
dc6994c
infra: cicd script 수정14
LEEJaeHyeok97 Nov 27, 2024
91edd67
infra: cicd script 수정15
LEEJaeHyeok97 Nov 27, 2024
337640b
infra: cicd script 수정16
LEEJaeHyeok97 Nov 27, 2024
eb4ee46
infra: cicd script 수정17
LEEJaeHyeok97 Nov 27, 2024
3b15052
Merge branch '9oormthon-univ:develop' into develop
LEEJaeHyeok97 Nov 27, 2024
1ac7306
infra: cicd script 수정18
LEEJaeHyeok97 Nov 27, 2024
983397a
Merge branch 'develop' of https://github.com/LEEJaeHyeok97/2024_DANPO…
LEEJaeHyeok97 Nov 27, 2024
0f74f33
infra: cicd script 수정19
LEEJaeHyeok97 Nov 27, 2024
34c8a68
infra: cicd script 수정20
LEEJaeHyeok97 Nov 27, 2024
0631975
infra: cicd script 수정21
LEEJaeHyeok97 Nov 27, 2024
7820b6f
infra: cicd script 수정22
LEEJaeHyeok97 Nov 27, 2024
d0d8d7d
fix: 보유금액이 선결제 금액보다 작을 경우 상태값 변경(200->400)
LEEJaeHyeok97 Nov 27, 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
52 changes: 40 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,46 @@ jobs:
runs-on: self-hosted

steps:
# 1. 최신 이미지를 풀받습니다
- name: docker pull
run: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/jangburich2
- uses: actions/checkout@v3

- name: Setup SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.EC2_SSH_KEY }}

- name: Add EC2 to known_hosts
run: |
ssh-keyscan -H ip-172-31-3-107 >> ~/.ssh/known_hosts

# 2. 기존의 컨테이너를 중지시킵니다
- name: docker stop container
run: sudo docker stop $(sudo docker ps -q) 2>/dev/null || true
- name: Copy docker-compose.yml to EC2
run: |
scp docker-compose.yml ubuntu@ip-172-31-3-107:/home/ubuntu/

# 3. 최신 이미지를 컨테이너화하여 실행시킵니다
- name: docker run new container
run: sudo docker run --name jangburich2 --rm -d -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/jangburich2
- name: Login to Docker Hub on EC2
run: |
ssh ubuntu@ip-172-31-3-107 '
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | sudo docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
'

# 4. 미사용 이미지를 정리합니다
- name: delete old docker image
run: sudo docker system prune -f
- name: Stop existing Redis process
run: |
if pgrep redis-server; then
sudo systemctl stop redis || echo "Redis service not managed by systemctl"
pkill redis-server || echo "No Redis process to kill"
fi

# 0. 최신 이미지를 풀받습니다
- name: docker pull
run: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/jangburich2

# 1. docker-compose 종료
- name: docker-compose down
run: sudo docker-compose down

# 2. docker-compose 실행
- name: docker-compose up
run: sudo docker-compose up -d

# 3. 안쓰는 이미지 제거
- name: Remove unused Docker images
run: sudo docker image prune -f
8 changes: 3 additions & 5 deletions compose-prod.yml → docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
services:
api-server:
build:
context: .
dockerfile: ./Dockerfile
app:
image: rookie97/jangburich2:latest
ports:
- 8080:8080
depends_on:
Expand All @@ -15,4 +13,4 @@ services:
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
retries: 10
retries: 10
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,9 @@ public Message prepay(String userId, PrepayRequest prepayRequest) {
Store store = storeRepository.findById(prepayRequest.storeId())
.orElseThrow(() -> new IllegalArgumentException("유효하지 않은 가게 id 입니다."));

if (!team.getTeamLeader().getUser_id().equals(user.getUserId())) {
return Message.builder()
.message("팀의 리더가 아닌 사람은 선결제를 할 수 없습니다.")
.build();
}
team.validateIsTeamLeader(team.getTeamLeader().getUser_id(), user.getUserId());

if (prepayRequest.prepayAmount() > user.getPoint()) {
return Message.builder()
.message("보유하고 있는 금액이 선결제 하려는 금액보다 적습니다.")
.build();
}
user.validateHasPointWithPrepayAmount(prepayRequest.prepayAmount(), user.getPoint());

user.usePoint(prepayRequest.prepayAmount());
PointTransaction pointTransaction = PointTransaction
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/jangburich/domain/team/domain/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,10 @@ public Team(String name, String description, String secretCode, TeamLeader teamL
this.point = point;
this.teamType = teamType;
}

public void validateIsTeamLeader(Long userId, Long userId1) {
if (!userId.equals(userId1)) {
throw new IllegalArgumentException("팀의 리더가 아닌 사람은 선결제를 할 수 없습니다.");
}
}
}
6 changes: 6 additions & 0 deletions src/main/java/com/jangburich/domain/user/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ public static User create(String userId, String nickname, String email, String i
newUser.setPoint(0);
return newUser;
}

public void validateHasPointWithPrepayAmount(int prepayAmount, Integer point) {
if (prepayAmount > point) {
throw new IllegalArgumentException("보유하고 있는 금액이 선결제 하려는 금액보다 적습니다.");
}
}
}