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.
47 lines
1.4 KiB
47 lines
1.4 KiB
|
1 month ago
|
package com.project.task.controller;
|
||
|
|
|
||
|
|
|
||
|
|
import com.project.base.domain.result.PageResult;
|
||
|
|
import com.project.base.domain.result.Result;
|
||
|
|
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")
|
||
|
|
public Result<TaskDTO> save(TaskDTO dto) throws Exception {
|
||
|
|
return taskApplicationService.saveOrUpdate(dto);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
@PostMapping("/batchDelete")
|
||
|
|
public Result<String> batchDelete(List<Long> idList) throws Exception {
|
||
|
|
return taskApplicationService.batchDelete(idList);
|
||
|
|
}
|
||
|
|
}
|