package com.ruoyi.web.controller.ie;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.ie.domain.AEnrollSkill;
import com.ruoyi.ie.service.IAEnrollSkillService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 院校考生技能考核办法Controller
 * 
 * @author voluntary
 * @date 2023-11-26
 */
@RestController
@RequestMapping("/ie/aEnrollSkill")
public class AEnrollSkillController extends BaseController
{
    @Autowired
    private IAEnrollSkillService aEnrollSkillService;

    /**
     * 查询院校考生技能考核办法列表
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollSkill:list')")
    @GetMapping("/list")
    public TableDataInfo list(AEnrollSkill aEnrollSkill)
    {
        startPage();
        List<AEnrollSkill> list = aEnrollSkillService.selectAEnrollSkillList(aEnrollSkill);
        return getDataTable(list);
    }

    /**
     * 导出院校考生技能考核办法列表
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollSkill:export')")
    @Log(title = "院校考生技能考核办法", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, AEnrollSkill aEnrollSkill)
    {
        List<AEnrollSkill> list = aEnrollSkillService.selectAEnrollSkillList(aEnrollSkill);
        ExcelUtil<AEnrollSkill> util = new ExcelUtil<AEnrollSkill>(AEnrollSkill.class);
        util.exportExcel(response, list, "院校考生技能考核办法数据");
    }

    /**
     * 获取院校考生技能考核办法详细信息
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollSkill:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(aEnrollSkillService.selectAEnrollSkillById(id));
    }

    /**
     * 新增院校考生技能考核办法
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollSkill:add')")
    @Log(title = "院校考生技能考核办法", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AEnrollSkill aEnrollSkill)
    {
        return toAjax(aEnrollSkillService.insertAEnrollSkill(aEnrollSkill));
    }

    /**
     * 修改院校考生技能考核办法
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollSkill:edit')")
    @Log(title = "院校考生技能考核办法", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AEnrollSkill aEnrollSkill)
    {
        return toAjax(aEnrollSkillService.updateAEnrollSkill(aEnrollSkill));
    }

    /**
     * 删除院校考生技能考核办法
     */
    @PreAuthorize("@ss.hasPermi('ie:aEnrollSkill:remove')")
    @Log(title = "院校考生技能考核办法", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(aEnrollSkillService.deleteAEnrollSkillByIds(ids));
    }
}
