style: apply dart format across project
This commit is contained in:
@@ -17,39 +17,40 @@ class SubscriptionUrlMatcher {
|
||||
static CancellationUrlService? _cancellationService;
|
||||
static ServiceNameResolver? _nameResolver;
|
||||
static SmsExtractorService? _smsExtractor;
|
||||
|
||||
|
||||
/// 서비스 초기화
|
||||
static Future<void> initialize() async {
|
||||
if (_dataRepository != null && _dataRepository!.isInitialized) return;
|
||||
|
||||
|
||||
// 1. 데이터 저장소 초기화
|
||||
_dataRepository = ServiceDataRepository();
|
||||
await _dataRepository!.initialize();
|
||||
|
||||
|
||||
// 2. 서비스 초기화
|
||||
_categoryMapper = CategoryMapperService(_dataRepository!);
|
||||
_urlMatcher = UrlMatcherService(_dataRepository!, _categoryMapper!);
|
||||
_cancellationService = CancellationUrlService(_dataRepository!, _urlMatcher!);
|
||||
_cancellationService =
|
||||
CancellationUrlService(_dataRepository!, _urlMatcher!);
|
||||
_nameResolver = ServiceNameResolver(_dataRepository!);
|
||||
_smsExtractor = SmsExtractorService(_urlMatcher!, _categoryMapper!);
|
||||
}
|
||||
|
||||
|
||||
/// 도메인 추출 (www와 TLD 제외)
|
||||
static String? extractDomain(String url) {
|
||||
return _urlMatcher?.extractDomain(url);
|
||||
}
|
||||
|
||||
|
||||
/// URL로 서비스 찾기
|
||||
static Future<ServiceInfo?> findServiceByUrl(String url) async {
|
||||
await initialize();
|
||||
return _urlMatcher?.findServiceByUrl(url);
|
||||
}
|
||||
|
||||
|
||||
/// 서비스명으로 URL 찾기 (기존 suggestUrl 메서드 유지)
|
||||
static String? suggestUrl(String serviceName) {
|
||||
return _urlMatcher?.suggestUrl(serviceName);
|
||||
}
|
||||
|
||||
|
||||
/// 서비스명 또는 URL로 해지 안내 페이지 URL 찾기
|
||||
static Future<String?> findCancellationUrl({
|
||||
String? serviceName,
|
||||
@@ -63,19 +64,20 @@ class SubscriptionUrlMatcher {
|
||||
locale: locale,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// 서비스에 공식 해지 안내 페이지가 있는지 확인
|
||||
static Future<bool> hasCancellationPage(String serviceNameOrUrl) async {
|
||||
await initialize();
|
||||
return await _cancellationService?.hasCancellationPage(serviceNameOrUrl) ?? false;
|
||||
return await _cancellationService?.hasCancellationPage(serviceNameOrUrl) ??
|
||||
false;
|
||||
}
|
||||
|
||||
|
||||
/// 서비스명으로 카테고리 찾기
|
||||
static Future<String?> findCategoryByServiceName(String serviceName) async {
|
||||
await initialize();
|
||||
return _categoryMapper?.findCategoryByServiceName(serviceName);
|
||||
}
|
||||
|
||||
|
||||
/// 현재 로케일에 따라 서비스 표시명 가져오기
|
||||
static Future<String> getServiceDisplayName({
|
||||
required String serviceName,
|
||||
@@ -83,17 +85,18 @@ class SubscriptionUrlMatcher {
|
||||
}) async {
|
||||
await initialize();
|
||||
return await _nameResolver?.getServiceDisplayName(
|
||||
serviceName: serviceName,
|
||||
locale: locale,
|
||||
) ?? serviceName;
|
||||
serviceName: serviceName,
|
||||
locale: locale,
|
||||
) ??
|
||||
serviceName;
|
||||
}
|
||||
|
||||
|
||||
/// SMS에서 URL과 서비스 정보 추출
|
||||
static Future<ServiceInfo?> extractServiceFromSms(String smsText) async {
|
||||
await initialize();
|
||||
return _smsExtractor?.extractServiceFromSms(smsText);
|
||||
}
|
||||
|
||||
|
||||
/// URL이 알려진 서비스 URL인지 확인
|
||||
static Future<bool> isKnownServiceUrl(String url) async {
|
||||
await initialize();
|
||||
@@ -104,4 +107,4 @@ class SubscriptionUrlMatcher {
|
||||
static String? findMatchingUrl(String text, {bool usePartialMatch = true}) {
|
||||
return _urlMatcher?.findMatchingUrl(text, usePartialMatch: usePartialMatch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user