Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
586384f
Merge branch 'main' into develop
CodeVac513 Jun 12, 2025
a4c83c9
Merge remote-tracking branch 'origin' into develop
CodeVac513 Jun 12, 2025
0633303
feat: 반환값 dto단으로 분리
ooojin000 Jun 16, 2025
a962a92
feat: 서비스 로직에서 DTO로 반환값 분리
ooojin000 Jun 16, 2025
d28016c
Merge pull request #246 from goorm-369/feature/refactor-response-dto
ooojin000 Jun 16, 2025
941fb32
feat: homeService 테스트 코드
ooojin000 Jun 16, 2025
447f959
feat: scrapRepository 테스트 코드
ooojin000 Jun 16, 2025
83103d4
feat: categoryRepository 테스트 코드
ooojin000 Jun 16, 2025
0dc1548
feat: bidRepository 테스트 코드
ooojin000 Jun 16, 2025
3834898
feat: auctionRepository 테스트 코드
ooojin000 Jun 16, 2025
a6a5008
fix: refactor bid
jiyeonyh Jun 17, 2025
50d62e2
feat: add find top bid query
jiyeonyh Jun 17, 2025
1905e08
fix: change place bid logic
jiyeonyh Jun 17, 2025
fb76576
fix: change INTERNAL_SERVER_ERROR message
jiyeonyh Jun 17, 2025
0aebcbe
Merge branch 'main' into develop
CodeVac513 Jun 17, 2025
9049cce
perf: 쿼리 성능 개선
CodeVac513 Jun 17, 2025
6859f4f
feat: auctionRepository테스트 코드
ooojin000 Jun 17, 2025
8b90ff6
Merge pull request #248 from goorm-369/feature/home-test
ooojin000 Jun 18, 2025
aae7aac
Merge pull request #249 from goorm-369/perf/auction-search
CodeVac513 Jun 18, 2025
90ba925
feat: s3Service 로직 수정
ooojin000 Jun 18, 2025
eb8e4f8
feat: 만료시간 필드 제거 및 publicUrl 필드 추가
ooojin000 Jun 18, 2025
2dcd175
feat: 불필요한 메서드 제거
ooojin000 Jun 18, 2025
83c9970
feat: 이미지 url get방식 수정
ooojin000 Jun 18, 2025
f71b39a
Merge pull request #251 from goorm-369/feature/presigned-url
ooojin000 Jun 18, 2025
95ed36f
Merge remote-tracking branch 'origin/develop' into develop
CodeVac513 Jun 18, 2025
21e9b2b
chore: staging 서버 CD 스크립트
CodeVac513 Jun 18, 2025
37547ab
Merge pull request #252 from goorm-369/chore/staging-cd-script
CodeVac513 Jun 18, 2025
19b0e18
fix: 잘못된 변수 사용한 부분 수정
CodeVac513 Jun 18, 2025
7a17aad
Merge pull request #253 from goorm-369/chore/staging-cd
CodeVac513 Jun 18, 2025
db5f687
fix: 스크립트 ECR 피트 수정
CodeVac513 Jun 18, 2025
8c07625
Merge pull request #254 from goorm-369/chore/staging-script-fix
CodeVac513 Jun 18, 2025
4877cd5
fix: 잘못된 변수 사용한 부분 수정
CodeVac513 Jun 18, 2025
80ab101
Merge pull request #255 from goorm-369/chore/cd-script
CodeVac513 Jun 18, 2025
856c8ac
fix: 스크립트 이름 수정
CodeVac513 Jun 18, 2025
a68b431
Merge pull request #256 from goorm-369/chore/script-container-name
CodeVac513 Jun 18, 2025
f5f95a4
chore: 프로메테우스 의존성 추가
CodeVac513 Jun 18, 2025
3ba9a05
chore: metric url 전역 허용하도록 수정
CodeVac513 Jun 19, 2025
2ac2d76
chore: actuator 의존성 추가
CodeVac513 Jun 19, 2025
39812ee
Merge pull request #257 from goorm-369/chore/prometheus
CodeVac513 Jun 19, 2025
f2dde0d
chore: 배포 서버와 스테이징 서버에서 log를 파일로 쓰고 확인할 수 있도록 수정
CodeVac513 Jun 20, 2025
78f6997
Merge pull request #258 from goorm-369/chore/docker-mount
CodeVac513 Jun 20, 2025
e1a89ce
fix: 오타 수정
CodeVac513 Jun 20, 2025
a9c615f
Merge pull request #259 from goorm-369/fix/docker-mount
CodeVac513 Jun 20, 2025
fafda12
chore: 경로 수정
CodeVac513 Jun 20, 2025
f98de7c
Merge pull request #260 from goorm-369/chore/cd-path
CodeVac513 Jun 20, 2025
5d7c402
feat: apply Redis setnx lock and split placeBid to BidExecutorService…
jiyeonyh Jun 20, 2025
e9c0b22
refactor: guarantee SSE event and lock release after transaction via …
jiyeonyh Jun 20, 2025
3bd2aeb
refactor: remove Prometheus dependencies
jiyeonyh Jun 20, 2025
4e53bb9
feat: add error codes for lock-related failures
jiyeonyh Jun 20, 2025
9dc8167
refactor: remove pessimistic lock and update top bid query for Redis …
jiyeonyh Jun 20, 2025
01a282c
feat: add code for spin lock implementation
jiyeonyh Jun 20, 2025
070352e
feat: implement lock retry logic using Redis pub/sub
jiyeonyh Jun 20, 2025
a28fcb4
feat: add SSE response for bid result after place bid logic
jiyeonyh Jun 20, 2025
e6fe66f
feat: add Swagger docs for bid result SSE subscription API
jiyeonyh Jun 20, 2025
ef10951
refactor: replace @MockBean with manual Mockito mocks in BidControlle…
jiyeonyh Jun 23, 2025
735118e
refactor: update bid placement tests to match revised placeBidWithLoc…
jiyeonyh Jun 23, 2025
60c571e
refactor: move user authentication logic back to controller
jiyeonyh Jun 23, 2025
65d7e03
refactor: move user authentication logic back to controller
jiyeonyh Jun 23, 2025
6775551
chore: remove unused classes for code cleanup
jiyeonyh Jun 23, 2025
d8d7b13
feat: auctionRepository 경매 상태 변경 메서드
ooojin000 Jun 23, 2025
2f95850
feat: fallback 스케줄러
ooojin000 Jun 23, 2025
08cda8a
feat: redis TTL 키 생성
ooojin000 Jun 23, 2025
f094ca1
feat: 경매 상태 변경 service
ooojin000 Jun 23, 2025
ff1353b
feat: 경매 상태 전환 메서드 및 heartbeat 추가
ooojin000 Jun 23, 2025
1eb2fe9
feat: auctionStatusEventResponse 추가
ooojin000 Jun 23, 2025
257526d
feat: auctionStatusPayload 추가
ooojin000 Jun 23, 2025
2d72ba9
feat: 경매 상태 pub
ooojin000 Jun 23, 2025
4fad5a3
feat: 경매 상태 sub
ooojin000 Jun 23, 2025
490f71c
feat: redis 관련 config
ooojin000 Jun 23, 2025
9b1d700
feat: redis TTL 만료 리스너
ooojin000 Jun 23, 2025
728d4f9
feat: 로그 수정
ooojin000 Jun 23, 2025
3e348f2
Merge pull request #261 from goorm-369/feature/bid-concurrency
jiyeonyh Jun 24, 2025
3e612d2
Merge branch 'develop' into feature/sheduler
ooojin000 Jun 24, 2025
0a2017c
Merge pull request #263 from goorm-369/feature/sheduler
ooojin000 Jun 24, 2025
53ca578
feat: redisListenerConfig 하나로 통합
ooojin000 Jun 24, 2025
ffac6f8
feat: redisConfig 위치 이동 및 수정
ooojin000 Jun 24, 2025
7a9eed1
feat: jacksonConfig 제거
ooojin000 Jun 24, 2025
55f1d34
feat: lockReleaseSubscriber 수정
ooojin000 Jun 24, 2025
727b74a
feat: redisListenerConfig 파일 위치 이동
ooojin000 Jun 24, 2025
e3640ac
Merge pull request #264 from goorm-369/hotfix/redis
ooojin000 Jun 24, 2025
f9a782d
feat: topBid 서비스 로직 수정
ooojin000 Jun 25, 2025
fa90e98
feat: topBid 쿼리 개선
ooojin000 Jun 25, 2025
32b0e33
feat: 스케줄러 5분마다로 수정
ooojin000 Jun 25, 2025
592f262
feat: redisListenerConfig 파일 이동
ooojin000 Jun 25, 2025
7bd108c
feat: left 조인 -> 조인 변경
ooojin000 Jun 25, 2025
8a9a8fc
feat: left 조인 -> 조인
ooojin000 Jun 25, 2025
4ba7a48
Merge pull request #266 from goorm-369/feature/hom-top-bid
ooojin000 Jun 25, 2025
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
150 changes: 150 additions & 0 deletions .github/workflows/deploy-palgoosam-satging-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Deploy To Staging Server

on:
push:
branches:
- develop
workflow_dispatch: # 수동 실행을 허용하는 이벤트

jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Github Repository 파일 불러오기
uses: actions/checkout@v4

- name: JDK 21버전 설치
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- name: 폴더 구조 생성
run: mkdir -p ./src/main/resources/properties

- name: env.production.properties 파일 만들기
run: |
cat > ./src/main/resources/properties/env.production.properties << 'EOF'
${{ secrets.ENV_STAGING_PROPERTIES }}
EOF

- name: application.yml 파일 만들기
run: |
cat > ./src/main/resources/application.yml << 'EOF'
${{ vars.APPLICATION_YML }}
EOF

- name: yml, properties 확인
run: |
cat ./src/main/resources/application.yml
cat ./src/main/resources/properties/env.production.properties

- name: 테스트 및 빌드하기
run: |
cat ./src/main/resources/application.yml
cat ./src/main/resources/properties/env.production.properties
chmod 755 ./gradlew
./gradlew clean build -x test

- name: AWS 리소스에 접근하도록 돕는 AWS credentials 설정
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: ECR에 로그인
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Docker 이미지 생성
run: docker build -t 893-back-staging .

- name: Docker 이미지에 태그 붙이기
run: docker tag 893-back-staging ${{ steps.login-ecr.outputs.registry }}/893-back-staging:latest

- name: ECR에 Docker 이미지 Push
run: docker push ${{ steps.login-ecr.outputs.registry }}/893-back-staging:latest

- name: Install netcat for connection testing
run: sudo apt-get update && sudo apt-get install -y netcat-openbsd

- name: EIC 터널 생성 및 배포
run: |
aws ec2-instance-connect open-tunnel \
--instance-connect-endpoint-id ${{ secrets.AWS_EIC_ENDPOINT }} \
--remote-port ${{ secrets.CLIENT_SSH_PORT }} \
--local-port ${{ secrets.EC2_STAGING_SSH_PORT }} \
--instance-id ${{ secrets.AWS_EC2_STAGING_ID }} &

TUNNEL_PID=$!
echo "Tunnel PID: $TUNNEL_PID"

echo "Waiting for tunnel to establish..."
for i in {1..30}; do
if nc -z 127.0.0.1 ${{ secrets.EC2_STAGING_SSH_PORT }}; then
echo "SSH tunnel is ready!"
break
fi
echo "Waiting for tunnel... ($i/30)"
sleep 2
done

if ! nc -z 127.0.0.1 ${{ secrets.EC2_STAGING_SSH_PORT }}; then
echo "Failed to establish SSH tunnel"
kill $TUNNEL_PID 2>/dev/null || true
exit 1
fi

- name: 터널 상태 재확인
run: |
echo "터널 프로세스 상태:"
ps aux | grep ec2-instance-connect || echo "터널 프로세스 없음"

echo "포트 연결 테스트:"
nc -zv 127.0.0.1 ${{ secrets.EC2_STAGING_SSH_PORT }} || echo "포트 연결 실패"

- name: 직접 SSH로 배포
run: |
echo "${{ secrets.AWS_EC2_STAGING_SSH_KEY }}" > /tmp/ssh_key
chmod 600 /tmp/ssh_key

# 변수 미리 설정
ECR_REGISTRY="${{ steps.login-ecr.outputs.registry }}"
SERVER_PORT="${{ secrets.PALGOOSAM_API_SERVER_PORT }}"
AWS_REGION="${{ secrets.AWS_REGION }}"

ssh -o StrictHostKeyChecking=no \
-i /tmp/ssh_key \
-p ${{ secrets.EC2_STAGING_SSH_PORT }} \
${{ secrets.EC2_USERNAME }}@127.0.0.1 << EOF

echo "=== 배포 시작 ==="

# ECR 로그인
aws ecr get-login-password --region ${AWS_REGION} | \
docker login --username AWS --password-stdin ${ECR_REGISTRY}

# 기존 컨테이너 정리
docker stop 893-back-staging-container || true
docker rm 893-back-staging-container || true
docker system prune -a -f || true

# 새 이미지 풀 및 실행
cd /home/ubuntu

docker pull ${ECR_REGISTRY}/893-back-staging:latest

mkdir -p ./logs

docker run -d --name 893-back-staging-container \
-p ${SERVER_PORT}:${SERVER_PORT} \
-v ./logs:/app/logs \
${ECR_REGISTRY}/893-back-staging:latest

echo "=== 배포 완료 ==="
docker ps | grep 893-back

EOF

rm /tmp/ssh_key
10 changes: 8 additions & 2 deletions .github/workflows/deploy_palgoosam_api_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
cat > ./src/main/resources/properties/env.production.properties << 'EOF'
${{ secrets.ENV_PRODUCTION_PROPERTIES }}
EOF

- name: application.yml 파일 만들기
run: |
cat > ./src/main/resources/application.yml << 'EOF'
${{ vars.APPLICATION_YML }}
EOF

- name: yml, properties 확인
run: |
cat ./src/main/resources/application.yml
Expand Down Expand Up @@ -131,9 +131,15 @@ jobs:
docker system prune -a -f || true

# 새 이미지 풀 및 실행
cd /home/ubuntu

docker pull ${ECR_REGISTRY}/893-back:latest

mkdir -p ./logs

docker run -d --name 893-back-container \
-p ${SERVER_PORT}:${SERVER_PORT} \
-v ./logs:/app/logs \
${ECR_REGISTRY}/893-back:latest

echo "=== 배포 완료 ==="
Expand Down
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0'

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

// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
Expand Down Expand Up @@ -107,6 +110,15 @@ dependencies {
implementation 'software.amazon.awssdk:regions:2.31.51'
implementation 'software.amazon.awssdk:core:2.31.51'

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

//actuator 추가
implementation 'org.springframework.boot:spring-boot-starter-actuator'

//prometheus
implementation 'io.micrometer:micrometer-registry-prometheus'

//h2
runtimeOnly 'com.h2database:h2'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.samyookgoo.palgoosam.auction.dto.home;

import com.samyookgoo.palgoosam.auction.constant.ItemCondition;
import com.samyookgoo.palgoosam.auction.projection.RankingAuction;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -14,4 +15,16 @@ public class ActiveRankingResponse {
private String thumbnailUrl;
private Integer bidCount;
private Integer rankNum;

public static ActiveRankingResponse from(RankingAuction r, int bidCount, int rankNum) {
return ActiveRankingResponse.builder()
.auctionId(r.getAuctionId())
.title(r.getTitle())
.description(r.getDescription())
.itemCondition(r.getItemCondition())
.thumbnailUrl(r.getThumbnailUrl())
.bidCount(bidCount)
.rankNum(rankNum)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.samyookgoo.palgoosam.auction.constant.AuctionStatus;
import com.samyookgoo.palgoosam.auction.constant.ItemCondition;
import com.samyookgoo.palgoosam.auction.projection.SubCategoryBestItem;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -16,4 +17,17 @@ public class BestItemResponse {
private Boolean isAuctionImminent; // 경매 임박 여부
private Integer scrapCount;
private Integer rankNum;

public static BestItemResponse from(SubCategoryBestItem s, boolean isAuctionImminent, int scrapCount, int rankNum) {
return BestItemResponse.builder()
.auctionId(s.getAuctionId())
.title(s.getTitle())
.status(s.getStatus())
.itemCondition(s.getItemCondition())
.thumbnailUrl(s.getThumbnailUrl())
.isAuctionImminent(isAuctionImminent)
.scrapCount(scrapCount)
.rankNum(rankNum)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.samyookgoo.palgoosam.auction.dto.home;

import com.samyookgoo.palgoosam.auction.constant.ItemCondition;
import com.samyookgoo.palgoosam.auction.projection.RankingAuction;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -14,4 +15,16 @@ public class PendingRankingResponse {
private String thumbnailUrl;
private Integer scrapCount;
private Integer rankNum;

public static PendingRankingResponse from(RankingAuction r, int scrapCount, int rankNum) {
return PendingRankingResponse.builder()
.auctionId(r.getAuctionId())
.title(r.getTitle())
.description(r.getDescription())
.itemCondition(r.getItemCondition())
.thumbnailUrl(r.getThumbnailUrl())
.scrapCount(scrapCount)
.rankNum(rankNum)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.samyookgoo.palgoosam.auction.dto.home;

import com.samyookgoo.palgoosam.auction.constant.AuctionStatus;
import com.samyookgoo.palgoosam.auction.projection.RecentAuction;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -13,4 +14,15 @@ public class RecentAuctionResponse {
private String thumbnailUrl;
private AuctionStatus status;
private Integer basePrice;

public static RecentAuctionResponse from(RecentAuction r) {
return RecentAuctionResponse.builder()
.auctionId(r.getAuctionId())
.title(r.getTitle())
.description(r.getDescription())
.thumbnailUrl(r.getThumbnailUrl())
.status(r.getStatus())
.basePrice(r.getBasePrice())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.samyookgoo.palgoosam.auction.dto.home;

import com.samyookgoo.palgoosam.auction.projection.TopWinningBid;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -14,4 +15,17 @@ public class TopBidResponse {
private String thumbnailUrl;
private String buyer;
private Integer rankNum;

public static TopBidResponse from(TopWinningBid t, String buyer, int bidCount, int rankNum) {
return TopBidResponse.builder()
.auctionId(t.getAuctionId())
.title(t.getTitle())
.bidCount(bidCount)
.basePrice(t.getBasePrice())
.itemPrice(t.getItemPrice())
.thumbnailUrl(t.getThumbnailUrl())
.buyer(buyer)
.rankNum(rankNum)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.samyookgoo.palgoosam.auction.dto.home;

import com.samyookgoo.palgoosam.auction.constant.ItemCondition;
import com.samyookgoo.palgoosam.auction.projection.UpcomingAuction;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -15,4 +16,17 @@ public class UpcomingAuctionResponse {
private Integer scrapCount;
private String thumbnailUrl;
private String leftTime;

public static UpcomingAuctionResponse from(UpcomingAuction u, int scrapCount, String leftTime) {
return UpcomingAuctionResponse.builder()
.auctionId(u.getAuctionId())
.title(u.getTitle())
.description(u.getDescription())
.itemCondition(u.getItemCondition())
.basePrice(u.getBasePrice())
.scrapCount(scrapCount)
.thumbnailUrl(u.getThumbnailUrl())
.leftTime(leftTime)
.build();
}
}
Loading