kt-event-marketing/design/backend/class/user-service-simple.puml
jhbkjh 3075a5d49f 물리아키텍처 설계 완료
 주요 기능
- Azure 기반 물리아키텍처 설계 (개발환경/운영환경)
- 7개 마이크로서비스 물리 구조 설계
- 네트워크 아키텍처 다이어그램 작성 (Mermaid)
- 환경별 비교 분석 및 마스터 인덱스 문서

📁 생성 파일
- design/backend/physical/physical-architecture.md (마스터)
- design/backend/physical/physical-architecture-dev.md (개발환경)
- design/backend/physical/physical-architecture-prod.md (운영환경)
- design/backend/physical/*.mmd (4개 Mermaid 다이어그램)

🎯 핵심 성과
- 비용 최적화: 개발환경 월 $143, 운영환경 월 $2,860
- 확장성: 개발환경 100명 → 운영환경 10,000명 (100배)
- 가용성: 개발환경 95% → 운영환경 99.9%
- 보안: 다층 보안 아키텍처 (L1~L4)

🛠️ 기술 스택
- Azure Kubernetes Service (AKS)
- Azure Database for PostgreSQL Flexible
- Azure Cache for Redis Premium
- Azure Service Bus Premium
- Application Gateway + WAF

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 15:13:01 +09:00

219 lines
4.3 KiB
Plaintext

@startuml
!theme mono
title User Service 클래스 다이어그램 (요약)
' ====================
' Layered Architecture
' ====================
package "Presentation Layer" {
class UserController {
+ register()
+ login()
+ logout()
+ getProfile()
+ updateProfile()
+ changePassword()
}
}
package "Business Layer" {
interface UserService {
+ register()
+ getProfile()
+ updateProfile()
+ changePassword()
+ updateLastLoginAt()
}
interface AuthenticationService {
+ login()
+ logout()
}
class UserServiceImpl implements UserService
class AuthenticationServiceImpl implements AuthenticationService
}
package "Data Access Layer" {
interface UserRepository
interface StoreRepository
}
package "Domain Layer" {
class User {
- id: UUID
- name: String
- phoneNumber: String
- email: String
- passwordHash: String
- role: UserRole
- status: UserStatus
- lastLoginAt: LocalDateTime
}
class Store {
- id: UUID
- name: String
- industry: String
- address: String
- businessHours: String
}
enum UserRole {
OWNER
ADMIN
}
enum UserStatus {
ACTIVE
INACTIVE
LOCKED
WITHDRAWN
}
}
package "DTO Layer" {
class "Request DTOs" as RequestDTO {
RegisterRequest
LoginRequest
UpdateProfileRequest
ChangePasswordRequest
}
class "Response DTOs" as ResponseDTO {
RegisterResponse
LoginResponse
LogoutResponse
ProfileResponse
}
}
package "Exception Layer" {
enum UserErrorCode {
USER_DUPLICATE_EMAIL
USER_DUPLICATE_PHONE
USER_NOT_FOUND
AUTH_FAILED
AUTH_INVALID_TOKEN
PWD_INVALID_CURRENT
PWD_SAME_AS_CURRENT
}
}
package "Configuration Layer" {
class SecurityConfig
class RedisConfig
class AsyncConfig
class SwaggerConfig
}
' ====================
' Layer 간 의존성
' ====================
' Vertical dependencies (Top → Bottom)
UserController --> UserService
UserController --> AuthenticationService
UserServiceImpl --> UserRepository
UserServiceImpl --> StoreRepository
AuthenticationServiceImpl --> UserRepository
AuthenticationServiceImpl --> StoreRepository
UserRepository --> User
StoreRepository --> Store
' DTO usage
UserController ..> RequestDTO : uses
UserController ..> ResponseDTO : uses
UserServiceImpl ..> RequestDTO : uses
UserServiceImpl ..> ResponseDTO : uses
AuthenticationServiceImpl ..> RequestDTO : uses
AuthenticationServiceImpl ..> ResponseDTO : uses
' Domain relationships
User "1" -- "0..1" Store : has >
User +-- UserRole
User +-- UserStatus
' Exception
UserServiceImpl ..> UserErrorCode : throws
AuthenticationServiceImpl ..> UserErrorCode : throws
' Configuration
SecurityConfig ..> UserService : configures
RedisConfig ..> UserServiceImpl : provides Redis
' ====================
' Architecture Notes
' ====================
note top of UserController
<b>Presentation Layer</b>
REST API 엔드포인트
end note
note top of UserService
<b>Business Layer</b>
비즈니스 로직 처리
트랜잭션 관리
end note
note top of UserRepository
<b>Data Access Layer</b>
JPA 기반 CRUD
end note
note top of User
<b>Domain Layer</b>
비즈니스 엔티티
도메인 로직
end note
note bottom of "Presentation Layer"
<b>Layered Architecture Pattern</b>
각 계층은 바로 아래 계층만 의존
상위 계층은 하위 계층을 알지만
하위 계층은 상위 계층을 모름
end note
note right of UserServiceImpl
<b>핵심 비즈니스 플로우</b>
1. 회원가입
- 중복 검증
- 비밀번호 해싱
- User/Store 생성
- JWT 발급
- Redis 세션 저장
2. 로그인
- 인증 정보 검증
- JWT 발급
- 최종 로그인 시각 업데이트
3. 프로필 관리
- 조회/수정
- 비밀번호 변경
4. 로그아웃
- Redis 세션 삭제
- JWT Blacklist 추가
end note
note right of User
<b>도메인 특성</b>
- User와 Store는 1:1 관계
- UserRole: OWNER(소상공인), ADMIN
- UserStatus: ACTIVE, INACTIVE,
LOCKED, WITHDRAWN
- JWT 기반 인증
- Redis 세션 관리
end note
@enduml