package com.simuwang.manage.api.log;

import com.simuwang.base.common.support.MybatisPage;
import com.simuwang.base.pojo.dto.query.TaskPageQuery;
import com.simuwang.base.pojo.vo.EmailTaskInfoVO;
import com.simuwang.base.pojo.vo.IdListVO;
import com.simuwang.logging.SystemLog;
import com.simuwang.manage.service.TaskLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 任务信息管理
 * Author:   chenjianhua
 * Date:     2024/10/8 14:06
 * Description: ${DESCRIPTION}
 */
@SystemLog("任务信息管理")
@RestController
@RequestMapping("/v1/task")
public class TaskLogController {
    @Autowired
    private TaskLogService taskLogService;
    /**
     * 查询任务列表
     * @param taskPageQuery
     * @return
     */
    @SystemLog(value = "查询任务列表")
    @GetMapping("/search-task-list")
    public MybatisPage<EmailTaskInfoVO> searchTaskList(TaskPageQuery taskPageQuery){
        MybatisPage<EmailTaskInfoVO> result = taskLogService.searchTaskList(taskPageQuery);
        return result;
    }
    /**
     * 删除任务列表
     * @param idListVO
     * @return
     */
    @SystemLog(value = "删除任务列表",type = SystemLog.Type.DELETE)
    @PostMapping("/delete-task-log")
    public boolean deleteLog(@RequestBody IdListVO idListVO){
        taskLogService.deleteTaskLog(idListVO);
        return true;
    }
}
