package com.vetti.web.controller.hotake;

import com.vetti.common.annotation.Log;
import com.vetti.common.core.controller.BaseController;
import com.vetti.common.core.domain.AjaxResult;
import com.vetti.common.core.page.TableDataInfo;
import com.vetti.common.enums.BusinessType;
import com.vetti.common.utils.poi.ExcelUtil;
import com.vetti.hotake.domain.HotakeCandidateInterviewRecordInfo;
import com.vetti.hotake.service.IHotakeCandidateInterviewRecordInfoService;
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;

/**
 * 候选人面试记录信息Controller
 * 
 * @author wangxiangshun
 * @date 2025-12-08
 */
@Api(tags ="候选人面试记录信息")
@RestController
@RequestMapping("/hotake/candidateInterviewRecordInfo")
public class HotakeCandidateInterviewRecordInfoController extends BaseController
{
    @Autowired
    private IHotakeCandidateInterviewRecordInfoService hotakeCandidateInterviewRecordInfoService;

    /**
     * 查询候选人面试记录信息列表
     */
    @ApiOperation("查询候选人面试记录信息列表")
    @PreAuthorize("@ss.hasPermi('hotake:candidateInterviewRecordInfo:list')")
    @GetMapping("/list")
    public TableDataInfo list(HotakeCandidateInterviewRecordInfo hotakeCandidateInterviewRecordInfo)
    {
        startPage();
        List<HotakeCandidateInterviewRecordInfo> list = hotakeCandidateInterviewRecordInfoService.selectHotakeCandidateInterviewRecordInfoList(hotakeCandidateInterviewRecordInfo);
        return getDataTable(list);
    }

    /**
     * 导出候选人面试记录信息列表
     */
    @ApiOperation("导出候选人面试记录信息列表")
    @PreAuthorize("@ss.hasPermi('hotake:candidateInterviewRecordInfo:export')")
    @Log(title = "候选人面试记录信息", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(HotakeCandidateInterviewRecordInfo hotakeCandidateInterviewRecordInfo)
    {
        List<HotakeCandidateInterviewRecordInfo> list = hotakeCandidateInterviewRecordInfoService.selectHotakeCandidateInterviewRecordInfoList(hotakeCandidateInterviewRecordInfo);
        ExcelUtil<HotakeCandidateInterviewRecordInfo> util = new ExcelUtil<HotakeCandidateInterviewRecordInfo>(HotakeCandidateInterviewRecordInfo.class);
        return util.exportExcel(list, "候选人面试记录信息数据");
    }

    /**
     * 获取候选人面试记录信息详细信息
     */
    @ApiOperation("获取候选人面试记录信息详细信息")
    @PreAuthorize("@ss.hasPermi('hotake:candidateInterviewRecordInfo:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(hotakeCandidateInterviewRecordInfoService.selectHotakeCandidateInterviewRecordInfoById(id));
    }

    /**
     * 新增候选人面试记录信息
     */
    @ApiOperation("新增候选人面试记录信息")
    @PreAuthorize("@ss.hasPermi('hotake:candidateInterviewRecordInfo:add')")
    @Log(title = "候选人面试记录信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody HotakeCandidateInterviewRecordInfo hotakeCandidateInterviewRecordInfo)
    {
        return toAjax(hotakeCandidateInterviewRecordInfoService.insertHotakeCandidateInterviewRecordInfo(hotakeCandidateInterviewRecordInfo));
    }

    /**
     * 修改候选人面试记录信息
     */
    @ApiOperation("修改候选人面试记录信息")
    @PreAuthorize("@ss.hasPermi('hotake:candidateInterviewRecordInfo:edit')")
    @Log(title = "候选人面试记录信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody HotakeCandidateInterviewRecordInfo hotakeCandidateInterviewRecordInfo)
    {
        return toAjax(hotakeCandidateInterviewRecordInfoService.updateHotakeCandidateInterviewRecordInfo(hotakeCandidateInterviewRecordInfo));
    }

    /**
     * 删除候选人面试记录信息
     */
    @ApiOperation("删除候选人面试记录信息")
    @PreAuthorize("@ss.hasPermi('hotake:candidateInterviewRecordInfo:remove')")
    @Log(title = "候选人面试记录信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(hotakeCandidateInterviewRecordInfoService.deleteHotakeCandidateInterviewRecordInfoByIds(ids));
    }
}
