openapi: 3.0.3 info: title: TMS CISD Init Internal API version: "1.0.0" description: | CISD 一体机初始化相关内部接口(含设备状态接口)。 返回体统一为 ApiResponse 包装结构。 servers: - url: http://127.0.0.1:8080 description: Local tags: - name: Device description: 设备信息与状态 - name: File description: 内部文件上传与查询 - name: Init description: CISD 初始化任务 security: - InternalTokenAuth: [] paths: /api/v1/device/info: get: tags: [Device] summary: 获取设备信息 operationId: getDeviceInfo responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseDeviceInfoResponse" /api/v1/device/status: get: tags: [Device] summary: 获取设备状态(含预制版本信息) operationId: getDeviceStatus responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseDeviceInfoResponse" /api/v1/device/restart: post: tags: [Device] summary: 重启设备 operationId: restartDevice parameters: - name: X-User in: header required: false schema: type: string description: 操作人 responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseDeviceActionResponse" /api/v1/files/upload: post: tags: [File] summary: 上传文件并返回 fileId operationId: uploadFile requestBody: required: true content: multipart/form-data: schema: type: object required: [file] properties: file: type: string format: binary responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseFileUploadResponse" /api/v1/files/{fileId}: get: tags: [File] summary: 查询文件元数据 operationId: getFileDetail parameters: - name: fileId in: path required: true schema: type: string description: 上传接口返回的 fileId responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseFileDetailResponse" /api/v1/init/template: get: tags: [Init] summary: 获取初始化模板元信息 operationId: getInitTemplate parameters: - name: version in: query required: false schema: type: string description: 兼容参数,后端按预置版本返回 responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseInitPlanTemplateResponse" /api/v1/init/preview: post: tags: [Init] summary: 初始化预检(不落库) operationId: previewInitPlan requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/InitPreviewRequest" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseInitPreviewResponse" /api/v1/init/tasks: post: tags: [Init] summary: 创建初始化任务 operationId: createInitTask requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/InitPreviewRequest" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseInitCreateTaskResponse" /api/v1/init/tasks/{taskId}: get: tags: [Init] summary: 查询任务详情 operationId: getInitTaskDetail parameters: - name: taskId in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseInitTaskDetailResponse" /api/v1/init/tasks/{taskId}/steps: get: tags: [Init] summary: 查询任务步骤 operationId: getInitTaskSteps parameters: - name: taskId in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseInitTaskStepResponseList" /api/v1/init/tasks/{taskId}/steps/{stepNo}/log: get: tags: [Init] summary: 查询步骤日志 operationId: getInitTaskStepLog parameters: - name: taskId in: path required: true schema: type: string - name: stepNo in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseInitTaskStepLogResponse" /api/v1/init/tasks/{taskId}/execute: post: tags: [Init] summary: 执行初始化任务 operationId: executeInitTask parameters: - name: taskId in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/ApiResponseInitTaskExecuteResponse" components: securitySchemes: InternalTokenAuth: type: apiKey in: header name: X-Internal-Token schemas: ApiResponseBase: type: object properties: success: type: boolean example: true code: type: integer format: int32 example: 200 msg: type: string example: success timestamp: type: integer format: int64 example: 1740902400000 traceId: type: string nullable: true path: type: string nullable: true details: type: object additionalProperties: true nullable: true ApiResponseDeviceInfoResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/DeviceInfoResponse" ApiResponseDeviceActionResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/DeviceActionResponse" ApiResponseFileUploadResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/FileUploadResponse" ApiResponseFileDetailResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/FileDetailResponse" ApiResponseInitPlanTemplateResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/InitPlanTemplateResponse" ApiResponseInitPreviewResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/InitPreviewResponse" ApiResponseInitCreateTaskResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/InitCreateTaskResponse" ApiResponseInitTaskDetailResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/InitTaskDetailResponse" ApiResponseInitTaskStepResponseList: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: type: array items: $ref: "#/components/schemas/InitTaskStepResponse" ApiResponseInitTaskStepLogResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/InitTaskStepLogResponse" ApiResponseInitTaskExecuteResponse: allOf: - $ref: "#/components/schemas/ApiResponseBase" - type: object properties: data: $ref: "#/components/schemas/InitTaskExecuteResponse" DeviceInfoResponse: type: object properties: deviceId: type: string status: type: string version: type: string presetProductType: type: string enum: [ENTERPRISE, INDIRECT, DIRECT] presetVersion: type: string presetSource: type: string DeviceActionResponse: type: object properties: action: type: string accepted: type: boolean operator: type: string acceptedAt: type: string FileUploadResponse: type: object properties: fileId: type: string size: type: integer format: int64 storagePath: type: string FileDetailResponse: type: object properties: fileId: type: string originalFilename: type: string storagePath: type: string status: type: string enum: [ACTIVE] size: type: integer format: int64 InitPlanTemplateResponse: type: object properties: presetProductType: type: string enum: [ENTERPRISE, INDIRECT, DIRECT] presetVersion: type: string supportedVersions: type: array items: type: string templatePath: type: string InitPreviewRequest: type: object required: - orgCodeType - orgCode - orgNameCn - deployMode - nodes - mq - licenses properties: orgCodeType: type: string enum: [BIC, CIPSID, LEI] orgCode: type: string maxLength: 32 orgNameCn: type: string maxLength: 128 orgNameEn: type: string maxLength: 256 deployMode: type: string enum: [SINGLE, DUAL, QUAD] nodes: $ref: "#/components/schemas/InitPreviewRequestNodes" mq: $ref: "#/components/schemas/InitPreviewRequestMq" licenses: $ref: "#/components/schemas/InitPreviewRequestLicenses" signServer: $ref: "#/components/schemas/InitPreviewRequestSignServer" directTlq: $ref: "#/components/schemas/InitPreviewRequestDirectTlqConfig" description: | 初始化请求体。部分字段为条件必填: - 先上传文件到 `/api/v1/files/upload`,再将返回的 `fileId` 填入下述 fileId 字段 - ENTERPRISE: mq.mqType 仅支持 RABBITMQ 或 TLQ - INDIRECT: mq.mqType 仅支持 RABBITMQ 或 RABBITMQ_TLQ - DIRECT + RABBITMQ_TLQ 需提供 directTlq - DIRECT 需提供 signServer 与 licenses.cfgZipFileId - ENTERPRISE + TLQ、INDIRECT + RABBITMQ_TLQ、DIRECT + RABBITMQ_TLQ 需提供 mq.tlqLicenseFileId - RABBITMQ_CFMQ 需提供 mq.cfmqConfigFileId InitPreviewRequestNodes: type: object required: [node01Ip] properties: node01Ip: type: string pattern: "^(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}$" node02Ip: type: string pattern: "^(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}$" node03Ip: type: string pattern: "^(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}$" node04Ip: type: string pattern: "^(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}$" InitPreviewRequestMq: type: object required: [mqType, channelUsername, channelPassword] properties: mqType: type: string description: | 按产品区分的支持方式枚举: - ENTERPRISE: RABBITMQ | TLQ - INDIRECT: RABBITMQ | RABBITMQ_TLQ - DIRECT: RABBITMQ_TLQ | RABBITMQ_CFMQ channelUsername: type: string maxLength: 32 channelPassword: type: string maxLength: 128 tlqLicenseFileId: type: string maxLength: 128 cfmqConfigFileId: type: string maxLength: 128 InitPreviewRequestLicenses: type: object required: [receiverLicenseFileId] properties: receiverLicenseFileId: type: string maxLength: 128 cfgZipFileId: type: string maxLength: 128 InitPreviewRequestSignServer: type: object properties: signHost: type: string maxLength: 64 signPort: type: integer format: int32 minimum: 1 maximum: 65535 signType: type: string enum: [Infosec, CFCA] signCertDn: type: string maxLength: 512 signCertSn: type: string maxLength: 128 signPassword: type: string maxLength: 128 InitPreviewRequestDirectTlqConfig: type: object properties: localNodeSeq: type: string enum: [A, B] upstreamInstitutions: type: string maxLength: 256 description: 上级机构编码,支持分号分隔 upstreamCocCount: type: integer format: int32 minimum: 1 maximum: 2 InitPreviewResponse: type: object properties: resolvedProductType: type: string presetVersion: type: string stepCount: type: integer format: int32 summary: type: string InitCreateTaskResponse: type: object properties: taskId: type: string status: type: string resolvedProductType: type: string presetVersion: type: string InitTaskDetailResponse: type: object properties: taskId: type: string status: type: string resolvedProductType: type: string presetVersion: type: string orgCode: type: string mqType: type: string deployMode: type: string initPlanJson: type: string InitTaskStepResponse: type: object properties: stepNo: type: integer format: int32 stepCode: type: string status: type: string message: type: string commandLine: type: string logPath: type: string exitCode: type: integer format: int32 nullable: true InitTaskStepLogResponse: type: object properties: taskId: type: string stepNo: type: integer format: int32 stepCode: type: string logPath: type: string content: type: string InitTaskExecuteResponse: type: object properties: taskId: type: string status: type: string totalSteps: type: integer format: int32 successSteps: type: integer format: int32