2026-05-06 19:07:45 +08:00
|
|
|
package com.labelsys.backend.controller;
|
|
|
|
|
|
2026-05-07 00:23:27 +08:00
|
|
|
import com.labelsys.backend.context.UserContext;
|
2026-05-06 19:07:45 +08:00
|
|
|
import com.labelsys.backend.dto.common.PageResult;
|
|
|
|
|
import com.labelsys.backend.dto.request.AnnotationResultHistoryPageQuery;
|
|
|
|
|
import com.labelsys.backend.dto.response.AnnotationResultHistoryResponse;
|
2026-05-07 16:00:17 +08:00
|
|
|
import com.labelsys.backend.dto.response.FileContentResponse;
|
2026-05-06 19:07:45 +08:00
|
|
|
import com.labelsys.backend.service.AnnotationResultArchiveService;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import jakarta.validation.Valid;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/api/annotation-result-history")
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@Tag(name = "标注结果归档管理", description = "标注结果归档历史查询接口")
|
|
|
|
|
public class AnnotationResultArchiveController {
|
|
|
|
|
|
|
|
|
|
private final AnnotationResultArchiveService annotationResultArchiveService;
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "分页查询归档历史")
|
|
|
|
|
@GetMapping
|
|
|
|
|
public ResponseEntity<PageResult<AnnotationResultHistoryResponse>> pageHistory(
|
2026-05-07 00:23:27 +08:00
|
|
|
@Valid AnnotationResultHistoryPageQuery query) {
|
|
|
|
|
return ResponseEntity.ok(annotationResultArchiveService.pageHistory(UserContext.requireUser(), query));
|
2026-05-06 19:07:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "查询归档历史详情")
|
|
|
|
|
@GetMapping("/{id}")
|
|
|
|
|
public ResponseEntity<AnnotationResultHistoryResponse> getHistory(
|
|
|
|
|
@Parameter(description = "历史记录ID", example = "901")
|
2026-05-07 00:23:27 +08:00
|
|
|
@PathVariable Long id) {
|
|
|
|
|
return ResponseEntity.ok(annotationResultArchiveService.getHistory(UserContext.requireUser(), id));
|
2026-05-06 19:07:45 +08:00
|
|
|
}
|
2026-05-07 16:00:17 +08:00
|
|
|
|
|
|
|
|
@Operation(summary = "加载归档文件内容")
|
|
|
|
|
@GetMapping("/{id}/content")
|
|
|
|
|
public ResponseEntity<FileContentResponse> loadFileContent(
|
|
|
|
|
@Parameter(description = "历史记录ID", example = "901")
|
|
|
|
|
@PathVariable Long id) {
|
|
|
|
|
return ResponseEntity.ok(annotationResultArchiveService.loadFileContent(UserContext.requireUser(), id));
|
|
|
|
|
}
|
2026-05-06 19:07:45 +08:00
|
|
|
}
|