gcx/backend
hailin 3a57b0fd4d feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API
跨越 genex-mobile、admin-app、admin-web、miniapp 四个前端应用,
将所有页面从 mock 硬编码数据替换为真实后端 API 调用,
同时补建后端缺失的 27+ 个端点,实现前后端完整联通。

## 后端新增 (4个微服务, 27+端点)

### issuer-service — 5个新Controller, 19个新文件
- IssuerStatsController: GET /issuers/me/stats, /credit (发行商仪表盘统计+信用)
- IssuerFinanceController: GET/POST balance/stats/transactions/withdraw/reconciliation
- IssuerStoreController: CRUD /issuers/me/stores + /employees (门店+员工管理)
- RedemptionController: POST scan/manual/batch, GET history/today-stats (核销)
- CouponBatchController: POST issue/recall/price-adjust, GET operations (批量操作)
- CouponController扩展: GET /search, /:id/nearby-stores, /:id/similar
- 新实体: Employee, Redemption; Store 增加 level/parentId
- 新迁移: 032_create_stores_employees_redemptions.sql

### trading-service (Go)
- GET /api/v1/trades/my/orders — 用户订单列表(分页+状态筛选)
- POST /api/v1/trades/coupons/:id/transfer — 券转赠

### user-service
- GET/PUT /api/v1/users/me/settings — 用户偏好设置(语言/货币/通知)

### auth-service
- POST /api/v1/auth/send-sms-code — 发送短信验证码(Redis存储, 5分钟TTL)
- POST /api/v1/auth/login-phone — 手机号+验证码登录(自动注册)

### Kong 路由
- 新增5条路由: issuers/me, redemptions, coupons/batch, trades/my, trades/coupons

## genex-mobile (Flutter, 2页)
- HomePage: 接入 CouponApiService.getFeaturedCoupons() + getHoldingsSummary()
- WalletCouponsPage: 接入持仓列表API, 支持Tab状态筛选
- 修复 NotificationService/PushService 7+2个路径缺少 /api/v1/ 前缀
- 新增 CouponApiService, CouponModel, HoldingsSummaryModel

## admin-app (Flutter发行商控制台, 11页 + router + i18n)
- 修复 NotificationService 7个路径 + PushService 2个路径前缀
- 新增9个Service: auth, issuer, coupon, finance, credit, store, redemption, analytics, ai_chat
- 11页全部从 StatelessWidget→StatefulWidget, mock→API:
  IssuerLoginPage(SMS登录), Dashboard(统计), CouponList(分页+筛选),
  CreateCoupon(提交审核), CouponDetail(详情), Redemption(扫码/手动/批量核销),
  Finance(余额/流水/对账), Credit(评分), StoreManagement(门店+员工),
  AiAgent(真实AI对话), Settings(资料+登出)
- 所有页面添加 loading/error/pull-to-refresh 状态

## admin-web (Next.js 15管理后台, 24页)
- 新建API基础设施: api-client.ts(axios), auth-context.tsx, use-api.ts(react-query)
- providers.tsx 接入 QueryClientProvider + AuthProvider
- 24页全部替换 useState(mockArray) 为 useApi<T>('/api/v1/admin/...'):
  Dashboard, Users, Issuers, Coupons, Trading, Risk, Finance, System,
  Compliance(SAR/SEC/License/SOX/Tax/IPO), Analytics(User/Coupon/MM/Consumer),
  Disputes, Chain, Reports, Merchant, Agent, Insurance
- 所有页面添加 TypeScript 接口, loading/error 状态, 'use client' 指令
- 状态比较改用原始API字符串(非t()翻译值)

## miniapp (Taro/React小程序, 20页)
- 新建API基础设施: config/index.ts, utils/request.ts(Taro.request封装), store/auth.ts
- 新增8个Service: auth, coupon, my-coupon, user, trading, wallet, notification, ai
- 20页全部替换硬编码数据为Service调用:
  Home, Search, Detail, Purchase, PaymentSuccess,
  MyCoupons, MyCouponDetail, Redeem, Transfer,
  Profile, Orders, Messages, Wallet, Settings, KYC, AIChat,
  Login, H5Share, H5Activity, H5Register
- 统一 useState+useEffect 数据获取模式, 错误处理, 加载状态

## 统计
- 新建文件: ~51个 (后端26 + 前端25)
- 修改文件: ~93个 (后端24 + 前端69)
- 新增后端端点: 27+
- 前端页面接入API: 55+ (genex-mobile 2 + admin-app 11 + admin-web 24 + miniapp 20)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:53:07 -08:00
..
kong feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API 2026-02-22 22:53:07 -08:00
migrations feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API 2026-02-22 22:53:07 -08:00
packages fix(common): 修复@genex/common包TypeScript编译错误 2026-02-19 19:04:21 -08:00
scripts fix: RegexRouter 精确匹配 outbox 表,防止 heartbeat 事件污染消费者 2026-02-15 07:04:17 -08:00
services feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API 2026-02-22 22:53:07 -08:00
.dockerignore feat(docker): 重构Monorepo构建 — 支持@genex/common共享包 2026-02-19 19:00:27 -08:00
.env.example feat: 完成全部后端微服务开发 (10服务/373文件/15586行代码) 2026-02-12 17:09:12 -08:00
deploy.sh feat: 新增 deploy.sh 部署管理脚本体系 — 后端主控+12服务独立+区块链 2026-02-19 17:13:09 -08:00
docker-compose.yml feat(health): 为全部12个微服务添加Docker健康检查 2026-02-20 05:39:25 -08:00