cisd/docs/plans/2026-03-02-cisd-init-request-schema-spec.md
2026-03-05 11:08:57 +08:00

109 lines
3.2 KiB
Markdown

# CISD Init Request Schema Spec (Preset-Version Driven)
## 1. Scope
This document defines the frontend request schema for CISD initialization in TMS when product version is preset by device metadata.
- Frontend must call `GET /api/v1/device/status` first.
- If `presetProductType` is empty or invalid, initialization is forbidden.
- Frontend must render version-specific form fields automatically; user does not manually choose version.
## 2. Device status fields used by frontend
`/api/v1/device/status` response includes:
- `presetProductType`: `ENTERPRISE | INDIRECT | DIRECT`
- `presetVersion`: preset package version
- `presetSource`: where preset was loaded from (e.g., `CONFIG`, future `DB`)
## 3. Init preview request payload
Endpoint: `POST /api/v1/init/preview`
```json
{
"orgCodeType": "BIC",
"orgCode": "AAAABBBBXXX",
"orgNameCn": "示例机构",
"orgNameEn": "Example Bank",
"deployMode": "DUAL",
"nodes": {
"node01Ip": "10.0.0.1",
"node02Ip": "10.0.0.2",
"node03Ip": "127.0.0.1",
"node04Ip": "127.0.0.1"
},
"mq": {
"mqType": "RABBITMQ",
"channelUsername": "channel_user",
"channelPassword": "channel_password",
"tlqLicenseFileId": "file-tlq-license",
"cfmqConfigFileId": "file-cfmq-config"
},
"licenses": {
"receiverLicenseFileId": "file-receiver-license",
"cfgZipFileId": "file-cfg-zip"
},
"signServer": {
"signHost": "172.30.1.101",
"signPort": 50006,
"signType": "Infosec",
"signCertDn": "CN=...",
"signCertSn": "1154809590",
"signPassword": "***"
}
}
```
## 4. Mandatory fields by product type
### 4.1 Common mandatory fields (all versions)
- `orgCodeType`, `orgCode`, `orgNameCn`
- `deployMode`
- `nodes.node01Ip`
- `mq.mqType`, `mq.channelUsername`, `mq.channelPassword`
- `licenses.receiverLicenseFileId`
### 4.2 ENTERPRISE / INDIRECT
Allowed values:
- `deployMode`: `SINGLE | DUAL`
- `mq.mqType`: `RABBITMQ | TLQ`
Conditional required fields:
- `deployMode=DUAL` -> `nodes.node02Ip`
- `mqType=TLQ` -> `mq.tlqLicenseFileId`
### 4.3 DIRECT
Allowed values:
- `deployMode`: `SINGLE | DUAL | QUAD`
- `mq.mqType`: `RABBITMQ_TLQ | RABBITMQ_CFMQ`
Always required:
- `licenses.cfgZipFileId`
- `signServer.signHost`
- `signServer.signPort`
- `signServer.signType`
- `signServer.signCertDn`
- `signServer.signCertSn`
- `signServer.signPassword`
Conditional required fields:
- `deployMode=DUAL|QUAD` -> `nodes.node02Ip`
- `deployMode=QUAD` -> `nodes.node03Ip`, `nodes.node04Ip`
- `mqType=RABBITMQ_TLQ` -> `mq.tlqLicenseFileId`
- `mqType=RABBITMQ_CFMQ` -> `mq.cfmqConfigFileId`
## 5. Prefilled vs user-input fields
### 5.1 Prefilled and hidden from frontend
- Product preset metadata: version type and package version
- Database deployment credentials and root/app user passwords
- RabbitMQ admin username/password
### 5.2 User input fields
- Institution identity and node addresses
- MQ channel username/password
- Version-conditional file uploads (receiver license, TLQ license, CFMQ config, direct CFG zip)
- Direct sign server information
## 6. Validation behavior
- Validation errors return code `4001` with field message.
- Missing/invalid preset product type returns business error and initialization is blocked.