|
|
|
|
package com.project.classicpaper.controller;
|
|
|
|
|
|
|
|
|
|
import com.project.base.domain.result.PageResult;
|
|
|
|
|
import com.project.base.domain.result.Result;
|
|
|
|
|
import com.project.classicpaper.application.ClassicPaperSetApplicationService;
|
|
|
|
|
import com.project.classicpaper.domain.dto.ClassicPaperSetDTO;
|
|
|
|
|
import com.project.classicpaper.domain.param.ClassicPaperSetParam;
|
|
|
|
|
import com.project.operation.annotation.OperationLog;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RequestMapping("/api/admin/classicPaperSet")
|
|
|
|
|
public class ClassicPaperSetController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ClassicPaperSetApplicationService classicPaperSetApplicationService;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/generate")
|
|
|
|
|
@OperationLog(module = "经典套题")
|
|
|
|
|
public Result<ClassicPaperSetDTO> generate(ClassicPaperSetDTO request) throws Exception {
|
|
|
|
|
return classicPaperSetApplicationService.generate(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public Result<PageResult<ClassicPaperSetDTO>> list(ClassicPaperSetParam param) {
|
|
|
|
|
return classicPaperSetApplicationService.list(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/detail")
|
|
|
|
|
public Result<ClassicPaperSetDTO> detail(Long setId) {
|
|
|
|
|
return classicPaperSetApplicationService.getDetail(setId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/delete")
|
|
|
|
|
@OperationLog(module = "经典套题")
|
|
|
|
|
public Result<String> delete(Long setId) throws Exception {
|
|
|
|
|
return classicPaperSetApplicationService.delete(setId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存固化:全量保存套题组所有版本,校验通过后锁定为CONFIRMED
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/save")
|
|
|
|
|
public Result<ClassicPaperSetDTO> save(@RequestBody ClassicPaperSetDTO request) throws Exception {
|
|
|
|
|
return classicPaperSetApplicationService.save(request);
|
|
|
|
|
}
|
|
|
|
|
}
|