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.HotakeInterviewDetail;
import com.vetti.hotake.service.IHotakeInterviewDetailService;
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/interviewDetail")
public class HotakeInterviewDetailController extends BaseController
{
    @Autowired
    private IHotakeInterviewDetailService hotakeInterviewDetailService;

    /**
     * 查询面试信息明细列表
     */
    @ApiOperation("查询面试信息明细列表")
    @PreAuthorize("@ss.hasPermi('hotake:interviewDetail:list')")
    @GetMapping("/list")
    public TableDataInfo list(HotakeInterviewDetail hotakeInterviewDetail)
    {
        startPage();
        List<HotakeInterviewDetail> list = hotakeInterviewDetailService.selectHotakeInterviewDetailList(hotakeInterviewDetail);
        return getDataTable(list);
    }

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

    /**
     * 新增面试信息明细
     */
    @ApiOperation("新增面试信息明细")
    @PreAuthorize("@ss.hasPermi('hotake:interviewDetail:add')")
    @Log(title = "面试信息明细", businessType = BusinessType.INSERT)
    @PostMapping
    public R<HotakeInterviewDetail> add(@RequestBody HotakeInterviewDetail hotakeInterviewDetail)
    {
        return R.ok(hotakeInterviewDetailService.insertHotakeInterviewDetail(hotakeInterviewDetail));
    }

    /**
     * 修改面试信息明细
     */
    @ApiOperation("修改面试信息明细")
    @PreAuthorize("@ss.hasPermi('hotake:interviewDetail:edit')")
    @Log(title = "面试信息明细", businessType = BusinessType.UPDATE)
    @PutMapping
    public R<HotakeInterviewDetail> edit(@RequestBody HotakeInterviewDetail hotakeInterviewDetail)
    {
        return R.ok(hotakeInterviewDetailService.updateHotakeInterviewDetail(hotakeInterviewDetail));
    }

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