package com.ruoyi.procurementrecord.controller; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.R; import com.ruoyi.procurementrecord.pojo.GasTankWarning; import com.ruoyi.procurementrecord.service.GasTankWarningService; import jakarta.servlet.http.HttpServletResponse; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/gasTankWarning") @AllArgsConstructor public class GasTankWarningController extends BaseController { private GasTankWarningService gasTankWarningService; @GetMapping("/listPage") public R listPage(Page page, GasTankWarning gasTankWarning) { return R.ok(gasTankWarningService.listPage(page, gasTankWarning)); } @PostMapping("/add") public R add(@RequestBody GasTankWarning gasTankWarning) { return R.ok(gasTankWarningService.save(gasTankWarning)); } @PostMapping("update") public R update(@RequestBody GasTankWarning gasTankWarning) { return R.ok(gasTankWarningService.updateById(gasTankWarning)); } @DeleteMapping("delete") public R delete(@RequestBody List ids) { if (CollectionUtils.isEmpty(ids)) return R.fail("请传入要删除的ID"); return R.ok(gasTankWarningService.removeByIds(ids)); } //导出 @PostMapping("/export") public void export(HttpServletResponse response, @RequestParam(name = "ids", required = false) List ids) { gasTankWarningService.export(response, ids); } }