package com.hxhq.business.controller;

import java.util.Arrays;
import java.util.List;

import com.hxhq.business.domain.Cell;
import com.hxhq.business.form.gsp.CzForm;
import com.hxhq.business.form.gsp.GspCzForm;
import com.hxhq.business.form.study.StudyCellSearchForm;
import com.hxhq.common.security.annotation.RequiresPermissions;
import com.hxhq.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.hxhq.business.domain.Bacteria;
import com.hxhq.business.service.IBacteriaService;
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 2026-01-12
 */
@RestController
@RequestMapping("/business/bacteria")
public class BacteriaController extends BaseController
{
    @Autowired
    private IBacteriaService bacteriaService;

    /**
     * 查询试验-细菌列表
     */
    @GetMapping("/studyList")
    public TableDataInfo list(StudyCellSearchForm form)
    {
        startPage();
        List<Bacteria> list = bacteriaService.queryStudyList(form);
        return getDataTable(list);
    }

    /** 处置 */
    @PostMapping("/cz")
    public AjaxResult cz(@RequestBody @Validated CzForm form)
    {
        form.setQmrId(SecurityUtils.getUserId());
        bacteriaService.cz(form);
        return AjaxResult.success("操作成功");
    }

}
