Files
lablesys_backend/src/main/java/com/labelsys/backend/controller/AnnotationResultArchiveController.java

43 lines
1.9 KiB
Java
Raw Normal View History

package com.labelsys.backend.controller;
import com.labelsys.backend.context.LoginUser;
import com.labelsys.backend.dto.common.PageResult;
import com.labelsys.backend.dto.request.AnnotationResultHistoryPageQuery;
import com.labelsys.backend.dto.response.AnnotationResultHistoryResponse;
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(
@Valid AnnotationResultHistoryPageQuery query,
@Parameter(hidden = true) LoginUser currentUser) {
return ResponseEntity.ok(annotationResultArchiveService.pageHistory(currentUser, query));
}
@Operation(summary = "查询归档历史详情")
@GetMapping("/{id}")
public ResponseEntity<AnnotationResultHistoryResponse> getHistory(
@Parameter(description = "历史记录ID", example = "901")
@PathVariable Long id,
@Parameter(hidden = true) LoginUser currentUser) {
return ResponseEntity.ok(annotationResultArchiveService.getHistory(currentUser, id));
}
}