-
메시지 등록
+
+
+
+ {/* 12-col 그리드 */}
+
+ {/* 좌측: 폼 (col-span-7) */}
+
+
+ {/* 카드 헤더 */}
+
+
+ edit_note
+
+
새 메시지
+
+
+ {/* 폼 */}
+
+ {/* 1. 서비스 선택 */}
+
+
+
+
+
+ expand_more
+
+
+ {errors.service && (
+
+
+ error
+
+ {errors.service}
+
+ )}
+
+
+ {/* 2. 제목 */}
+
+
+
{
+ setTitle(e.target.value);
+ clearError("title");
+ }}
+ placeholder="메시지 제목을 입력하세요"
+ className={`w-full px-4 py-2.5 bg-white border rounded text-sm focus:outline-none focus:ring-2 focus:ring-[#2563EB] focus:border-transparent transition-shadow placeholder-gray-400 text-[#0f172a] ${
+ errors.title
+ ? "border-red-500 ring-2 ring-red-500/15"
+ : "border-gray-300"
+ } ${cls("title")}`}
+ />
+ {errors.title && (
+
+
+ error
+
+ {errors.title}
+
+ )}
+
+
+ {/* 3. 내용 */}
+
+
+
+
+ {/* 4. 이미지 URL */}
+
+
+
setImageUrl(e.target.value)}
+ placeholder="https://example.com/image.jpg"
+ className="w-full px-4 py-2.5 bg-white border border-gray-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-[#2563EB] focus:border-transparent transition-shadow placeholder-gray-400 text-[#0f172a]"
+ />
+
+
+ info
+
+ URL을 입력하면 프리뷰에서 이미지 표시 위치를 확인할 수
+ 있습니다.
+
+
+
+ {/* 5. 링크 URL + 라디오 */}
+
+
+ {/* 6. 기타 정보 */}
+
+
+
+
+ {/* 저장 버튼 */}
+
+
+
+
+
+
+
+ {/* 우측: 프리뷰 (col-span-5, sticky) */}
+
+
+ o.value === service)?.label}
+ variant="large"
+ />
+
+
+
+
+ {/* 확인 모달 */}
+ {showConfirm && (
+
{
+ if (e.target === e.currentTarget) setShowConfirm(false);
+ }}
+ >
+
+
+
+
+ warning
+
+
+
저장 확인
+
+
+ 입력한 내용으로 저장하시겠습니까?
+
+
+
+
+ info
+
+ 저장 후 수정이 불가능합니다.
+
+
+
+
+
+
+
+
+ )}
);
}
diff --git a/react/src/features/message/types.ts b/react/src/features/message/types.ts
index 7e2e6c7..4aed4ec 100644
--- a/react/src/features/message/types.ts
+++ b/react/src/features/message/types.ts
@@ -1 +1,138 @@
-// Message feature 타입 정의
+// 링크 타입
+export const LINK_TYPE = {
+ WEB: "web",
+ DEEPLINK: "deeplink",
+} as const;
+
+export type LinkType = (typeof LINK_TYPE)[keyof typeof LINK_TYPE];
+
+// 메시지 목록용 요약
+export interface MessageSummary {
+ messageId: string;
+ title: string;
+ serviceName: string;
+ createdAt: string;
+}
+
+// 메시지 상세
+export interface MessageDetail extends MessageSummary {
+ body: string;
+ imageUrl: string;
+ linkUrl: string;
+ linkType: LinkType;
+ extra: string;
+}
+
+// 메시지 작성 폼 데이터
+export interface MessageFormData {
+ service: string;
+ title: string;
+ body: string;
+ imageUrl: string;
+ linkUrl: string;
+ linkType: LinkType;
+ extra: string;
+}
+
+// 서비스 옵션 (작성 폼 select용)
+export const SERVICE_OPTIONS = [
+ { value: "spms-shop", label: "SPMS 쇼핑몰" },
+ { value: "spms-partner", label: "SPMS 파트너 센터" },
+ { value: "spms-delivery", label: "SPMS 딜리버리" },
+] as const;
+
+// 서비스 필터 옵션 (목록 필터용)
+export const SERVICE_FILTER_OPTIONS = [
+ "전체 서비스",
+ "Main App",
+ "Admin Portal",
+ "API Gateway",
+];
+
+// 목 데이터 - 메시지 목록
+export const MOCK_MESSAGES: MessageSummary[] = [
+ { messageId: "MSG-005", title: "[공지] 시스템 점검 안내 (2024-05-20)", serviceName: "Main App", createdAt: "2024-05-18" },
+ { messageId: "MSG-004", title: "신규 가입 환영 웰컴 메시지", serviceName: "Admin Portal", createdAt: "2024-05-19" },
+ { messageId: "MSG-003", title: "API 인증 오류 리포트 알림", serviceName: "API Gateway", createdAt: "2024-05-19" },
+ { messageId: "MSG-002", title: "결제 시스템 업데이트 완료 안내", serviceName: "Main App", createdAt: "2024-05-17" },
+ { messageId: "MSG-001", title: "[광고] 시즌 프로모션 혜택 안내", serviceName: "Main App", createdAt: "2024-05-16" },
+ { messageId: "MSG-006", title: "배송 지연 안내 긴급 알림", serviceName: "Main App", createdAt: "2024-05-15" },
+ { messageId: "MSG-007", title: "[이벤트] 출석 체크 보상 안내", serviceName: "Admin Portal", createdAt: "2024-05-14" },
+ { messageId: "MSG-008", title: "서버 점검 완료 및 정상화 안내", serviceName: "API Gateway", createdAt: "2024-05-13" },
+ { messageId: "MSG-009", title: "개인정보 처리방침 변경 안내", serviceName: "Main App", createdAt: "2024-05-12" },
+ { messageId: "MSG-010", title: "[광고] 신규 회원 가입 혜택 안내", serviceName: "Admin Portal", createdAt: "2024-05-11" },
+];
+
+// 목 데이터 - 메시지 상세 (messageId → 상세 정보)
+export const MOCK_MESSAGE_DETAILS: Record
= {
+ "MSG-001": {
+ messageId: "MSG-001", title: "[광고] 시즌 프로모션 혜택 안내", serviceName: "Main App", createdAt: "2024-05-16",
+ body: "안녕하세요! 시즌 프로모션이 시작되었습니다. 지금 바로 참여하고 다양한 혜택을 받아보세요. 최대 50% 할인 쿠폰과 추가 적립 포인트가 제공됩니다.",
+ imageUrl: "https://cdn.spms.io/promo/summer-sale-banner.jpg",
+ linkUrl: "https://shop.spms.io/promo/summer2024", linkType: "web",
+ extra: "프로모션 기간: 2024-05-16 ~ 2024-06-30\n대상: 전체 회원\n쿠폰 코드: SUMMER50",
+ },
+ "MSG-002": {
+ messageId: "MSG-002", title: "결제 시스템 업데이트 완료 안내", serviceName: "Main App", createdAt: "2024-05-17",
+ body: "결제 시스템이 최신 버전으로 업데이트되었습니다. 새로운 결제 수단이 추가되었으며, 더 빠르고 안전한 결제 경험을 제공합니다.",
+ imageUrl: "",
+ linkUrl: "https://shop.spms.io/notice/payment-update", linkType: "web",
+ extra: "변경사항: 네이버페이, 카카오페이 간편결제 추가\nPG사: KG이니시스 v2.5 적용",
+ },
+ "MSG-003": {
+ messageId: "MSG-003", title: "API 인증 오류 리포트 알림", serviceName: "API Gateway", createdAt: "2024-05-19",
+ body: "API 인증 과정에서 오류가 감지되었습니다. 일부 클라이언트에서 토큰 갱신 실패가 발생하고 있으니 확인 부탁드립니다.",
+ imageUrl: "",
+ linkUrl: "spms://admin/api-monitor", linkType: "deeplink",
+ extra: "오류 코드: AUTH_TOKEN_EXPIRED\n영향 범위: v2.3 이하 클라이언트\n임시 조치: 수동 토큰 재발급 필요",
+ },
+ "MSG-004": {
+ messageId: "MSG-004", title: "신규 가입 환영 웰컴 메시지", serviceName: "Admin Portal", createdAt: "2024-05-19",
+ body: "환영합니다! SPMS 서비스에 가입해 주셔서 감사합니다. 신규 회원 혜택으로 7일간 프리미엄 기능을 무료로 이용하실 수 있습니다.",
+ imageUrl: "https://cdn.spms.io/welcome/onboarding-guide.png",
+ linkUrl: "spms://onboarding/start", linkType: "deeplink",
+ extra: "혜택 만료일: 가입일 기준 7일\n자동 전환: Basic 플랜",
+ },
+ "MSG-005": {
+ messageId: "MSG-005", title: "[공지] 시스템 점검 안내 (2024-05-20)", serviceName: "Main App", createdAt: "2024-05-18",
+ body: "서비스 안정성 개선을 위해 시스템 점검이 예정되어 있습니다. 점검 시간: 2024-05-20 02:00 ~ 06:00 (약 4시간). 해당 시간에는 서비스 이용이 제한됩니다.",
+ imageUrl: "",
+ linkUrl: "https://status.spms.io", linkType: "web",
+ extra: "점검 유형: 정기 점검\nDB 마이그레이션 포함\n긴급 연락: ops@spms.io",
+ },
+ "MSG-006": {
+ messageId: "MSG-006", title: "배송 지연 안내 긴급 알림", serviceName: "Main App", createdAt: "2024-05-15",
+ body: "고객님의 주문 상품 배송이 지연되고 있습니다. 물류 센터 사정으로 인해 1~2일 추가 소요될 수 있습니다. 불편을 드려 죄송합니다.",
+ imageUrl: "",
+ linkUrl: "spms://order/tracking", linkType: "deeplink",
+ extra: "지연 사유: 물류 센터 과부하\n보상: 500 포인트 자동 지급",
+ },
+ "MSG-007": {
+ messageId: "MSG-007", title: "[이벤트] 출석 체크 보상 안내", serviceName: "Admin Portal", createdAt: "2024-05-14",
+ body: "출석 체크 이벤트에 참여해 주셔서 감사합니다! 7일 연속 출석 보상으로 500 포인트가 지급되었습니다. 마이페이지에서 확인해 주세요.",
+ imageUrl: "https://cdn.spms.io/event/attendance-reward.png",
+ linkUrl: "spms://mypage/point", linkType: "deeplink",
+ extra: "이벤트 기간: 2024-05-01 ~ 2024-05-31\n추가 보너스: 30일 연속 출석 시 5,000P",
+ },
+ "MSG-008": {
+ messageId: "MSG-008", title: "서버 점검 완료 및 정상화 안내", serviceName: "API Gateway", createdAt: "2024-05-13",
+ body: "서버 정기 점검이 완료되었습니다. 모든 서비스가 정상적으로 운영되고 있습니다. 이용에 불편을 드려 죄송합니다.",
+ imageUrl: "",
+ linkUrl: "https://status.spms.io", linkType: "web",
+ extra: "점검 소요 시간: 3시간 42분\n적용 패치: v3.8.2",
+ },
+ "MSG-009": {
+ messageId: "MSG-009", title: "개인정보 처리방침 변경 안내", serviceName: "Main App", createdAt: "2024-05-12",
+ body: "개인정보 처리방침이 변경되었습니다. 주요 변경 사항: 수집 항목 변경, 보유 기간 조정. 자세한 내용은 설정 > 개인정보처리방침에서 확인해 주세요.",
+ imageUrl: "",
+ linkUrl: "https://shop.spms.io/privacy-policy", linkType: "web",
+ extra: "시행일: 2024-06-01\n주요 변경: 마케팅 수집 항목 세분화\n법적 근거: 개인정보보호법 제15조",
+ },
+ "MSG-010": {
+ messageId: "MSG-010", title: "[광고] 신규 회원 가입 혜택 안내", serviceName: "Admin Portal", createdAt: "2024-05-11",
+ body: "신규 회원 가입 시 다양한 혜택을 제공합니다. 가입 즉시 2,000원 할인 쿠폰과 무료 배송 쿠폰을 드립니다.",
+ imageUrl: "https://cdn.spms.io/ad/signup-benefit.jpg",
+ linkUrl: "https://shop.spms.io/signup", linkType: "web",
+ extra: "실패 사유: 수신 대상 토큰 만료\n재시도 예정: 수동 재발송 필요",
+ },
+};