package com.ktg.iscs.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.enums.BusinessType;
import com.ktg.common.pojo.CommonResult;
import com.ktg.iscs.domain.IsMaterialsReminder;
import com.ktg.iscs.domain.dto.materialsReminder.MaterialsReminderPageDTO;
import com.ktg.iscs.domain.vo.materialsReminder.MaterialsReminderVO;
import com.ktg.iscs.service.IIsMaterialsReminderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 物资借出提醒Controller
 *
 * @author cgj
 * @date 2024-11-19
 */
@Api(tags = "物资借出提醒")
@RestController
@RequestMapping("/iscs/reminder")
public class IsMaterialsReminderController extends BaseController
{
    @Autowired
    private IIsMaterialsReminderService isMaterialsReminderService;

    @ApiOperation("查询物资借出提醒-分页")
    @Parameters({
            @Parameter(name = "page", description = "Page"),
            @Parameter(name = "isMaterialsReminder", description = "实体参数")
    })
    // @PreAuthorize("@ss.hasPermi('iscs:reminder:list')")
    @GetMapping("/getIsMaterialsReminderPage")
    public CommonResult<Page<MaterialsReminderVO>> getIsMaterialsReminderPage(Page<IsMaterialsReminder> page, MaterialsReminderPageDTO dto)
    {
        Page<MaterialsReminderVO> result = isMaterialsReminderService.getIsMaterialsReminderPage(page, dto);
        return CommonResult.success(result);
    }

    @ApiOperation("修改物资借出提醒")
    // @PreAuthorize("@ss.hasPermi('iscs:reminder:edit')")
    @Log(title = "物资借出提醒", businessType = BusinessType.UPDATE)
    @PostMapping("/updateIsMaterialsReminder")
    public CommonResult<Boolean> updateIsMaterialsReminder(@RequestBody @Parameter(name = "isMaterialsReminder", description = "修改数据类,放到body") IsMaterialsReminder isMaterialsReminder)
    {
        return CommonResult.success(isMaterialsReminderService.updateIsMaterialsReminder(isMaterialsReminder) == 1);
    }

}
