lili ac7ffe4a92 feat(telemetry): U5 经营看板聚合+导出 + 营收报表导出
经营看板(跨模块只读聚合,缺数据兜底不 500):
- 新端点 GET /admin-api/telemetry/dashboard(telemetry:dashboard:query)→ DashboardRespVO,聚合四指标:
  DAU(本模块 game_telemetry_event 去重活跃身份:登录 user_id + 匿名 anon_id,取 statDateEnd 当日,
  新增 TelemetryEventMapper.countActiveIdentities)+ GMV(trade-api)+ 生成量(aigc-api)+ 发布量(project-api)。
- DashboardServiceImpl 容错:每个数据源独立 try-catch + CommonResult 解包兜底——任一源不可用→该指标兜底 0
  + degraded/degradedSources 标记,整体不 500(看板可用性优先);正常空数据(data=null)不算降级。
- 导出 GET /admin-api/telemetry/dashboard/export-excel(EXPORT 审计)单行导出看板快照。
- telemetry-server 加 trade-api/aigc-api 依赖 + starter-excel。

营收报表导出:TradeAdminController 加 GET /admin-api/trade/report/revenue/export-excel
(trade:report:export + EXPORT 审计),抽 buildRevenueReport() 与 /report/revenue 共用口径避免漂移。

测试:DashboardServiceImplTest 6(全可用聚合/单源抛异常兜底/CommonResult非0兜底/data=null不降级/
全跨模块故障DAU仍可取/跨模块只读 never 写方法)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:06:57 -07:00

107 lines
4.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-trade</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>game-module-trade-server</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
trade 模块业务实现:controller(app/admin) / service(account·income·withdraw·settle) / dal(DO·Mapper) / convert / job。
被 huijing-server 聚合启动(随单体一起加载,无需独立 bootstrap)。
</description>
<dependencies>
<!-- Spring Cloud 基础环境 -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-env</artifactId>
</dependency>
<!-- 本模块对外契约层 -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-trade-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 上游 ad 的 -api:T+1 结算消费 AdRevenueApi(拉未结算收入 + 回标已结算)。跨模块只依赖对方 -api,禁依赖 -server -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-ad-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 依赖 community 的 -api:P-NTF-05 收益变动后同进程 notify 站内信(Wave4 挂点3;仅首次真实入账才通知 + try-catch 吞异常,禁依赖 -server) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-community-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 业务组件:数据权限(创作者只见自己账户/流水/提现)+ 多租户(DO 继承 TenantBaseDO) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-biz-data-permission</artifactId>
</dependency>
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<!-- Web + 安全:@RestController / @PreAuthorize / 当前登录用户 -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-security</artifactId>
</dependency>
<!-- DB:MyBatis Plus(BaseMapperX / LambdaQueryWrapperX / LambdaUpdateWrapper / TenantBaseDO) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-mybatis</artifactId>
</dependency>
<!-- Excel 导出(U5 营收报表导出 ExcelUtils + @ExcelProperty) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-excel</artifactId>
</dependency>
<!-- 缓存 -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-redis</artifactId>
</dependency>
<!-- RPC 远程调用(消费 ad 的 AdRevenueApi 做 T+1 分账) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-rpc</artifactId>
</dependency>
<!-- 定时任务(XXL-Job):T+1 结算 SettlementJob 用 @XxlJob 调度 -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-job</artifactId>
</dependency>
<!-- 测试 -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>