package com.ruoyi.cms.controller.cms;

import com.ruoyi.cms.domain.EmployeeConfirm;
import com.ruoyi.cms.service.EmployeeConfirmService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
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.*;

import java.util.List;


/**
 * 新入职员工确认信息
 *
 * @author 
 * @email 
 * @date 2025-10-10 10:42:16
 */
@RestController
@RequestMapping("/cms/employeeConfirm")
@Api(tags = "后台：新入职员工确认信息")
public class EmployeeConfirmController extends BaseController {
    @Autowired
    private EmployeeConfirmService employeeConfirmService;

    /**
     * 列表
     */
    @ApiOperation("新入职员工确认信息列表")
//    @PreAuthorize("@ss.hasPermi('cms:employeeConfirm:list')")
    @RequestMapping("/list")
    public TableDataInfo list(EmployeeConfirm employeeConfirm){
        List<EmployeeConfirm> list=employeeConfirmService.getEmployeeConfirmList(employeeConfirm);
        return getDataTable(list);
    }

    /**
     * 保存
     */
    @ApiOperation("新增新入职员工确认信息")
//    @PreAuthorize("@ss.hasPermi('cms:employeeConfirm:add')")
    @Log(title = "职员工确认信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmployeeConfirm employeeConfirm){
        return toAjax(employeeConfirmService.insertEmployeeConfirm(employeeConfirm));
    }

    @ApiOperation("修改新入职员工确认信息")
//    @PreAuthorize("@ss.hasPermi('cms:employeeConfirm:edit')")
    @Log(title = "职员工确认信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmployeeConfirm employeeConfirm){
        return toAjax(employeeConfirmService.updateEmployeeConfirm(employeeConfirm));
    }

    @ApiOperation("删除新入职员工确认信息")
//    @PreAuthorize("@ss.hasPermi('app:employeeConfirm:remove')")
    @Log(title = "公司", businessType = BusinessType.DELETE)
    @DeleteMapping("/{employeeConfirmIds}")
    public AjaxResult remove(@PathVariable Long[] employeeConfirmIds)
    {
        return toAjax(employeeConfirmService.deleteEmployeeConfirmIds(employeeConfirmIds));
    }
}
