백엔드 서비스 AKS 배포 및 설정 완료

- Kubernetes 매니페스트 파일 생성 (7개 서비스)
  * user-service, event-service, ai-service, content-service
  * participation-service, analytics-service, distribution-service
  * 공통 리소스: Ingress, ConfigMap, Secret, ImagePullSecret

- analytics-service 배포 문제 해결
  * Hibernate PostgreSQL dialect 추가
  * DB 자격증명 수정 (eventuser/Hi5Jessica!)
  * analytics_db 데이터베이스 생성

- content-service Probe 경로 수정
  * Context path 포함 (/api/v1/content/actuator/health)

- distribution-service 신규 배포
  * Docker 이미지 빌드 및 ACR 푸시
  * K8s 매니페스트 생성 및 배포
  * Ingress 경로 추가 (/distribution)

- Gradle bootJar 설정 추가
  * 5개 서비스에 archiveFileName 설정

- 배포 가이드 문서 추가
  * deployment/k8s/deploy-k8s-guide.md
  * claude/deploy-k8s-back.md
  * deployment/container/build-image.md 업데이트

배포 완료: 모든 백엔드 서비스(7개) 정상 실행 중

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
wonho
2025-10-29 10:59:09 +09:00
parent 23265b5849
commit df04f85346
57 changed files with 3478 additions and 353 deletions
@@ -21,6 +21,8 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import java.util.UUID;
/**
* User Controller
*
@@ -90,7 +92,7 @@ public class UserController {
@GetMapping("/profile")
@Operation(summary = "프로필 조회", description = "사용자 프로필 조회 API")
public ResponseEntity<ProfileResponse> getProfile(@AuthenticationPrincipal UserPrincipal principal) {
Long userId = principal.getUserId();
UUID userId = principal.getUserId();
log.info("프로필 조회 요청: userId={}", userId);
ProfileResponse response = userService.getProfile(userId);
return ResponseEntity.ok(response);
@@ -106,7 +108,7 @@ public class UserController {
public ResponseEntity<ProfileResponse> updateProfile(
@AuthenticationPrincipal UserPrincipal principal,
@Valid @RequestBody UpdateProfileRequest request) {
Long userId = principal.getUserId();
UUID userId = principal.getUserId();
log.info("프로필 수정 요청: userId={}", userId);
ProfileResponse response = userService.updateProfile(userId, request);
log.info("프로필 수정 성공: userId={}", userId);
@@ -123,7 +125,7 @@ public class UserController {
public ResponseEntity<Void> changePassword(
@AuthenticationPrincipal UserPrincipal principal,
@Valid @RequestBody ChangePasswordRequest request) {
Long userId = principal.getUserId();
UUID userId = principal.getUserId();
log.info("비밀번호 변경 요청: userId={}", userId);
userService.changePassword(userId, request);
log.info("비밀번호 변경 성공: userId={}", userId);
@@ -5,6 +5,8 @@ import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.UUID;
/**
* 로그인 응답 DTO
*
@@ -27,7 +29,7 @@ public class LoginResponse {
/**
* 사용자 ID
*/
private Long userId;
private UUID userId;
/**
* 사용자 이름
@@ -6,6 +6,7 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.UUID;
/**
* 프로필 응답 DTO
@@ -24,7 +25,7 @@ public class ProfileResponse {
/**
* 사용자 ID
*/
private Long userId;
private UUID userId;
/**
* 사용자 이름
@@ -49,7 +50,7 @@ public class ProfileResponse {
/**
* 매장 ID
*/
private Long storeId;
private UUID storeId;
/**
* 매장명
@@ -5,6 +5,8 @@ import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.UUID;
/**
* 회원가입 응답 DTO
*
@@ -27,7 +29,7 @@ public class RegisterResponse {
/**
* 사용자 ID
*/
private Long userId;
private UUID userId;
/**
* 사용자 이름
@@ -37,7 +39,7 @@ public class RegisterResponse {
/**
* 매장 ID
*/
private Long storeId;
private UUID storeId;
/**
* 매장명
@@ -3,6 +3,9 @@ package com.kt.event.user.entity;
import com.kt.event.common.entity.BaseTimeEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;
import java.util.UUID;
/**
* 매장 엔티티
@@ -24,9 +27,10 @@ public class Store extends BaseTimeEntity {
* 매장 ID (Primary Key)
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "store_id")
private Long id;
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "store_id", columnDefinition = "uuid")
private UUID id;
/**
* 매장명
@@ -3,8 +3,10 @@ package com.kt.event.user.entity;
import com.kt.event.common.entity.BaseTimeEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;
import java.time.LocalDateTime;
import java.util.UUID;
/**
* 사용자 엔티티
@@ -29,9 +31,10 @@ public class User extends BaseTimeEntity {
* 사용자 ID (Primary Key)
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_id")
private Long id;
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "user_id", columnDefinition = "uuid")
private UUID id;
/**
* 사용자 이름
@@ -5,6 +5,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
import java.util.UUID;
/**
* 매장 Repository
@@ -15,7 +16,7 @@ import java.util.Optional;
* @since 1.0
*/
@Repository
public interface StoreRepository extends JpaRepository<Store, Long> {
public interface StoreRepository extends JpaRepository<Store, UUID> {
/**
* 사용자 ID로 매장 조회
@@ -23,5 +24,5 @@ public interface StoreRepository extends JpaRepository<Store, Long> {
* @param userId 사용자 ID
* @return 매장 Optional
*/
Optional<Store> findByUserId(Long userId);
Optional<Store> findByUserId(UUID userId);
}
@@ -9,6 +9,7 @@ import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.Optional;
import java.util.UUID;
/**
* 사용자 Repository
@@ -19,7 +20,7 @@ import java.util.Optional;
* @since 1.0
*/
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
public interface UserRepository extends JpaRepository<User, UUID> {
/**
* 이메일로 사용자 조회
@@ -61,5 +62,5 @@ public interface UserRepository extends JpaRepository<User, Long> {
*/
@Modifying
@Query("UPDATE User u SET u.lastLoginAt = :lastLoginAt WHERE u.id = :userId")
void updateLastLoginAt(@Param("userId") Long userId, @Param("lastLoginAt") LocalDateTime lastLoginAt);
void updateLastLoginAt(@Param("userId") UUID userId, @Param("lastLoginAt") LocalDateTime lastLoginAt);
}
@@ -6,6 +6,8 @@ import com.kt.event.user.dto.request.RegisterRequest;
import com.kt.event.user.dto.response.ProfileResponse;
import com.kt.event.user.dto.response.RegisterResponse;
import java.util.UUID;
/**
* User Service Interface
*
@@ -30,7 +32,7 @@ public interface UserService {
* @param userId 사용자 ID
* @return 프로필 응답
*/
ProfileResponse getProfile(Long userId);
ProfileResponse getProfile(UUID userId);
/**
* 프로필 수정
@@ -39,7 +41,7 @@ public interface UserService {
* @param request 프로필 수정 요청
* @return 프로필 응답
*/
ProfileResponse updateProfile(Long userId, UpdateProfileRequest request);
ProfileResponse updateProfile(UUID userId, UpdateProfileRequest request);
/**
* 비밀번호 변경
@@ -47,12 +49,12 @@ public interface UserService {
* @param userId 사용자 ID
* @param request 비밀번호 변경 요청
*/
void changePassword(Long userId, ChangePasswordRequest request);
void changePassword(UUID userId, ChangePasswordRequest request);
/**
* 최종 로그인 시각 업데이트 (비동기)
*
* @param userId 사용자 ID
*/
void updateLastLoginAt(Long userId);
void updateLastLoginAt(UUID userId);
}
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
@@ -75,7 +76,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
// 3. 매장 정보 조회
Store store = storeRepository.findByUserId(user.getId()).orElse(null);
Long storeId = store != null ? store.getId() : null;
UUID storeId = store != null ? store.getId() : null;
// 4. JWT 토큰 생성
String token = jwtTokenProvider.createAccessToken(
@@ -144,7 +145,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
* @param userId 사용자 ID
* @param role 역할
*/
private void saveSession(String token, Long userId, String role) {
private void saveSession(String token, UUID userId, String role) {
if (redisTemplate != null) {
String key = "user:session:" + token;
String value = userId + ":" + role;
@@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
@@ -128,7 +129,7 @@ public class UserServiceImpl implements UserService {
* UFR-USER-030: 프로필 관리
*/
@Override
public ProfileResponse getProfile(Long userId) {
public ProfileResponse getProfile(UUID userId) {
User user = userRepository.findById(userId)
.orElseThrow(() -> new BusinessException(UserErrorCode.USER_NOT_FOUND.getErrorCode()));
@@ -158,7 +159,7 @@ public class UserServiceImpl implements UserService {
*/
@Override
@Transactional
public ProfileResponse updateProfile(Long userId, UpdateProfileRequest request) {
public ProfileResponse updateProfile(UUID userId, UpdateProfileRequest request) {
User user = userRepository.findById(userId)
.orElseThrow(() -> new BusinessException(UserErrorCode.USER_NOT_FOUND.getErrorCode()));
@@ -186,7 +187,7 @@ public class UserServiceImpl implements UserService {
*/
@Override
@Transactional
public void changePassword(Long userId, ChangePasswordRequest request) {
public void changePassword(UUID userId, ChangePasswordRequest request) {
User user = userRepository.findById(userId)
.orElseThrow(() -> new BusinessException(UserErrorCode.USER_NOT_FOUND.getErrorCode()));
@@ -213,7 +214,7 @@ public class UserServiceImpl implements UserService {
@Override
@Async
@Transactional
public void updateLastLoginAt(Long userId) {
public void updateLastLoginAt(UUID userId) {
userRepository.updateLastLoginAt(userId, LocalDateTime.now());
}
@@ -224,7 +225,7 @@ public class UserServiceImpl implements UserService {
* @param userId 사용자 ID
* @param role 역할
*/
private void saveSession(String token, Long userId, String role) {
private void saveSession(String token, UUID userId, String role) {
if (redisTemplate != null) {
String key = "user:session:" + token;
String value = userId + ":" + role;