feat(app): finalize ad gated flows and weather

- add AppLogger and replace scattered print logging\n- implement ad-gated recommendation flow with reminder handling and calendar link\n- complete Bluetooth share pipeline with ad gate and merge\n- integrate KMA weather API with caching and dart-define decoding\n- add NaverUrlProcessor refactor and restore restaurant repository tests
This commit is contained in:
JiWoong Sul
2025-11-22 00:10:51 +09:00
parent 947fe59486
commit 2a01fa50c6
43 changed files with 1777 additions and 571 deletions

View File

@@ -1,5 +1,6 @@
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:lunchpick/core/utils/app_logger.dart';
import '../../core/network/network_client.dart';
import '../../core/errors/network_exceptions.dart';
@@ -88,7 +89,11 @@ class NaverApiClient {
return response.data!;
} on DioException catch (e) {
debugPrint('fetchMapPageHtml error: $e');
AppLogger.error(
'fetchMapPageHtml error: $e',
error: e,
stackTrace: e.stackTrace,
);
if (e.error is NetworkException) {
throw e.error!;
@@ -123,9 +128,9 @@ class NaverApiClient {
final pcmapUrl = 'https://pcmap.place.naver.com/restaurant/$placeId/home';
try {
debugPrint('========== 네이버 pcmap 한글 추출 시작 ==========');
debugPrint('요청 URL: $pcmapUrl');
debugPrint('Place ID: $placeId');
AppLogger.debug('========== 네이버 pcmap 한글 추출 시작 ==========');
AppLogger.debug('요청 URL: $pcmapUrl');
AppLogger.debug('Place ID: $placeId');
String html;
if (kIsWeb) {
@@ -148,7 +153,7 @@ class NaverApiClient {
);
if (response.statusCode != 200 || response.data == null) {
debugPrint(
AppLogger.error(
'NaverApiClient: pcmap 페이지 로드 실패 - status: ${response.statusCode}',
);
return {
@@ -172,11 +177,11 @@ class NaverApiClient {
html,
);
debugPrint('========== 추출 결과 ==========');
debugPrint('총 한글 텍스트 수: ${koreanTexts.length}');
debugPrint('JSON-LD 상호명: $jsonLdName');
debugPrint('Apollo State 상호명: $apolloName');
debugPrint('=====================================');
AppLogger.debug('========== 추출 결과 ==========');
AppLogger.debug('총 한글 텍스트 수: ${koreanTexts.length}');
AppLogger.debug('JSON-LD 상호명: $jsonLdName');
AppLogger.debug('Apollo State 상호명: $apolloName');
AppLogger.debug('=====================================');
return {
'success': true,
@@ -187,8 +192,12 @@ class NaverApiClient {
'apolloStateName': apolloName,
'extractedAt': DateTime.now().toIso8601String(),
};
} catch (e) {
debugPrint('NaverApiClient: pcmap 페이지 파싱 실패 - $e');
} catch (e, stackTrace) {
AppLogger.error(
'NaverApiClient: pcmap 페이지 파싱 실패 - $e',
error: e,
stackTrace: stackTrace,
);
return {
'success': false,
'error': e.toString(),