package com.ruoyi.sim.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.sim.domain.Major;
import com.ruoyi.sim.service.IMajorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("TaskController")
@RestController
@RequestMapping("/sim/task")
public class TaskController extends BaseController {

    @Autowired
    private IMajorService majorService;

    @GetMapping("/list")
    @PreAuthorize("@ss.hasPermi('sim:task:list')")
    public TableDataInfo list(Major major) {
        startPage();
        List<Major> list = majorService.selectMajorList(major);
        return getDataTable(list);
    }
}
