/*
 * Copyright [2022] [https://www.xiaonuo.vip]
 *
 * Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Snowy源码头部的版权声明。
 * 3.本项目代码可免费商业使用，商业使用请保留源码和相关描述文件的项目出处，作者声明等。
 * 4.分发源码时候，请注明软件出处 https://www.xiaonuo.vip
 * 5.不可二次分发开源参与同类竞品，如有想法可联系团队xiaonuobase@qq.com商议合作。
 * 6.若您的项目无法满足以上几点，需要更多功能代码，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package com.unis.grainReserves.modular.reserveQuantity.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.unis.grainReserves.modular.reserveQuantity.entity.ReserveQuantityKQ;
import com.unis.grainReserves.modular.reserveQuantity.param.ReserveQuantityKQPageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.unis.common.pojo.CommonResult;
import com.unis.grainReserves.modular.reserveQuantity.entity.ReserveQuantity;
import com.unis.grainReserves.modular.reserveQuantity.param.ReserveQuantityPageParam;
import com.unis.grainReserves.modular.reserveQuantity.service.ReserveQuantityService;
import javax.annotation.Resource;

/**
 * 储备数量控制器
 *
 * @author QSHan
 * @date  2024/05/14 17:32
 */
@Api(tags = "储备数量控制器")
@ApiSupport(author = "UNIS_TEAM", order = 1)
@RestController
@RequestMapping("/grainReserves")
@Validated
public class ReserveQuantityController {

    @Resource
    private ReserveQuantityService reserveQuantityService;

    /**
     * 获取储备数量分页
     *
     * @author QSHan
     * @date  2024/05/14 17:32
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation("获取储备数量分页")
//    @SaCheckPermission("/grainReserves/reserveQuantity/page")
    @GetMapping("/reserveQuantity/page")
    public CommonResult<Page<ReserveQuantity>> page(ReserveQuantityPageParam param) {
        return CommonResult.data(reserveQuantityService.page(param));
    }

    /**
     * 获取储备数量分页列表(库区)
     *
     * @author QSHan
     * @date  2024/05/14 17:32
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("获取储备数量分页(库区)")
//    @SaCheckPermission("/grainReserves/reserveQuantity/storagePage")
    @GetMapping("/reserveQuantity/storagePage")
    public CommonResult<Page<ReserveQuantityKQ>> storagePage(@Validated ReserveQuantityKQPageParam param) {
        return CommonResult.data(reserveQuantityService.storagePage(param));
    }
}
