补充
This commit is contained in:
@@ -107,7 +107,7 @@ class ChatSession {
|
||||
}
|
||||
}
|
||||
|
||||
/// 系统会话ID常量(与ChatSessionNotifier中保持一致)
|
||||
/// 系统会话ID常量(唯一权威定义,Provider层引用此处)
|
||||
class SystemSessionIds {
|
||||
static const readlater = 'readlater';
|
||||
static const discover = 'discover';
|
||||
@@ -117,6 +117,7 @@ class SystemSessionIds {
|
||||
static const readingReport = 'reading_report';
|
||||
static const weather = 'weather';
|
||||
static const poetry = 'poetry';
|
||||
static const countdown = 'countdown';
|
||||
static const dailyFortune = 'daily_fortune';
|
||||
static const solarTerm = 'solar_term';
|
||||
static const knowledgeGraph = 'knowledge_graph';
|
||||
@@ -128,10 +129,24 @@ class SystemSessionIds {
|
||||
static const leisure = 'leisure';
|
||||
|
||||
static const all = {
|
||||
readlater, discover, footprint, dailyCard, template,
|
||||
readingReport, weather, poetry, dailyFortune, solarTerm,
|
||||
knowledgeGraph, studyPlan, progress, fileTransfer, rssFeed,
|
||||
translate, leisure,
|
||||
readlater,
|
||||
discover,
|
||||
footprint,
|
||||
dailyCard,
|
||||
template,
|
||||
readingReport,
|
||||
weather,
|
||||
poetry,
|
||||
countdown,
|
||||
dailyFortune,
|
||||
solarTerm,
|
||||
knowledgeGraph,
|
||||
studyPlan,
|
||||
progress,
|
||||
fileTransfer,
|
||||
rssFeed,
|
||||
translate,
|
||||
leisure,
|
||||
};
|
||||
|
||||
static bool isSystem(String id) => all.contains(id);
|
||||
@@ -163,47 +178,83 @@ extension ChatSessionL10n on ChatSession {
|
||||
|
||||
String? _resolveName(TDiscoverBase t) {
|
||||
switch (id) {
|
||||
case SystemSessionIds.readlater: return t.sessionReadLater;
|
||||
case SystemSessionIds.discover: return t.sessionInspiration;
|
||||
case SystemSessionIds.footprint: return t.sessionFootprint;
|
||||
case SystemSessionIds.dailyCard: return t.sessionDailyCard;
|
||||
case SystemSessionIds.template: return t.sessionTemplate;
|
||||
case SystemSessionIds.readingReport: return t.sessionReadingReport;
|
||||
case SystemSessionIds.weather: return t.sessionWeather;
|
||||
case SystemSessionIds.poetry: return t.sessionPoetry;
|
||||
case SystemSessionIds.dailyFortune: return t.sessionDailyFortune;
|
||||
case SystemSessionIds.solarTerm: return t.sessionSolarTerm;
|
||||
case SystemSessionIds.knowledgeGraph: return t.sessionKnowledgeGraph;
|
||||
case SystemSessionIds.studyPlan: return t.sessionStudyPlan;
|
||||
case SystemSessionIds.progress: return t.sessionProgress;
|
||||
case SystemSessionIds.fileTransfer: return t.sessionFileTransfer;
|
||||
case SystemSessionIds.rssFeed: return t.sessionRssFeed;
|
||||
case SystemSessionIds.translate: return t.sessionTranslate;
|
||||
case SystemSessionIds.leisure: return t.sessionLeisure;
|
||||
default: return null;
|
||||
case SystemSessionIds.readlater:
|
||||
return t.sessionReadLater;
|
||||
case SystemSessionIds.discover:
|
||||
return t.sessionInspiration;
|
||||
case SystemSessionIds.footprint:
|
||||
return t.sessionFootprint;
|
||||
case SystemSessionIds.dailyCard:
|
||||
return t.sessionDailyCard;
|
||||
case SystemSessionIds.template:
|
||||
return t.sessionTemplate;
|
||||
case SystemSessionIds.readingReport:
|
||||
return t.sessionReadingReport;
|
||||
case SystemSessionIds.weather:
|
||||
return t.sessionWeather;
|
||||
case SystemSessionIds.poetry:
|
||||
return t.sessionPoetry;
|
||||
case SystemSessionIds.dailyFortune:
|
||||
return t.sessionDailyFortune;
|
||||
case SystemSessionIds.solarTerm:
|
||||
return t.sessionSolarTerm;
|
||||
case SystemSessionIds.knowledgeGraph:
|
||||
return t.sessionKnowledgeGraph;
|
||||
case SystemSessionIds.studyPlan:
|
||||
return t.sessionStudyPlan;
|
||||
case SystemSessionIds.progress:
|
||||
return t.sessionProgress;
|
||||
case SystemSessionIds.fileTransfer:
|
||||
return t.sessionFileTransfer;
|
||||
case SystemSessionIds.rssFeed:
|
||||
return t.sessionRssFeed;
|
||||
case SystemSessionIds.translate:
|
||||
return t.sessionTranslate;
|
||||
case SystemSessionIds.leisure:
|
||||
return t.sessionLeisure;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
String? _resolveDesc(TDiscoverBase t) {
|
||||
switch (id) {
|
||||
case SystemSessionIds.readlater: return t.sessionReadLaterDesc;
|
||||
case SystemSessionIds.discover: return t.sessionInspirationDesc;
|
||||
case SystemSessionIds.footprint: return t.sessionFootprintDesc;
|
||||
case SystemSessionIds.dailyCard: return t.sessionDailyCardDesc;
|
||||
case SystemSessionIds.template: return t.sessionTemplateDesc;
|
||||
case SystemSessionIds.readingReport: return t.sessionReadingReportDesc;
|
||||
case SystemSessionIds.weather: return t.sessionWeatherDesc;
|
||||
case SystemSessionIds.poetry: return t.sessionPoetryDesc;
|
||||
case SystemSessionIds.dailyFortune: return t.sessionDailyFortuneDesc;
|
||||
case SystemSessionIds.solarTerm: return t.sessionSolarTermDesc;
|
||||
case SystemSessionIds.knowledgeGraph: return t.sessionKnowledgeGraphDesc;
|
||||
case SystemSessionIds.studyPlan: return t.sessionStudyPlanDesc;
|
||||
case SystemSessionIds.progress: return t.sessionProgressDesc;
|
||||
case SystemSessionIds.fileTransfer: return t.sessionFileTransferDesc;
|
||||
case SystemSessionIds.rssFeed: return t.sessionRssFeedDesc;
|
||||
case SystemSessionIds.translate: return t.sessionTranslateDesc;
|
||||
case SystemSessionIds.leisure: return t.sessionLeisureDesc;
|
||||
default: return null;
|
||||
case SystemSessionIds.readlater:
|
||||
return t.sessionReadLaterDesc;
|
||||
case SystemSessionIds.discover:
|
||||
return t.sessionInspirationDesc;
|
||||
case SystemSessionIds.footprint:
|
||||
return t.sessionFootprintDesc;
|
||||
case SystemSessionIds.dailyCard:
|
||||
return t.sessionDailyCardDesc;
|
||||
case SystemSessionIds.template:
|
||||
return t.sessionTemplateDesc;
|
||||
case SystemSessionIds.readingReport:
|
||||
return t.sessionReadingReportDesc;
|
||||
case SystemSessionIds.weather:
|
||||
return t.sessionWeatherDesc;
|
||||
case SystemSessionIds.poetry:
|
||||
return t.sessionPoetryDesc;
|
||||
case SystemSessionIds.dailyFortune:
|
||||
return t.sessionDailyFortuneDesc;
|
||||
case SystemSessionIds.solarTerm:
|
||||
return t.sessionSolarTermDesc;
|
||||
case SystemSessionIds.knowledgeGraph:
|
||||
return t.sessionKnowledgeGraphDesc;
|
||||
case SystemSessionIds.studyPlan:
|
||||
return t.sessionStudyPlanDesc;
|
||||
case SystemSessionIds.progress:
|
||||
return t.sessionProgressDesc;
|
||||
case SystemSessionIds.fileTransfer:
|
||||
return t.sessionFileTransferDesc;
|
||||
case SystemSessionIds.rssFeed:
|
||||
return t.sessionRssFeedDesc;
|
||||
case SystemSessionIds.translate:
|
||||
return t.sessionTranslateDesc;
|
||||
case SystemSessionIds.leisure:
|
||||
return t.sessionLeisureDesc;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,25 +110,6 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
static const _sessionsKey = 'chat_sessions_remarks';
|
||||
static const _sessionTimeKey = 'chat_sessions_last_time';
|
||||
|
||||
static const kSessionReadlater = 'readlater';
|
||||
static const kSessionDiscover = 'discover';
|
||||
static const kSessionFootprint = 'footprint';
|
||||
static const kSessionDailyCard = 'daily_card';
|
||||
static const kSessionTemplate = 'template';
|
||||
static const kSessionReadingReport = 'reading_report';
|
||||
static const kSessionWeather = 'weather';
|
||||
static const kSessionPoetry = 'poetry';
|
||||
static const kSessionCountdown = 'countdown';
|
||||
static const kSessionDailyFortune = 'daily_fortune';
|
||||
static const kSessionSolarTerm = 'solar_term';
|
||||
static const kSessionKnowledgeGraph = 'knowledge_graph';
|
||||
static const kSessionStudyPlan = 'study_plan';
|
||||
static const kSessionProgress = 'progress';
|
||||
static const kSessionFileTransfer = 'file_transfer';
|
||||
static const kSessionRssFeed = 'rss_feed';
|
||||
static const kSessionTranslate = 'translate';
|
||||
static const kSessionLeisure = 'leisure';
|
||||
|
||||
Future<void> _init() async {
|
||||
await _buildSessions();
|
||||
_loadRemarks();
|
||||
@@ -141,7 +122,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
|
||||
final systemSessions = <ChatSession>[
|
||||
ChatSession(
|
||||
id: kSessionReadlater,
|
||||
id: SystemSessionIds.readlater,
|
||||
type: ChatSessionType.readlater,
|
||||
emoji: '📖',
|
||||
name: '稍后读',
|
||||
@@ -153,7 +134,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/readlater-chat',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionDiscover,
|
||||
id: SystemSessionIds.discover,
|
||||
type: ChatSessionType.discover,
|
||||
emoji: '🔍',
|
||||
name: '灵感',
|
||||
@@ -164,7 +145,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: 'discover',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionFootprint,
|
||||
id: SystemSessionIds.footprint,
|
||||
type: ChatSessionType.footprint,
|
||||
emoji: '👣',
|
||||
name: '足迹',
|
||||
@@ -174,7 +155,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: 'footprint',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionDailyCard,
|
||||
id: SystemSessionIds.dailyCard,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '📅',
|
||||
name: '日签卡片',
|
||||
@@ -184,7 +165,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/daily-card',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionTemplate,
|
||||
id: SystemSessionIds.template,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '🎨',
|
||||
name: '壁纸模板',
|
||||
@@ -194,7 +175,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/template-gallery',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionReadingReport,
|
||||
id: SystemSessionIds.readingReport,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '📊',
|
||||
name: '阅读报告',
|
||||
@@ -204,7 +185,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/reading-report',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionWeather,
|
||||
id: SystemSessionIds.weather,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '🌤️',
|
||||
name: '情景诗词',
|
||||
@@ -214,7 +195,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/weather',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionPoetry,
|
||||
id: SystemSessionIds.poetry,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '📜',
|
||||
name: '今日诗词',
|
||||
@@ -224,7 +205,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/poetry',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionDailyFortune,
|
||||
id: SystemSessionIds.dailyFortune,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '🔮',
|
||||
name: '每日运势',
|
||||
@@ -234,7 +215,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/daily-fortune',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionSolarTerm,
|
||||
id: SystemSessionIds.solarTerm,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '🌿',
|
||||
name: '节气日历',
|
||||
@@ -244,7 +225,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/solar-term',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionKnowledgeGraph,
|
||||
id: SystemSessionIds.knowledgeGraph,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '🕸️',
|
||||
name: '知识图谱',
|
||||
@@ -254,7 +235,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/knowledge-graph',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionStudyPlan,
|
||||
id: SystemSessionIds.studyPlan,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '📚',
|
||||
name: '学习计划',
|
||||
@@ -264,7 +245,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/study-plan',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionProgress,
|
||||
id: SystemSessionIds.progress,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '📊',
|
||||
name: '进度',
|
||||
@@ -274,7 +255,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/progress',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionFileTransfer,
|
||||
id: SystemSessionIds.fileTransfer,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '📁',
|
||||
name: '文件传输助手',
|
||||
@@ -284,7 +265,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/file-transfer',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionRssFeed,
|
||||
id: SystemSessionIds.rssFeed,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '📡',
|
||||
name: 'RSS流',
|
||||
@@ -294,7 +275,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/rss-feed',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionTranslate,
|
||||
id: SystemSessionIds.translate,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '🌐',
|
||||
name: '翻译助手',
|
||||
@@ -305,7 +286,7 @@ class ChatSessionNotifier extends Notifier<ChatSessionState>
|
||||
route: '/translate',
|
||||
),
|
||||
ChatSession(
|
||||
id: kSessionLeisure,
|
||||
id: SystemSessionIds.leisure,
|
||||
type: ChatSessionType.custom,
|
||||
emoji: '🌸',
|
||||
name: '闲情逸致',
|
||||
|
||||
Reference in New Issue
Block a user