| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.GasTankWarning; |
| | | import com.ruoyi.procurementrecord.service.GasTankWarningService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/gasTankWarning") |
| | | @AllArgsConstructor |
| | | public class GasTankWarningController { |
| | | @Autowired |
| | | private GasTankWarningService gasTankWarningService; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.listPage(page, gasTankWarning)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.save(gasTankWarning)); |
| | | } |
| | | |
| | | @PostMapping("update") |
| | | public AjaxResult update(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.updateById(gasTankWarning)); |
| | | } |
| | | |
| | | @DeleteMapping("delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(gasTankWarningService.removeByIds(ids)); |
| | | } |
| | | |
| | | //导出 |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response,@RequestParam(name = "ids", required = false) List<Long> ids){ |