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

116 lines
4.6 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-telemetry</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>game-module-telemetry-server</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
telemetry 模块业务实现:controller(app/admin) / service / dal(DO·Mapper) / convert / mq(consumer 对接点)。
被 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-telemetry-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 依赖 feed 的 -api:算分回灌排序行(ingestBatch → FeedApi.upsertRank mode=QUALITY_REFRESH,§3.5 C5;只依赖对方 -api 不依赖 -server,守门④无环) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-feed-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 依赖 project 的 -api:创作者看板归属隔离(getMyGameIds 取"我的作品" gameId 集合后限定聚合范围;只依赖对方 -api 不依赖 -server,守门④无环)
+ U5 经营看板「发布量」(countPublished) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-project-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 依赖 trade 的 -api:U5 经营看板「GMV」(getRevenueReport;只依赖对方 -api 不依赖 -server,守门④无环) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-trade-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 依赖 aigc 的 -api:U5 经营看板「生成量」(countSucceededTasks;只依赖对方 -api 不依赖 -server,守门④无环) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>game-module-aigc-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- Excel 导出(U5 经营看板/收益行导出 ExcelUtils + @ExcelProperty) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-excel</artifactId>
</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 / BaseDO) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-mybatis</artifactId>
</dependency>
<!-- 缓存 -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-redis</artifactId>
</dependency>
<!-- RPC 远程调用(跨模块互调,预留回灌 feed/project) -->
<dependency>
<groupId>com.wanxiang</groupId>
<artifactId>huijing-spring-boot-starter-rpc</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>