mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-23 04:19:07 +08:00
refactor: redesign document history model
This commit is contained in:
@@ -3,6 +3,7 @@ package com.databasir.api;
|
||||
import com.databasir.common.JsonData;
|
||||
import com.databasir.common.SystemException;
|
||||
import com.databasir.core.domain.document.data.DatabaseDocumentResponse;
|
||||
import com.databasir.core.domain.document.data.DatabaseDocumentSimpleResponse;
|
||||
import com.databasir.core.domain.document.data.DatabaseDocumentVersionResponse;
|
||||
import com.databasir.core.domain.document.service.DocumentService;
|
||||
import com.databasir.core.domain.log.annotation.Operation;
|
||||
@@ -54,7 +55,7 @@ public class DocumentController {
|
||||
@PageableDefault(sort = "id",
|
||||
direction = DESC)
|
||||
Pageable page) {
|
||||
return JsonData.ok(documentService.getVersionsBySchemaSourceId(projectId, page));
|
||||
return JsonData.ok(documentService.getVersionsByProjectId(projectId, page));
|
||||
}
|
||||
|
||||
@GetMapping(Routes.Document.EXPORT)
|
||||
@@ -79,4 +80,16 @@ public class DocumentController {
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping(Routes.Document.GET_SIMPLE_ONE)
|
||||
public JsonData<DatabaseDocumentSimpleResponse> getSimpleByProjectId(@PathVariable Integer projectId,
|
||||
@RequestParam(required = false) Long version) {
|
||||
return JsonData.ok(documentService.getSimpleOneByProjectId(projectId, version));
|
||||
}
|
||||
|
||||
@GetMapping(Routes.Document.GET_TABLE_DETAIL)
|
||||
public JsonData<DatabaseDocumentResponse.TableDocumentResponse> getTableDocument(@PathVariable Integer projectId,
|
||||
@PathVariable Integer tableId) {
|
||||
return JsonData.ok(documentService.getTableDetails(projectId, tableId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -78,6 +78,10 @@ public interface Routes {
|
||||
|
||||
String LIST_VERSIONS = BASE + "/projects/{projectId}/document_versions";
|
||||
|
||||
String GET_SIMPLE_ONE = BASE + "/projects/{projectId}/documents/simple";
|
||||
|
||||
String GET_TABLE_DETAIL = BASE + "/projects/{projectId}/table_documents/{tableId}";
|
||||
|
||||
String EXPORT = BASE + "/projects/{projectId}/document_files";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user