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