JavaProjectRepo/business-css/api-test.http
2025-12-17 17:09:58 +08:00

138 lines
2.7 KiB
HTTP

### Algorithms
GET http://localhost:8090/api/algorithms
### Algorithms page
GET http://localhost:8090/api/algorithms/page?current=1&size=10
### Create algorithm
POST http://localhost:8090/api/algorithms
Content-Type: application/json
{
"name": "Sample Algorithm",
"description": "Test description",
"version": "v1.0",
"principle": "Simple principle",
"inputParams": "{}",
"outputParams": "{}"
}
### Update algorithm
PUT http://localhost:8090/api/algorithms/{{algorithmId}}
Content-Type: application/json
{
"name": "Updated Name"
}
### Delete algorithm
DELETE http://localhost:8090/api/algorithms/{{algorithmId}}
### Search algorithm
GET http://localhost:8090/api/algorithms/search?keyword=test
### Devices
POST http://localhost:8090/devices
Content-Type: application/json
{
"projectId": "{{projectId}}",
"code": "D-001",
"type": "pump",
"name": "Main Pump"
}
GET http://localhost:8090/devices/types
GET http://localhost:8090/devices/search?type=pump&name=Pump
### Materials
POST http://localhost:8090/materials
Content-Type: application/json
{
"projectId": "{{projectId}}",
"name": "UO2",
"uConcentration": 1.2,
"uo2Density": 10.5
}
GET http://localhost:8090/materials/search?name=UO2
### Critical Data
POST http://localhost:8090/critical-data
Content-Type: application/json
{
"deviceType": "pump",
"attrState": "{}",
"keffValue": 0.98
}
GET http://localhost:8090/critical-data/device-types
GET http://localhost:8090/critical-data/by-device-type?deviceType=pump
### Critical Data import (adjust file path)
POST http://localhost:8090/critical-data/import
Content-Type: multipart/form-data
file=@E:/path/to/critical-data.xlsx
### Scenarios
POST http://localhost:8090/scenarios
Content-Type: application/json
{
"projectId": "{{projectId}}",
"name": "Scenario A",
"description": "Test scenario"
}
GET http://localhost:8090/scenarios/search?name=Scenario
### Events
POST http://localhost:8090/events
Content-Type: application/json
{
"scenarioId": "{{scenarioId}}",
"deviceId": "{{deviceId}}",
"materialId": "{{materialId}}",
"attrChanges": "{\"flow_rate\": 12.3}",
"triggerTime": 1.5
}
PUT http://localhost:8090/events/{{eventId}}/attr-changes
Content-Type: application/json
{
"attr_changes": {"flow_rate": 20.0}
}
### Scenario Results
POST http://localhost:8090/scenario-results
Content-Type: application/json
{
"scenarioId": "{{scenarioId}}",
"deviceId": "{{deviceId}}",
"step": 1,
"attrState": "{}",
"keffValue": 0.97
}
### Projects
POST http://localhost:8090/projects
Content-Type: application/json
{
"code": "P-001",
"name": "Demo Project",
"description": "Test",
"topology": "{}"
}
GET http://localhost:8090/projects/search?name=Demo