refactor: remove unused subscription plans and router files

This commit is contained in:
2026-06-29 10:56:08 +08:00
parent b7779878cf
commit 1ebd29d1ed
6 changed files with 3 additions and 190 deletions
-57
View File
@@ -1,57 +0,0 @@
/**
* VIP 订阅套餐常量
*
* Mock 阶段硬编码,后续可改为从 `ApiPath.paymentProducts` 拉取。
*
* 原始 Dart: lib/ui/subscription/...
*
* 当前订阅页优先使用后端 `/api/payment/plans` 返回的套餐。
* 本常量仅保留给旧 UI / fallback 代码参考。
*/
export type SubscriptionPlanId = "monthly" | "quarterly" | "annual";
export interface SubscriptionPlan {
id: SubscriptionPlanId;
/** 卡片顶部名称,例如 "Monthly" */
name: string;
/** 当前价格 */
price: number;
/** 划线原价 */
originalPrice: number;
/** 每日折算价字符串,e.g. "$0.66/day" */
perDay: string;
/** 是否高亮(默认推荐:月付) */
highlight: boolean;
/** 该套餐每天补充的语音聊天分钟数(业务常量) */
voiceMinutesPerDay: number;
}
export const SUBSCRIPTION_PLANS: readonly SubscriptionPlan[] = [
{
id: "monthly",
name: "Monthly",
price: 19.9,
originalPrice: 24.9,
perDay: "$0.66/day",
highlight: true,
voiceMinutesPerDay: 30, // 30 分钟/天
},
{
id: "quarterly",
name: "Quarterly",
price: 49.9,
originalPrice: 59.9,
perDay: "$0.55/day",
highlight: false,
voiceMinutesPerDay: 45, // 45 分钟/天(比月付多,性价比)
},
{
id: "annual",
name: "Annual",
price: 169.9,
originalPrice: 199.9,
perDay: "$0.47/day",
highlight: false,
voiceMinutesPerDay: 60, // 60 分钟/天(年度最多)
},
] as const;
-15
View File
@@ -1,20 +1,5 @@
"use client";
/**
* ChatRepository
*
* 聊天仓库:编排远程 ChatApi + 本地 LocalChatStorageDexie/IndexedDB)。
* 行为对齐原 Dart `lib/data/repositories/chat_repository_impl.dart`
* - `saveMessagesToLocal` 保留「先清后写」语义(Dart `box.clear()` + bulk add
* - 替代 Dart 同步 `int get localMessageCount`,改为异步 `getLocalMessageCount()`
* Dexie 异步 API 决定)
*
* ChatMessage ↔ LocalMessage 的字段映射在仓库内 inline 完成(用户决策):
* - 写:ChatMessage 的 id/role/content/createdAt → LocalMessagesessionId=""
* - 读:LocalMessage 的 id/role/content/createdAt → ChatMessage(丢弃 sessionId
*
* 原始 Dart: lib/data/repositories/chat_repository_impl.dart
*/
import { ChatApi, chatApi } from "@/data/services/api";
import {
ChatHistoryResponse,
@@ -30,12 +30,14 @@ export interface IChatRepository {
/** 获取聊天历史,分页参数默认 limit=50, offset=0。 */
getHistory(limit?: number, offset?: number): Promise<Result<ChatHistoryResponse>>;
//TODO remove
/** 解锁私密消息。 */
unlockPrivateMessage(messageId: string): Promise<Result<UnlockPrivateResponse>>;
/** 一键解锁历史锁定消息。 */
unlockHistory(): Promise<Result<UnlockHistoryResponse>>;
//TODO remove
/** 把本地缓存中的私密消息标记为已解锁。 */
markPrivateMessageUnlockedInLocal(
messageId: string,
+1 -3
View File
@@ -75,9 +75,7 @@ export class AuthStorage implements IAuthStorage {
}
// ---- refresh token ----
// TODO(security): 升级到 HttpOnly Cookie 方案
// SECURITY: 明文存储,仅供本轮与 Dart 行为对齐
getRefreshToken(): Promise<ResultT<string | null>> {
return SpAsyncUtil.getString(StorageKeys.refreshToken);
}