cad_model_history新增字段topology_path

This commit is contained in:
lxp
2026-07-09 10:40:03 +08:00
parent 43545aa715
commit c0a5fb8e26
7 changed files with 16 additions and 3 deletions
+2
View File
@@ -212,6 +212,7 @@
"operationType": "Extrude",
"stepPath": "uploads/history/101.step",
"glbPath": "uploads/history/101.glb",
"topologyPath": "uploads/history/101.topology.json",
"convertStatus": "success",
"createdAt": "2026-07-08 16:20:00",
"updatedAt": "2026-07-08 16:20:00"
@@ -701,6 +702,7 @@
| `operationType` | string | 操作类型 |
| `stepPath` | string | STEP 文件路径 |
| `glbPath` | string | GLB 文件路径 |
| `topologyPath` | string | 拓扑文件路径 |
| `convertStatus` | string | 转换状态 |
| `errorMessage` | string | 转换错误信息 |
| `createdAt` | string | 创建时间 |
@@ -11,6 +11,7 @@ public record CadModelHistoryResponse(
String operationType,
String stepPath,
String glbPath,
String topologyPath,
String convertStatus,
String errorMessage,
LocalDateTime createdAt,
@@ -35,6 +35,9 @@ public class CadModelHistory {
/** GLB 文件路径。 */
private String glbPath;
/** 拓扑文件路径。 */
private String topologyPath;
/** 转换状态。 */
private String convertStatus;
@@ -325,6 +325,7 @@ public class CadModelServiceImpl implements CadModelService {
history.getOperationType(),
history.getStepPath(),
history.getGlbPath(),
history.getTopologyPath(),
history.getConvertStatus(),
history.getErrorMessage(),
history.getCreatedAt(),
@@ -134,6 +134,7 @@ class CadModelControllerTest {
"extrude_add",
"steps/1.step",
"glbs/1.glb",
"topologies/1.json",
"success",
null,
LocalDateTime.of(2026, 7, 8, 10, 0, 0),
@@ -146,7 +147,8 @@ class CadModelControllerTest {
.andExpect(jsonPath("$.code").value("OK"))
.andExpect(jsonPath("$.data[0].id").value(10))
.andExpect(jsonPath("$.data[0].historyIndex").value(1))
.andExpect(jsonPath("$.data[0].historyName").value("凸台-拉伸1"));
.andExpect(jsonPath("$.data[0].historyName").value("凸台-拉伸1"))
.andExpect(jsonPath("$.data[0].topologyPath").value("topologies/1.json"));
}
private static CadModelResponse sampleModel(Long id, String modelName) {
@@ -77,6 +77,7 @@ class CadAnnotationServiceIntegrationTest {
operation_type VARCHAR(64) NOT NULL DEFAULT '',
step_path VARCHAR(1024) NOT NULL DEFAULT '',
glb_path VARCHAR(1024) NOT NULL DEFAULT '',
topology_path VARCHAR(1024) NOT NULL DEFAULT '',
convert_status VARCHAR(32) NOT NULL DEFAULT 'pending',
error_message TEXT,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -69,6 +69,7 @@ class CadModelServiceIntegrationTest {
operation_type VARCHAR(64) NOT NULL DEFAULT '',
step_path VARCHAR(1024) NOT NULL DEFAULT '',
glb_path VARCHAR(1024) NOT NULL DEFAULT '',
topology_path VARCHAR(1024) NOT NULL DEFAULT '',
convert_status VARCHAR(32) NOT NULL DEFAULT 'pending',
error_message TEXT,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -215,6 +216,7 @@ class CadModelServiceIntegrationTest {
assertThat(histories).extracting(CadModelHistoryResponse::id).containsExactly(10L, 11L);
assertThat(histories).extracting(CadModelHistoryResponse::historyIndex).containsExactly(1, 2);
assertThat(histories.getFirst()).hasFieldOrPropertyWithValue("topologyPath", "topologies/1.json");
assertThatThrownBy(() -> cadModelService.listHistories(404L))
.isInstanceOf(BizException.class)
@@ -254,9 +256,9 @@ class CadModelServiceIntegrationTest {
jdbcTemplate.update("""
INSERT INTO cad_model_history (
id, model_id, source_feature_id, history_index, history_name,
operation_type, step_path, glb_path, convert_status, error_message,
operation_type, step_path, glb_path, topology_path, convert_status, error_message,
created_at, updated_at
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
id,
modelId,
@@ -266,6 +268,7 @@ class CadModelServiceIntegrationTest {
"extrude_add",
"steps/" + historyIndex + ".step",
"glbs/" + historyIndex + ".glb",
"topologies/" + historyIndex + ".json",
"success",
null,
"2026-07-08 10:00:00",