M0: contracts 契约类型 SSOT(T-M0-04)

落地《契约规范》§8/§9/§12,全工程唯一来源:
- InboundHandlers 枚举:45 入站 handler 名,原样拼写(finsh/canclevibrator/opensaoma 等)
- OutboundHandlers 枚举:21 出站 handler 名,含命名陷阱(getphoneinfo≠getphoneInfo、
  getBattery≠getbattery、backgameData-末尾连字符)
- PayloadType:入站/出站 raw|json 标注表 + 入站同步返回类型 + 查询函数
- DTO interface ×17(§12 字段同名同义):Sharetype/Maplocation/PhoneInfo/savephoto/
  videoinfo/Othervideoinfo/GamePay/PayState/ShareLogin/ShareSuccess 等
- Result<T> + Errors(ErrorKind/LocationErrorCode/AppError)
- 经 entry 临时 smoke 全量引用,CompileArkTS 编译通过

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
lanterngamescn
2026-06-25 07:09:17 +08:00
co-authored by Claude Opus 4.8
parent 424c5f4d94
commit 26299c06ce
7 changed files with 567 additions and 3 deletions
+20 -3
View File
@@ -1,3 +1,20 @@
// contracts HAR —— 契约类型 SSOT导出入口 SSOT
// 各子模块实现完成后在此统一 export。占位常量确保 HAR 可编译
export const contracts_MODULE_VERSION: string = '1.0.0';
// contracts HAR —— 契约类型 SSOT全工程唯一来源
// 落地《TSGame_原生与H5接口契约总规范》§8/§9/§12 的 handler 名、DTO、错误与返回类型
// —— Handler 名(原样拼写,不可纠正)——
export { InboundHandlers } from './src/main/ets/handlers/InboundHandlers';
export { OutboundHandlers } from './src/main/ets/handlers/OutboundHandlers';
// —— 载荷类型标注(raw / json)——
export { PayloadType, InboundPayload, InboundSyncReturn, OutboundPayload,
inboundPayloadType, outboundPayloadType } from './src/main/ets/handlers/PayloadType';
// —— 数据结构 DTO(§12,字段同名同义)——
export { SharetypeBean, MaplocationInfo, PhoneInfoBean, SavephotoURLBean,
VideoinfoBean, OthervideoinfoBean, GamePayReq, PayStateResp, ShareLoginResp,
ShareSuccessResp, OpenUrlTitleDataReq, OpenApplyDownloadReq, SwitchOverGameReq,
MediaTypeAudioReq, SrcIsLoopReq, GetAudioUrlResp, WifiLevelResp } from './src/main/ets/dto/Dtos';
// —— 错误与统一返回 ——
export { LocationErrorCode, ErrorKind, AppError, makeError } from './src/main/ets/result/Errors';
export { Result } from './src/main/ets/result/Result';