/** * 技术规格说明书数据类型定义 * 基于 .aico/create-tect-docs/技术规格说明书模板.docx 中的占位符 */ /** * 表字段详情 - 用于 tableDetailList 循环 */ export interface TableFieldDetail { id: string; fieldName: string; fieldType: string; fieldDescription: string; fieldLength: string; } /** * 数据表信息 - 用于 tableInfoList 循环 */ export interface TableInfo { id: string; tableName: string; entityName: string; tableDescription: string; tableDetailList: TableFieldDetail[]; } /** * 接口参数信息 - 用于 parameterList 循环 */ export interface ParameterInfo { id: string; propertyType: string; propertyName: string; required: string; propertyDesc: string; } /** * 返回结果信息 - 用于 returnResultList 循环 */ export interface ReturnResultInfo { id: string; propertyType: string; propertyName: string; propertyDesc: string; } /** * 接口设计详情 - 用于 interfaceDesignDetailList 循环 */ export interface InterfaceDesignDetail { functionName: string; interfaceDesc: string; className: string; methodName: string; parameterList: ParameterInfo[]; returnResultList: ReturnResultInfo[]; implementLogic: string; } /** * 设计详情 - 用于 designDetailList 循环 */ export interface DesignDetail { serviceName: string; serviceDesc: string; interfaceDesignDetailList: InterfaceDesignDetail[]; } /** * 接口详情 - 用于 interfaceDetailList 循环 */ export interface InterfaceDetail { id: string; functionDescription: string; serviceName: string; methodName: string; } /** * 服务接口信息 - 用于 serviceInterfaceList 循环 */ export interface ServiceInterface { id: string; serviceType: string; serviceEnglishName: string; serviceChineseName: string; serviceDescription: string; interfaceDetailList: InterfaceDetail[]; } /** * 流量估算分析 */ export interface TrafficEstimation { description: string; qps: string; peakQps: string; dailyVolume: string; } /** * 消息队列设计 */ export interface MessageQueueDesign { topicName: string; description: string; producer: string; consumer: string; messageType: string; } /** * 数据库拆分设计 */ export interface DatabaseSplitDesign { tableName: string; splitStrategy: string; splitKey: string; description: string; } /** * 分布式事务设计 */ export interface DistributedTransactionDesign { sceneName: string; transactionType: string; participants: string; description: string; } /** * 分布式锁设计 */ export interface DistributedLockDesign { lockName: string; lockType: string; timeout: string; description: string; } /** * 定时任务设计 */ export interface ScheduledTaskDesign { taskName: string; cronExpression: string; description: string; executorClass: string; } /** * 延时任务设计 */ export interface DelayTaskDesign { taskName: string; delayTime: string; description: string; triggerCondition: string; } /** * 缓存使用场景 */ export interface CacheScenario { id: string; sceneName: string; cacheKey: string; expireTime: string; description: string; } /** * 缓存方案设计 */ export interface CacheDesign { constraint: string; cacheScenarioList: CacheScenario[]; designDescription: string; } /** * 子章节内容结构 */ export interface SubSectionContent { constraint?: string; useCase?: string; design?: string; intro?: string; dataEstimation?: string; sharding?: string; designIdea?: string; implementation?: string; } /** * 技术方案 - 第6章 * 支持详细的子章节内容或简化的content字段 */ export interface TechSolution { content?: string; trafficEstimation?: string; messageQueue?: SubSectionContent; databaseSplit?: SubSectionContent; distributedTransaction?: SubSectionContent; distributedLock?: SubSectionContent; scheduledTask?: SubSectionContent; delayTask?: SubSectionContent; cacheDesign?: SubSectionContent; } /** * 业务异常处理 - 第7章 */ export interface BusinessException { content: string; } /** * 异常码信息 - 用于 exceptionCodeList 循环 */ export interface ExceptionCode { id: string; exceptionCode: string; exceptionDescription: string; } /** * 码值信息 - 用于 codeValueList 循环 */ export interface CodeValue { id: string; propertyName: string; codeValue: string; } /** * 附录 - 第8章 * 支持异常码表和码值表 */ export interface Appendix { content?: string; exceptionCodeList?: ExceptionCode[]; codeValueList?: CodeValue[]; } /** * 技术规格说明书完整数据结构 * 模板占位符对应关系: * - {projectName} - 项目名称 * - {moduleName} - 模块名称 * - {year} - 年份 * - {month} - 月份 * - {referDoc} - 参考文档 * - {#serviceInterfaceList}...{/serviceInterfaceList} - 服务接口列表循环 * - {#designDetailList}...{/designDetailList} - 设计详情列表循环 * - {#tableInfoList}...{/tableInfoList} - 数据表信息列表循环 * - {#techSolution}...{/techSolution} - 技术方案相关 * - {#businessExceptionList}...{/businessExceptionList} - 业务异常处理列表 * - {#appendix}...{/appendix} - 附录相关 */ export interface TechSpecData { projectName: string; moduleName: string; year: string; month: string; referDoc: string; serviceInterfaceList: ServiceInterface[]; designDetailList: DesignDetail[]; tableInfoList: TableInfo[]; techSolution?: TechSolution; businessException?: BusinessException; appendix?: Appendix; } /** * 代码分析结果 */ export interface CodeAnalysisResult { success: boolean; data: TechSpecData | null; error?: string; } /** * 文档生成结果 */ export interface DocGenerationResult { success: boolean; outputPath: string | null; error?: string; } /** * 多项目配置 - 用于多微服务项目合并生成 */ export interface MultiProjectConfig { /** 项目路径列表 */ projectPaths: string[]; /** 合并后的项目名称 */ mergedProjectName: string; /** 合并后的模块名称 */ mergedModuleName?: string; /** 输出目录 */ outputDir?: string; /** 是否为每个项目添加前缀标识 */ addProjectPrefix?: boolean; /** 项目别名映射(可选,用于自定义项目显示名称) */ projectAliases?: Record; } /** * 单个项目分析结果(用于多项目场景) */ export interface SingleProjectAnalysis { /** 项目路径 */ projectPath: string; /** 项目名称 */ projectName: string; /** 项目别名(用于显示) */ projectAlias?: string; /** 服务接口清单 */ serviceInterfaceList: ServiceInterface[]; /** 接口设计详情 */ designDetailList: DesignDetail[]; /** 数据库表信息 */ tableInfoList: TableInfo[]; /** 技术方案 */ techSolution?: TechSolution; /** 业务异常处理 */ businessException?: BusinessException; /** 附录 */ appendix?: Appendix; /** 统计信息 */ statistics: { totalFiles: number; controllerFiles: number; serviceFiles: number; entityFiles: number; dtoFiles: number; moduleCount: number; }; } /** * 多项目分析结果 */ export interface MultiProjectAnalysisResult { /** 合并后的项目名称 */ mergedProjectName: string; /** 合并后的模块名称 */ mergedModuleName: string; /** 各项目分析结果 */ projects: SingleProjectAnalysis[]; /** 合并后的统计信息 */ mergedStatistics: { totalProjects: number; totalFiles: number; totalServiceInterfaces: number; totalDesignDetails: number; totalTables: number; }; } //# sourceMappingURL=types.d.ts.map