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.core.page.TableWebDataInfo;
import com.vetti.common.enums.BusinessType;
import com.vetti.hotake.domain.HotakeInitialScreeningQuestionsInfo;
import com.vetti.hotake.domain.vo.HotakeInitialScreeningQuestionsInfoVo;
import com.vetti.hotake.service.IHotakeInitialScreeningQuestionsInfoService;
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;

/**
 * 初步筛选问题信息Controller
 * 
 * @author wangxiangshun
 * @date 2025-12-14
 */
@Api(tags ="初步筛选问题信息")
@RestController
@RequestMapping("/hotake/initialScreeningQuestionsInfo")
public class HotakeInitialScreeningQuestionsInfoController extends BaseController
{
    @Autowired
    private IHotakeInitialScreeningQuestionsInfoService hotakeInitialScreeningQuestionsInfoService;

    /**
     * 查询初步筛选问题信息列表
     */
    @ApiOperation("查询初步筛选问题信息列表")
    @GetMapping("/getPageList")
    public TableWebDataInfo<HotakeInitialScreeningQuestionsInfo> pageList(HotakeInitialScreeningQuestionsInfo hotakeInitialScreeningQuestionsInfo)
    {
        startPage();
        List<HotakeInitialScreeningQuestionsInfo> list = hotakeInitialScreeningQuestionsInfoService.selectHotakeInitialScreeningQuestionsInfoList(hotakeInitialScreeningQuestionsInfo);
        return getWebDataTable(list);
    }

    /**
     * 查询初步筛选问题信息列表(无分页)
     */
    @ApiOperation("查询初步筛选问题信息列表(无分页)")
    @GetMapping("/getList")
    public R<List<HotakeInitialScreeningQuestionsInfo>> list(HotakeInitialScreeningQuestionsInfo hotakeInitialScreeningQuestionsInfo)
    {
        List<HotakeInitialScreeningQuestionsInfo> list = hotakeInitialScreeningQuestionsInfoService.selectHotakeInitialScreeningQuestionsInfoList(hotakeInitialScreeningQuestionsInfo);
        return R.ok(list,"");
    }

    /**
     * 获取初步筛选问题信息详细信息
     */
    @ApiOperation("获取初步筛选问题信息详细信息")
    @GetMapping(value = "/{id}")
    public R<HotakeInitialScreeningQuestionsInfo> getInfo(@PathVariable("id") Long id)
    {
        return R.ok(hotakeInitialScreeningQuestionsInfoService.selectHotakeInitialScreeningQuestionsInfoById(id),"");
    }

    /**
     * 新增初步筛选问题信息
     */
    @ApiOperation("新增初步筛选问题信息")
    @Log(title = "初步筛选问题信息", businessType = BusinessType.INSERT)
    @PostMapping
    public R<?> add(@RequestBody HotakeInitialScreeningQuestionsInfo hotakeInitialScreeningQuestionsInfo)
    {
        return R.ok(hotakeInitialScreeningQuestionsInfoService.insertHotakeInitialScreeningQuestionsInfo(hotakeInitialScreeningQuestionsInfo));
    }

    /**
     * 修改初步筛选问题信息
     */
    @ApiOperation("修改初步筛选问题信息")
    @Log(title = "初步筛选问题信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public R<?> edit(@RequestBody HotakeInitialScreeningQuestionsInfo hotakeInitialScreeningQuestionsInfo)
    {
        return R.ok(hotakeInitialScreeningQuestionsInfoService.updateHotakeInitialScreeningQuestionsInfo(hotakeInitialScreeningQuestionsInfo));
    }

    /**
     * 删除初步筛选问题信息
     */
    @ApiOperation("删除初步筛选问题信息")
    @Log(title = "初步筛选问题信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public R<?> remove(@PathVariable Long[] ids)
    {
        return R.ok(hotakeInitialScreeningQuestionsInfoService.deleteHotakeInitialScreeningQuestionsInfoByIds(ids));
    }

    /**
     * 新增初步筛选问题信息
     */
    @ApiOperation("批量新增初步筛选问题信息")
    @Log(title = "批量新增初步筛选问题信息", businessType = BusinessType.INSERT)
    @PostMapping("/batchAdd")
    public R<?> batchAdd(@RequestBody HotakeInitialScreeningQuestionsInfoVo questionsInfoVo)
    {
        hotakeInitialScreeningQuestionsInfoService.batchInsertHotakeInitialScreeningQuestionsInfo(questionsInfoVo);
        return R.ok();
    }
}
