refactor: Phase 2 - 레거시 서비스 데이터 분리

- legacy_service_data.dart 파일 생성
- 12개의 static Map 데이터 이동
- 파일 크기 940줄에서 575줄로 감소 (38.8% 감소)
- 기존 API 호환성 유지

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
JiWoong Sul
2025-07-16 18:20:59 +09:00
parent f6a780124a
commit 46883f7314
6 changed files with 1372 additions and 405 deletions

View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import '../models/subscription_model.dart';
import '../providers/category_provider.dart';
import '../services/subscription_url_matcher.dart';
import '../services/url_matcher/data/legacy_service_data.dart';
/// 구독 서비스를 카테고리별로 구분하는 도우미 클래스
class SubscriptionCategoryHelper {
@@ -38,7 +39,7 @@ class SubscriptionCategoryHelper {
// 카테고리 ID가 없거나 카테고리를 찾을 수 없는 경우 서비스 이름 기반 분류
// 음악
if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.musicServices)) {
subscription.serviceName, LegacyServiceData.musicServices)) {
if (!categorizedSubscriptions.containsKey('music')) {
categorizedSubscriptions['music'] = [];
}
@@ -46,7 +47,7 @@ class SubscriptionCategoryHelper {
}
// OTT(동영상)
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.ottServices)) {
subscription.serviceName, LegacyServiceData.ottServices)) {
if (!categorizedSubscriptions.containsKey('ottVideo')) {
categorizedSubscriptions['ottVideo'] = [];
}
@@ -54,7 +55,7 @@ class SubscriptionCategoryHelper {
}
// 저장/클라우드
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.storageServices)) {
subscription.serviceName, LegacyServiceData.storageServices)) {
if (!categorizedSubscriptions.containsKey('storageCloud')) {
categorizedSubscriptions['storageCloud'] = [];
}
@@ -62,7 +63,7 @@ class SubscriptionCategoryHelper {
}
// 통신 · 인터넷 · TV
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.telecomServices)) {
subscription.serviceName, LegacyServiceData.telecomServices)) {
if (!categorizedSubscriptions.containsKey('telecomInternetTv')) {
categorizedSubscriptions['telecomInternetTv'] = [];
}
@@ -70,7 +71,7 @@ class SubscriptionCategoryHelper {
}
// 생활/라이프스타일
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.lifestyleServices)) {
subscription.serviceName, LegacyServiceData.lifestyleServices)) {
if (!categorizedSubscriptions.containsKey('lifestyle')) {
categorizedSubscriptions['lifestyle'] = [];
}
@@ -78,7 +79,7 @@ class SubscriptionCategoryHelper {
}
// 쇼핑/이커머스
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.shoppingServices)) {
subscription.serviceName, LegacyServiceData.shoppingServices)) {
if (!categorizedSubscriptions.containsKey('shoppingEcommerce')) {
categorizedSubscriptions['shoppingEcommerce'] = [];
}
@@ -86,7 +87,7 @@ class SubscriptionCategoryHelper {
}
// 프로그래밍
else if (_isInCategory(subscription.serviceName,
SubscriptionUrlMatcher.programmingServices)) {
LegacyServiceData.programmingServices)) {
if (!categorizedSubscriptions.containsKey('programming')) {
categorizedSubscriptions['programming'] = [];
}
@@ -94,7 +95,7 @@ class SubscriptionCategoryHelper {
}
// 협업/오피스
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.officeTools)) {
subscription.serviceName, LegacyServiceData.officeTools)) {
if (!categorizedSubscriptions.containsKey('collaborationOffice')) {
categorizedSubscriptions['collaborationOffice'] = [];
}
@@ -102,7 +103,7 @@ class SubscriptionCategoryHelper {
}
// AI 서비스
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.aiServices)) {
subscription.serviceName, LegacyServiceData.aiServices)) {
if (!categorizedSubscriptions.containsKey('aiService')) {
categorizedSubscriptions['aiService'] = [];
}
@@ -110,7 +111,7 @@ class SubscriptionCategoryHelper {
}
// 기타
else if (_isInCategory(
subscription.serviceName, SubscriptionUrlMatcher.otherServices)) {
subscription.serviceName, LegacyServiceData.otherServices)) {
if (!categorizedSubscriptions.containsKey('other')) {
categorizedSubscriptions['other'] = [];
}