Commit Graph

115 Commits

Author SHA1 Message Date
hailin 99c1ff1fb7 fix(kline): convert time to local timezone for display
- Added toLocal() conversion in _formatTimeLabel (painter)
- Added toLocal() conversion in _formatDateTime (widget)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:55:56 -08:00
hailin 900ba4a555 feat(kline): add dynamic X-axis time labels
- Added _drawTimeAxis method to render time labels
- Labels dynamically adjust spacing based on candleWidth
- Shows HH:MM format, or M/D for midnight
- Labels follow pan/zoom movements
- Increased bottomPadding to 20px for label space

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:51:23 -08:00
hailin 453cab71e4 chore: remove debug logging from kline pan
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:49:34 -08:00
hailin f55fb13f26 feat(kline): implement true pan effect with scrollOffset
- Added scrollOffset parameter to KlinePainter and KlineVolumePainter
- Painters now draw all klines and apply scrollOffset for positioning
- Added canvas clipping to prevent drawing outside chart bounds
- Removed _getVisibleData and related helper methods (no longer needed)
- scrollOffset directly controls the visual position of all klines

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:43:45 -08:00
hailin 48ba72ce89 fix(kline): simplify pan logic - scrollX now always controls view position
- Removed _userHasPanned flag and special handling
- _scrollX is initialized in _scrollToCenter() at startup
- Pan gesture directly modifies _scrollX
- _getVisibleData() always uses _scrollX to calculate visible range

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:35:31 -08:00
hailin 7ae58e98e6 debug: 添加平移调试信息 2026-01-19 21:30:41 -08:00
hailin 684367941d feat(kline): 支持左右平移查看历史K线
- 初始状态:最新K线在屏幕中心(保持原有逻辑不变)
- 用户平移后可查看全部历史数据
- 切换周期时重置平移状态

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:25:59 -08:00
hailin f149c2a06a fix(kline): 数据量大时只取最近数据,让最新K线在屏幕中心
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:39:33 -08:00
hailin a15ab7600f fix(kline): 修正K线显示逻辑,从左开始排列,最新K线居中
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:26:20 -08:00
hailin f51aa44cd9 feat(frontend): K线图组件支持深色模式
- kline_chart_widget.dart: 使用 AppColors 动态颜色,传递 isDark 参数
- kline_painter.dart: 添加 isDark 参数,网格/文字/十字线颜色随主题变化
- kline_volume_painter.dart: 添加 isDark 参数,成交量图颜色随主题变化

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 19:42:52 -08:00
hailin 2745995a1a feat(frontend): 贡献值页面完整支持深色模式
- 所有卡片背景使用 AppColors.cardOf(context) 动态颜色
- 所有文字颜色改用动态方法 textPrimaryOf/textSecondaryOf/textMutedOf
- 图标背景透明度根据深色模式调整 (isDark ? 0.2 : 0.1)
- 分隔线和边框使用 AppColors.borderOf(context)
- 移除未使用的静态颜色常量

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 19:32:06 -08:00
hailin 61203d1baf feat(frontend): extend dark mode support to more pages
- Update asset_page.dart with full dark mode support
- Update c2c_market_page.dart with full dark mode support
- Update login_page.dart with full dark mode support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 19:21:40 -08:00
hailin b0d1771b66 fix(contribution): 恢复静态颜色常量避免编译错误
保留原有浅色模式配色(_grayText, _darkText, _bgGray, _lightGray),
页面背景已支持深色模式切换

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 19:10:13 -08:00
hailin bbe1754309 feat(frontend): 添加全局深色模式支持
核心改动:
1. app_colors.dart - 添加浅色/深色两套色彩常量和动态颜色获取方法
   - backgroundOf()、surfaceOf()、cardOf() 等方法根据主题返回对应颜色
   - 浅色:#F3F4F6背景、#FFFFFF卡片、#1F2937文字
   - 深色:#111827背景、#1F2937卡片、#E5E7EB文字

2. main.dart - 更新 ThemeData 配置
   - 添加 scaffoldBackgroundColor、appBarTheme、cardTheme 等深色主题配置

3. main_shell.dart - 导航栏支持深色模式
   - 使用 AppColors 动态方法替换硬编码颜色

4. trading_page.dart - 兑换页面支持深色模式
   - 所有卡片、文字颜色使用动态颜色方法
   - 划转弹窗也支持深色模式

5. contribution_page.dart - 贡献值页面开始支持(部分)

后续需要继续更新其他页面以完整支持深色模式切换

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 19:08:03 -08:00
hailin b00de68b01 refactor(profile): 重新实现深色模式,保留原有浅色模式配色
问题:之前的深色模式实现使用了 colorScheme,导致浅色模式的原有配色也被改变

修复方案:
- 定义浅色/深色两套色彩常量,浅色模式使用原有设计色值
- 添加基于 Theme.brightness 的颜色辅助函数动态返回对应颜色
- 浅色模式:保持原有 #1F2937/#6B7280/#9CA3AF/#F3F4F6/白色配色
- 深色模式:使用 #E5E7EB/#9CA3AF/#6B7280/#111827/#1F2937 配色
- 所有 widget 方法更新为使用动态颜色函数

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 18:44:31 -08:00
hailin d815792deb feat(kline): 默认隐藏MA均线指标
- 将主图指标默认值从 0(MA) 改为 -1(无)
- 首次加载K线图时不再显示 MA5/MA10/MA20/MA60 均线
- 保留指标切换功能,用户可手动开启 MA/EMA/BOLL 指标
- 使K线图界面更简洁清爽

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 18:05:30 -08:00
hailin a97e0b51b8 feat(kline): 首次加载时让最新K线居中显示
- 新增 _scrollToCenter() 方法,计算让最新K线居中的滚动位置
- 初始化时调用 _scrollToCenter() 替代 _scrollToEnd()
- 如果K线总宽度小于屏幕宽度,不滚动,从左开始显示
- 保留 _scrollToEnd() 方法供刷新按钮等场景使用

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 18:03:23 -08:00
hailin 964b06b370 fix(trading): 修复"我的挂单"全部按钮点击无响应问题
问题原因:
- trading_page.dart 中"我的挂单"卡片的"全部 >"按钮 onTap 回调为空(TODO 注释)
- 用户点击时没有任何响应

修复内容:
- 添加 context.push(Routes.tradingRecords) 导航到交易记录页面
- 用户现在可以点击"全部 >"查看完整的交易订单列表

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 07:23:38 -08:00
hailin af339b19b9 feat(c2c): 完善C2C场外交易功能 - 收款信息与订单超时处理
## 后端更新

### Prisma Schema (0008_add_c2c_orders migration)
- 新增 C2cPaymentMethod 枚举 (ALIPAY/WECHAT/BANK)
- C2cOrder 模型新增字段:
  - 收款信息:paymentMethod, paymentAccount, paymentQrCode, paymentRealName
  - 超时配置:paymentTimeoutMinutes (默认15分钟), confirmTimeoutMinutes (默认60分钟)
  - 截止时间:paymentDeadline, confirmDeadline
- 新增索引优化超时查询

### API层
- c2c.dto.ts: 新增收款信息和超时配置字段
- c2c.controller.ts: 新增C2C控制器,支持完整的订单生命周期管理

### 业务层
- c2c.service.ts:
  - createOrder: 卖单必须提供收款信息验证
  - takeOrder: 接单时自动设置付款截止时间
  - confirmPayment: 确认付款时设置确认收款截止时间
  - processExpiredOrders/expireOrder: 处理超时订单(释放冻结资产)
- c2c-expiry.scheduler.ts: 每分钟执行超时订单检查(带分布式锁)

### 数据层
- c2c-order.repository.ts: 新增 findExpiredOrders 方法
- trading-account.repository.ts: 新增 unfreezeShares/unfreezeCash 方法

## 前端更新

### 数据模型
- c2c_order_model.dart:
  - 新增 C2cPaymentMethod 枚举
  - 新增收款信息和超时相关字段
  - 新增辅助方法:paymentMethodText, hasPaymentInfo, paymentRemainingSeconds, confirmRemainingSeconds

### API层
- trading_remote_datasource.dart: createC2cOrder/takeC2cOrder 支持收款信息参数

### 状态管理
- c2c_providers.dart: createOrder/takeOrder 方法支持收款信息参数

### UI层
- c2c_publish_page.dart:
  - 新增收款方式选择器 (支付宝/微信/银行卡)
  - 新增收款账号和收款人姓名输入框
  - 卖单发布时验证收款信息必填
  - 确认对话框显示收款信息摘要

- c2c_order_detail_page.dart:
  - 新增收款信息卡片展示(买家视角/卖家视角区分)
  - 新增倒计时进度条显示(付款/确认收款截止时间)
  - 剩余时间<5分钟时高亮警告
  - 支持复制收款账号

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 07:17:22 -08:00
hailin 928d6c8df2 refactor(frontend): 优化K线图显示与交互体验
主要改动:
1. 隐藏技术指标 - 暂时隐藏MA/EMA/BOLL主图指标和MACD/KDJ/RSI副图指标
   - 保留全部代码,便于未来恢复(取消注释即可)
   - 调整高度分配:主图75%、成交量25%

2. 修复单指滑动(pan)问题
   - 移除错误的scale阈值检测 `(details.scale - 1.0).abs() > 0.01`
   - 改用 `pointerCount > 1` 区分单指滑动和双指缩放
   - 单指滑动现可正常左右拖动K线图

3. 优化首次加载显示
   - 新增 `_initialized` 标志控制初始化时机
   - 新增 `_initializeCandleWidth()` 方法动态计算K线宽度
   - K线首次加载时自动填满可视区域宽度
   - 数据量变化时自动重新初始化

技术细节:
- 使用 LayoutBuilder 获取实际图表宽度后再初始化
- 通过 postFrameCallback 确保在布局完成后执行初始化
- K线宽度限制在 3.0-30.0 像素范围内

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:31:24 -08:00
hailin 7fb77bcc7e refactor(frontend): 暂时隐藏"我的"页面中的"团队与收益"栏目
- 注释掉 _buildTeamEarningsSection 调用
- 保留代码方便后续恢复

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:19:54 -08:00
hailin f7cfb4ef8c refactor(frontend): 优化参与记录和贡献值页面的文案显示
参与记录页面(planting_records_page.dart):
- 将状态 "已开始挖矿" 改为 "已开始"
- 将 "xx棵" 改为 "xx个"
- 将 "单棵算力" 改为 "单个算力"

贡献值页面(contribution_page.dart):
- 将贡献值明细中的 "本人种植" 改为 "本人"
- 移除 "已解锁上级" 和 "已解锁下级" 后的 "级" 字后缀

实体类(planting_record.dart):
- 同步更新状态显示文案 "已开始挖矿" → "已开始"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 06:17:19 -08:00
hailin 8619b0bf26 feat(frontend): add dark mode support and fix mining records overflow
- Add darkTheme configuration in main.dart with themeModeProvider
- Refactor profile_page.dart to use Theme.of(context).colorScheme for dynamic theming
- Fix mining_records_page.dart layout overflow by using Expanded/Flexible widgets

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 05:06:28 -08:00
hailin 75e74b07c3 refactor(frontend): hide multiplier-related UI elements in asset page
- Comment out '积分股(含倍数)' display
- Comment out '含倍数资产' tag

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:56:07 -08:00
hailin e098cd44f6 refactor(frontend): replace '手机号' with '账号' in send shares page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:54:24 -08:00
hailin 71a9961f94 refactor(frontend): update UI text labels
- Change contribution page subtitle to '股行用户引荐'
- Change receive shares page text from '手机号' to '账号'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:52:38 -08:00
hailin 5ea8d8fea5 docs(frontend): update about page description
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:47:05 -08:00
hailin 1c9bb1aa60 refactor(frontend): rename '团队上级/下级' to '团队上/下贡献值'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:45:15 -08:00
hailin 747e8bfee1 refactor(frontend): replace all '直推' with '引荐'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:43:31 -08:00
hailin 1efe39c6bd refactor(frontend): replace all '认种' with '参与'
- Update terminology across all pages and entities
- Change '认种' to '参与' in user-facing text
- Update comments and documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:39:15 -08:00
hailin e48bf3e81f refactor(frontend): replace all '榴莲' references with '股行'
- Update app name and branding across all pages
- Remove references to '榴莲树' in contribution and adoption contexts
- Update user-facing text in login, register, splash pages
- Update FAQ content in help center and about pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:33:47 -08:00
hailin d9d46065e0 fix(asset): 总资产估值包含积分值余额
总资产估值 = 积分股价值 + 积分值余额
- 积分股价值 = 积分股 × (1 + burnMultiplier) × 价格
- 积分值余额 = 可用积分值 + 冻结积分值

之前只计算了积分股价值,现在加上了积分值(现金)余额。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:26:21 -08:00
hailin d4f7cd834a fix(android): 添加 strings.xml 解决部分手机 app 名称显示问题
某些 Android 手机会从 strings.xml 读取 app 名称而非 AndroidManifest.xml,
导致显示旧名称。通过添加 strings.xml 并引用它来解决兼容性问题。

- 添加 values/strings.xml 定义 app_name
- 添加 values-zh/strings.xml 支持中文系统
- AndroidManifest.xml 改为引用 @string/app_name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:15:18 -08:00
hailin 7df57b9de5 fix(trading): 修复卖出预估计算,加入销毁倍数
卖出预估计算现在使用与后端一致的公式:
- 有效积分股 = 卖出量 × (1 + burnMultiplier)
- 卖出交易额 = 有效积分股 × 价格 × 0.9

修复的位置:
1. _calculateEstimate() 方法 - 预计获得显示
2. _handleTrade() 确认弹窗 - 显示销毁倍数和有效积分股明细

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 04:10:32 -08:00
hailin 94153058d8 chore(mining-app): remove WebSocket debug logs
移除前端 WebSocket 相关的调试日志

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:34:07 -08:00
hailin 192e2551bf feat(trading): 资产页面实时价格 WebSocket 推送
## 后端变更
- 添加 @nestjs/websockets, @nestjs/platform-socket.io, socket.io 依赖
- 新增 PriceGateway (price.gateway.ts): WebSocket 网关,namespace /price
- 新增 PriceBroadcastScheduler: 每秒广播价格更新到所有连接的客户端
- 更新 ApiModule 和 ApplicationModule 注册新模块

## Kong API Gateway
- 添加 WebSocket 路由: /ws/price -> trading-service:3022/price
- 支持 ws/wss 协议

## 前端变更
- 添加 socket_io_client 依赖
- 新增 PriceWebSocketService: 带自动断线重连机制的 WebSocket 服务
  - 指数退避重连策略 (1s -> 30s)
  - 最大重连次数 10 次
  - 连接状态流监听
- 资产页面集成 WebSocket:
  - initState 时连接,dispose 时断开
  - 实时更新价格和销毁倍数
  - 保持原有的每秒积分股增长计算

## 调试日志
- 前后端都添加了详细的调试日志方便排查问题
- 日志前缀: [PriceWS], [AssetPage], [PriceGateway], [PriceBroadcastScheduler]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:18:34 -08:00
hailin 533ad3ba82 feat(mining-app): 兑换页面价格改为只读,使用实时价格
- 价格输入框改为只读模式,用户不能修改
- 始终使用后端返回的实时价格
- 价格会随实时刷新自动更新

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 20:56:59 -08:00
hailin cfa3979a97 revert: 恢复资产页面的倍数显示和计算
- 资产显示值恢复为 积分股余额 × (1 + burnMultiplier) × price
- 显示有效积分股(含倍数)而非实际积分股数量
- 实时计算也考虑倍数因子

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 20:46:57 -08:00
hailin 07247fe05f fix: 将划转最小限制从5改为0.01积分股
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 19:29:05 -08:00
hailin 2154d5752f fix: 修复K线图NaN错误并添加mining-service划转端点
- 修复K线图当价格范围为0时导致的NaN Offset错误
- 在mining-service添加transfer-out和transfer-in端点
- 划转操作会在mining_transactions表中记录明细

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 07:12:32 -08:00
hailin 4e181354f4 feat(frontend): 添加积分股划转功能
- 交易页面添加划转入口链接
- 实现双向划转弹窗(划入交易账户/划出到挖矿账户)
- 新增划转历史记录页面
- 添加划转相关 API 调用

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 06:57:23 -08:00
hailin 4bb5a2b09d refactor(frontend): 资产页面显示实际积分股和价格,移除倍数
- 资产显示值改为 积分股余额 × price(不含倍数)
- 显示实际积分股数量而非含倍数的有效积分股
- 简化实时计算逻辑

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:28:30 -08:00
hailin 4a4393f995 fix(frontend): 修复资产页面实时增长计算漏乘burnMultiplier
资产每秒增长公式应为: 每秒积分股增长 × (1 + burnMultiplier) × price
之前漏掉了 (1 + burnMultiplier) 因子,导致增长被低估约5000倍

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 03:42:21 -08:00
hailin b826511f3c chore(frontend): 移除资产页面调试日志
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 23:16:15 -08:00
hailin 4f1f1f9eaf feat(mining): 添加 perSecondEarning 到挖矿账户 API
- 后端:计算每秒收益 = (用户贡献 / 全网贡献) × 每秒分配量
- 前端:修正字段映射以匹配后端返回格式

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:56:19 -08:00
hailin 33233901a9 debug(frontend): 添加资产页面定时器调试日志
添加 debugPrint 日志帮助定位1秒刷新不生效的问题

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:49:46 -08:00
hailin d8dd38e91b fix(frontend): 修复资产页面1秒实时刷新问题
- 使用 mining-service 的 perSecondEarning 替代 assetGrowthPerSecond
- 添加 _timerStarted 标志防止定时器重复启动
- 修复页面进入时定时器可能未启动的问题
- 下拉刷新时同步刷新 shareAccountProvider
- 正确显示每秒增长值

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:42:23 -08:00
hailin 5c633b9979 perf(frontend): 优化交易页面数据刷新策略
- 价格刷新: 5分钟 → 15秒
- 订单刷新: 2分钟 → 10秒
- 市场概览: 5分钟 → 30秒
- 交易账户: 2分钟 → 15秒
- 交易成功后立即刷新 + 2秒后再刷新 + 5秒后最终刷新
- 确保用户能快速看到做市商吃单后的成交状态

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:14:52 -08:00
hailin 3b6bd29283 feat(trading): 实现完整的CEX做市商双边深度系统
## 后端 - trading-service

### 数据库模型扩展 (Prisma Schema)
- TradingConfig: 新增 depthEnabled 字段控制深度显示开关
- MarketMakerConfig: 新增双边挂单配置
  - makerEnabled: 做市商挂单模式开关
  - bidEnabled/askEnabled: 买/卖方向独立开关
  - bidLevels/askLevels: 买/卖档位数量
  - bidSpread/askSpread: 买/卖价差比例
  - bidLevelSpacing/askLevelSpacing: 档位间距
  - bidQuantityPerLevel/askQuantityPerLevel: 每档数量
  - refreshIntervalMs: 刷新间隔
- MarketMakerOrder: 新增做市商订单追踪模型
- MarketMakerLedger: 新增做市商账户流水模型

### 做市商服务 (MarketMakerService)
- depositShares/withdrawShares: 积分股充值/提现
- startMaker/stopMaker: 做市商挂单模式启停
- refreshMakerOrders: 核心双边挂单逻辑
  - 根据当前价格计算买卖各档位价格和数量
  - 自动撤销旧订单并创建新订单
  - 记录做市商订单关联
- cancelAllMakerOrders: 撤销所有做市商订单
- getDepth: 获取订单簿深度数据
- updateMakerConfig/getMakerOrders: 配置和订单查询

### API 端点
- MarketMakerController:
  - POST /deposit-shares: 积分股充值
  - POST /withdraw-shares: 积分股提现
  - POST /start-maker: 启动挂单模式
  - POST /stop-maker: 停止挂单模式
  - POST /refresh-orders: 手动刷新订单
  - POST /cancel-all-orders: 撤销所有订单
  - PUT /maker-config: 更新挂单配置
  - GET /maker-orders: 查询做市商订单
  - GET /depth: 获取深度数据
- AdminController:
  - GET/POST /trading/depth-enabled: 深度显示开关
- PriceController:
  - GET /depth: 公开深度接口 (受 depthEnabled 控制)

### 领域层扩展
- TradingAccountAggregate: 新增 depositShares/withdrawShares 方法
- OrderAggregate: 支持 source 字段标识订单来源

## 前端 - mining-admin-web

### 做市商管理页面 (/market-maker)
- 账户余额展示: 积分值和积分股余额
- 资金管理: 积分值/积分股的充值和提现对话框
- 吃单模式: 启动/停止/手动吃单控制
- 挂单模式: 启动/停止/刷新订单/撤销所有
- 深度开关: 控制公开 API 是否返回深度数据
- 深度展示: 实时显示买卖盘深度数据表格

### 前端架构
- market-maker.api.ts: 完整的 API 客户端
- use-market-maker.ts: React Query hooks 封装
- sidebar.tsx: 新增"做市商管理"导航菜单

## 数据库迁移
- 0003_add_market_maker_depth: 双边深度相关字段
- 0005_add_market_maker_and_order_source: 订单来源追踪

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:11:23 -08:00
hailin 481a355d72 feat(trading): add buy function control switch with admin management
- Add buyEnabled field to TradingConfig in trading-service with migration
- Add API endpoints for get/set buy enabled status in admin controller
- Add buy function switch card in mining-admin-web trading page
- Implement buyEnabledProvider in mining-app with 2-minute cache
- Show "待开启" when buy function is disabled in trading page
- Add real-time asset value refresh in asset page (1-second updates)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 08:56:35 -08:00