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.R;
import com.vetti.common.core.page.TableDataInfo;
import com.vetti.common.enums.BusinessType;
import com.vetti.hotake.domain.HotakeInterviewInfo;
import com.vetti.hotake.service.IHotakeInterviewInfoService;
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-11-09
 */
@Api(tags ="面试信息")
@RestController
@RequestMapping("/hotake/interviewInfo")
public class HotakeInterviewInfoController extends BaseController
{
    @Autowired
    private IHotakeInterviewInfoService hotakeInterviewInfoService;

    /**
     * 查询面试信息列表
     */
    @ApiOperation("查询面试信息列表")
    @PreAuthorize("@ss.hasPermi('hotake:interviewInfo:list')")
    @GetMapping("/list")
    public TableDataInfo list(HotakeInterviewInfo hotakeInterviewInfo)
    {
        startPage();
        List<HotakeInterviewInfo> list = hotakeInterviewInfoService.selectHotakeInterviewInfoList(hotakeInterviewInfo);
        return getDataTable(list);
    }


    /**
     * 获取面试信息详细信息
     */
    @ApiOperation("获取面试信息详细信息")
    @PreAuthorize("@ss.hasPermi('hotake:interviewInfo:query')")
    @GetMapping(value = "/{id}")
    public R<HotakeInterviewInfo> getInfo(@PathVariable("id") Long id)
    {
        return R.ok(hotakeInterviewInfoService.selectHotakeInterviewInfoById(id));
    }

    /**
     * 新增面试信息
     */
    @ApiOperation("新增面试信息")
    @PreAuthorize("@ss.hasPermi('hotake:interviewInfo:add')")
    @Log(title = "面试信息", businessType = BusinessType.INSERT)
    @PostMapping
    public R<HotakeInterviewInfo> add(@RequestBody HotakeInterviewInfo hotakeInterviewInfo)
    {
        return R.ok(hotakeInterviewInfoService.insertHotakeInterviewInfo(hotakeInterviewInfo));
    }

    /**
     * 修改面试信息
     */
    @ApiOperation("修改面试信息")
    @PreAuthorize("@ss.hasPermi('hotake:interviewInfo:edit')")
    @Log(title = "面试信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public R<HotakeInterviewInfo> edit(@RequestBody HotakeInterviewInfo hotakeInterviewInfo)
    {
        return R.ok(hotakeInterviewInfoService.updateHotakeInterviewInfo(hotakeInterviewInfo));
    }

    /**
     * 删除面试信息
     */
    @ApiOperation("删除面试信息")
    @PreAuthorize("@ss.hasPermi('hotake:interviewInfo:remove')")
    @Log(title = "面试信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public R remove(@PathVariable Long[] ids)
    {
        return R.ok(hotakeInterviewInfoService.deleteHotakeInterviewInfoByIds(ids));
    }
}
