✨ 주요 변경사항: - 프로젝트 이름: kumamoto-travel-planner → travel-planner - 버전 업그레이드: v1.0.0 → v2.0.0 - 멀티유저 시스템 구현 (JWT 인증) - PostgreSQL 마이그레이션 시스템 추가 - Docker 컨테이너 이름 변경 - UI 브랜딩 업데이트 (Travel Planner) - API 서버 및 인증 시스템 추가 - 여행 공유 기능 구현 - 템플릿 시스템 추가 🔧 기술 스택: - Frontend: React + TypeScript + Vite - Backend: Node.js + Express + JWT - Database: PostgreSQL + 마이그레이션 - Infrastructure: Docker + Docker Compose 🌟 새로운 기능: - 사용자 인증 및 권한 관리 - 다중 여행 계획 관리 - 여행 템플릿 시스템 - 공유 링크 및 댓글 시스템 - 관리자 대시보드
130 lines
3.3 KiB
TypeScript
130 lines
3.3 KiB
TypeScript
import { ActivityType, RelatedPlaceCategory, AttractionCategory, BasePointType } from '../types'
|
|
|
|
/**
|
|
* Activity 타입에 대한 이모지 반환
|
|
*/
|
|
export const getActivityEmoji = (type: ActivityType): string => {
|
|
const emojiMap: Record<ActivityType, string> = {
|
|
attraction: '🏞️',
|
|
food: '🍴',
|
|
accommodation: '🏨',
|
|
transport: '🚗',
|
|
other: '📍'
|
|
}
|
|
return emojiMap[type] || '📍'
|
|
}
|
|
|
|
/**
|
|
* Activity 타입에 대한 한글 이름 반환
|
|
*/
|
|
export const getActivityName = (type: ActivityType): string => {
|
|
const nameMap: Record<ActivityType, string> = {
|
|
attraction: '관광지',
|
|
food: '식사',
|
|
accommodation: '숙소',
|
|
transport: '교통',
|
|
other: '기타'
|
|
}
|
|
return nameMap[type] || '기타'
|
|
}
|
|
|
|
/**
|
|
* RelatedPlace 카테고리에 대한 이모지 반환
|
|
*/
|
|
export const getRelatedPlaceCategoryEmoji = (category: RelatedPlaceCategory): string => {
|
|
const emojiMap: Record<RelatedPlaceCategory, string> = {
|
|
restaurant: '🍴',
|
|
attraction: '🏞️',
|
|
shopping: '🛍️',
|
|
accommodation: '🏨',
|
|
other: '📍'
|
|
}
|
|
return emojiMap[category] || '📍'
|
|
}
|
|
|
|
/**
|
|
* RelatedPlace 카테고리에 대한 한글 이름 반환
|
|
*/
|
|
export const getRelatedPlaceCategoryName = (category: RelatedPlaceCategory): string => {
|
|
const nameMap: Record<RelatedPlaceCategory, string> = {
|
|
restaurant: '식당',
|
|
attraction: '관광지',
|
|
shopping: '쇼핑',
|
|
accommodation: '숙소',
|
|
other: '기타'
|
|
}
|
|
return nameMap[category] || '기타'
|
|
}
|
|
|
|
/**
|
|
* RelatedPlace 카테고리에 대한 배경색 반환 (Tailwind CSS 클래스)
|
|
*/
|
|
export const getRelatedPlaceCategoryColor = (category: RelatedPlaceCategory): string => {
|
|
const colorMap: Record<RelatedPlaceCategory, string> = {
|
|
restaurant: 'bg-orange-500',
|
|
attraction: 'bg-blue-500',
|
|
shopping: 'bg-pink-500',
|
|
accommodation: 'bg-purple-500',
|
|
other: 'bg-gray-500'
|
|
}
|
|
return colorMap[category] || 'bg-gray-500'
|
|
}
|
|
|
|
/**
|
|
* Attraction 카테고리에 대한 이모지 반환
|
|
*/
|
|
export const getAttractionCategoryEmoji = (category: AttractionCategory): string => {
|
|
const emojiMap: Record<AttractionCategory, string> = {
|
|
castle: '🏯',
|
|
nature: '🏞️',
|
|
onsen: '♨️',
|
|
temple: '⛩️',
|
|
food: '🍴',
|
|
other: '📍'
|
|
}
|
|
return emojiMap[category] || '📍'
|
|
}
|
|
|
|
/**
|
|
* Attraction 카테고리에 대한 한글 이름 반환
|
|
*/
|
|
export const getAttractionCategoryName = (category: AttractionCategory): string => {
|
|
const nameMap: Record<AttractionCategory, string> = {
|
|
castle: '성',
|
|
nature: '자연',
|
|
onsen: '온천',
|
|
temple: '신사/사찰',
|
|
food: '맛집',
|
|
other: '기타'
|
|
}
|
|
return nameMap[category] || '기타'
|
|
}
|
|
|
|
/**
|
|
* BasePoint 타입에 대한 이모지 반환
|
|
*/
|
|
export const getBasePointEmoji = (type: BasePointType): string => {
|
|
const emojiMap: Record<BasePointType, string> = {
|
|
accommodation: '🏨',
|
|
airport: '✈️',
|
|
station: '🚉',
|
|
parking: '🅿️',
|
|
other: '📍'
|
|
}
|
|
return emojiMap[type] || '📍'
|
|
}
|
|
|
|
/**
|
|
* BasePoint 타입에 대한 한글 이름 반환
|
|
*/
|
|
export const getBasePointName = (type: BasePointType): string => {
|
|
const nameMap: Record<BasePointType, string> = {
|
|
accommodation: '숙소',
|
|
airport: '공항',
|
|
station: '역',
|
|
parking: '주차장',
|
|
other: '기타'
|
|
}
|
|
return nameMap[type] || '기타'
|
|
}
|