You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6 KiB

package com.project.task.controller;
import com.project.base.domain.result.PageResult;
import com.project.base.domain.result.Result;
1 month ago
import com.project.operation.annotation.OperationLog;
import com.project.task.application.TaskApplicationService;
import com.project.task.domain.dto.TaskDTO;
import com.project.task.domain.param.TaskParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Slf4j
@RequestMapping("/api/admin/task")
public class TaskController {
@Autowired
private TaskApplicationService taskApplicationService;
@GetMapping("/search")
public Result<PageResult<TaskDTO>> search(TaskParam param) throws Exception {
return taskApplicationService.search(param);
}
@GetMapping("/getDetail")
public Result<TaskDTO> getDetail(Long id) throws Exception {
return taskApplicationService.getDetail(id);
}
@PostMapping("/saveOrUpdate")
1 month ago
@OperationLog(module = "考试任务")
public Result<TaskDTO> save(TaskDTO dto) throws Exception {
return taskApplicationService.saveOrUpdate(dto);
}
@PostMapping("/batchDelete")
1 month ago
@OperationLog(module = "考试任务")
public Result<String> batchDelete(List<Long> idList) throws Exception {
return taskApplicationService.batchDelete(idList);
}
}