package com.bonus.material.basic.controller;

import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.material.basic.domain.ToDoBean;
import com.bonus.material.basic.service.ToDoService;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@Api(tags = "代办事项")
@RestController
@RequestMapping("/todo")
public class ToDoController extends BaseController {

    @Autowired
    private ToDoService toDoService;

    /**
     * 代办事项列表
     */
    @ApiOperation(value = "代办事项列表")
    @GetMapping("/getToDoList")
    public TableDataInfo getToDoList(ToDoBean bean) {
        startPage();
        List<ToDoBean> list = toDoService.getToDoList(bean);
        return getDataTable(list);
    }

    @ApiOperation(value = "代办事件下拉")
    @PreventRepeatSubmit
    @PostMapping("/getTaskType")
    public AjaxResult getTaskType(ToDoBean bean){
        return toDoService.getTaskType(bean);
    }

}
