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.TableWebDataInfo;
import com.vetti.common.enums.BusinessType;
import com.vetti.hotake.domain.HotakeAiInterviewQuestionsInfo;
import com.vetti.hotake.service.IHotakeAiInterviewQuestionsInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * AI面试问题信息Controller
 * 
 * @author wangxiangshun
 * @date 2025-12-14
 */
@Api(tags ="AI面试问题信息")
@RestController
@RequestMapping("/hotake/aiInterviewQuestionsInfo")
public class HotakeAiInterviewQuestionsInfoController extends BaseController
{
    @Autowired
    private IHotakeAiInterviewQuestionsInfoService hotakeAiInterviewQuestionsInfoService;

    /**
     * 查询AI面试问题信息列表
     */
    @ApiOperation("查询AI面试问题信息列表")
    @GetMapping("/getPageList")
    public TableWebDataInfo<HotakeAiInterviewQuestionsInfo> pageList(HotakeAiInterviewQuestionsInfo hotakeAiInterviewQuestionsInfo)
    {
        startPage();
        List<HotakeAiInterviewQuestionsInfo> list = hotakeAiInterviewQuestionsInfoService.selectHotakeAiInterviewQuestionsInfoList(hotakeAiInterviewQuestionsInfo);
        return getWebDataTable(list);
    }

    /**
     * 查询AI面试问题信息列表(无分页)
     */
    @ApiOperation("查询AI面试问题信息列表(无分页)")
    @GetMapping("/getList")
    public R<List<HotakeAiInterviewQuestionsInfo>> list(HotakeAiInterviewQuestionsInfo hotakeAiInterviewQuestionsInfo)
    {
        List<HotakeAiInterviewQuestionsInfo> list = hotakeAiInterviewQuestionsInfoService.selectHotakeAiInterviewQuestionsInfoList(hotakeAiInterviewQuestionsInfo);
        return R.ok(list);
    }

    /**
     * 获取AI面试问题信息详细信息
     */
    @ApiOperation("获取AI面试问题信息详细信息")
    @GetMapping(value = "/{id}")
    public R<HotakeAiInterviewQuestionsInfo> getInfo(@PathVariable("id") Long id)
    {
        return R.ok(hotakeAiInterviewQuestionsInfoService.selectHotakeAiInterviewQuestionsInfoById(id));
    }

    /**
     * 新增AI面试问题信息
     */
    @ApiOperation("新增AI面试问题信息")
    @Log(title = "AI面试问题信息", businessType = BusinessType.INSERT)
    @PostMapping
    public R<?> add(@RequestBody HotakeAiInterviewQuestionsInfo hotakeAiInterviewQuestionsInfo)
    {
        return R.ok(hotakeAiInterviewQuestionsInfoService.insertHotakeAiInterviewQuestionsInfo(hotakeAiInterviewQuestionsInfo));
    }

    /**
     * 修改AI面试问题信息
     */
    @ApiOperation("修改AI面试问题信息")
    @Log(title = "AI面试问题信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public R<?> edit(@RequestBody HotakeAiInterviewQuestionsInfo hotakeAiInterviewQuestionsInfo)
    {
        return R.ok(hotakeAiInterviewQuestionsInfoService.updateHotakeAiInterviewQuestionsInfo(hotakeAiInterviewQuestionsInfo));
    }

    /**
     * 删除AI面试问题信息
     */
    @ApiOperation("删除AI面试问题信息")
    @Log(title = "AI面试问题信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public R<?> remove(@PathVariable Long[] ids)
    {
        return R.ok(hotakeAiInterviewQuestionsInfoService.deleteHotakeAiInterviewQuestionsInfoByIds(ids));
    }
}
