weatherId
), 프로필 정보(성별, 온도 민감도 등), 옷장 데이터(카테고리·속성·이미지)를 종합하여 개인화된 코디 추천을 제공하는 기능이다.weatherId
)**로 관리되며, 동일한 날씨에서는 캐싱된 결과를 제공하고, 사용자가 “다시 추천받기”를 요청할 경우 동일 날씨 내에서도 새로운 추천을 생성한다.주요 역할
recommendations
)와 추천 상세(recommendation_clothes
)로 구조화하여 저장weatherId
) 기준으로 캐싱 관리, “다시 추천받기” 시 신규 생성weatherId
를 입력으로 활용Method | Endpoint | 설명 |
---|---|---|
GET | /api/recommendations?weatherId={id} |
특정 날씨(weatherId )에 대한 추천 조회 |
/api/recommendations/refresh?weatherId={id}
| 특정 날씨(weatherId
)에 대해 “다시 추천받기” 요청역할: Vision/LLM 모델이 의상 이미지에서 자동 추출한 속성을 저장
구조
id
: 속성 ID (UUID)
clothes
: 대상 의상(Clothes
)와 1:1 관계
attributes
: JSONB 형태로 날씨 관련 속성 저장
예: { "season": "여름", "thickness": "얇음", "waterproof": "가능" }
특징
weatherId
)과 사용자(userId
)를 기준으로 생성된 추천 메타 정보id
: 추천 ID (UUID)user
: 추천 대상 사용자 (User
)weather
: 기준 날씨 (WeatherForecast
)createdAt
: 추천 생성 시각clothes
: 추천된 의상 목록 (RecommendationClothes
와 1:N)(user, weather)
조합으로 여러 번 생성될 수 있음 (다시 추천받기 지원)createdAt
으로 최신 추천을 구분 가능Recommendation
)에 속하는 의상 상세id
: 추천-의상 연결 ID (UUID)recommendation
: 추천 ID (FK)clothes
: 추천된 의상 ID (FK, Clothes
참조)Recommendation
과 Clothes
를 연결하는 다리 테이블 역할CascadeType.ALL
+ orphanRemoval
설정으로 Recommendation 삭제 시 자동 정리