package vip.xiaonuo.quality.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.common.pojo.CommonResult;
import vip.xiaonuo.quality.entity.QualityReagentInStock;
import vip.xiaonuo.quality.entity.QualityReagentOutStock;
import vip.xiaonuo.quality.param.QualityStockPageParam;
import vip.xiaonuo.quality.service.IQualityReagentOutStockService;

/**
 * <p>
 * 质量试剂出库 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-03-10
 */
@RestController
@Api(tags = "质量试剂出库")
@ApiSupport(author = "wang", order = 1)
@Validated
public class QualityReagentOutStockController {

    @Autowired
    private IQualityReagentOutStockService outStockService;

    @PostMapping("/quality-reagent-out-stock/add")
    @ApiOperationSupport(order = 1)
    @ApiOperation("质量试剂出库添加")
    public CommonResult add(@RequestBody QualityReagentOutStock outStock) {
        return outStockService.add(outStock);
    }

    @PostMapping("/quality-reagent-out-stock/edit")
    @ApiOperationSupport(order = 2)
    @ApiOperation("质量试剂出库修改")
    public CommonResult edit(@RequestBody QualityReagentOutStock outStock) {
        return outStockService.edit(outStock);
    }

    @PostMapping("/quality-reagent-out-stock/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation("质量试剂出库分页")
    public CommonResult<Page<QualityReagentOutStock>> page(@RequestBody QualityStockPageParam stockPageParam) {
        return CommonResult.data(outStockService.page(stockPageParam));
    }
}
