package com.hxhq.business.controller;

import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.hxhq.business.domain.StudyJcgj;
import com.hxhq.business.service.IStudyJcgjService;
import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo;


/**
 * 试验-稽查轨迹Controller
 *
 * @author hxhq
 * @date 2025-12-30
 */
@RestController
@RequestMapping("/business/studyJcgj")
public class StudyJcgjController extends BaseController
{
    @Autowired
    private IStudyJcgjService studyJcgjService;

    /**
     * 查询试验-稽查轨迹列表
     */
    @GetMapping("/list")
    public TableDataInfo list(StudyJcgj studyJcgj)
    {
        startPage();
        List<StudyJcgj> list = studyJcgjService.queryList(studyJcgj);
        return getDataTable(list);
    }

    /**
     * 获取试验-稽查轨迹详细信息
     */
    @GetMapping(value = "/info")
    public AjaxResult getInfo(Long id)
    {
        return AjaxResult.success(studyJcgjService.getById(id));
    }

    /**
     * 新增试验-稽查轨迹信息
     */
    @PostMapping("/save")
    public AjaxResult save(@RequestBody StudyJcgj studyJcgj)
    {
        return toAjax(studyJcgjService.saveOrUpdate(studyJcgj));
    }

    /**
     * 删除试验-稽查轨迹信息
     */
    @PostMapping("/delete")
    public AjaxResult delete(@RequestBody Long[] ids)
    {
        return toAjax(studyJcgjService.removeByIds(Arrays.asList(ids)));
    }
}
