| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.LEDProgramParam; |
| | | import com.sandu.ximon.admin.param.ReceiveParam; |
| | |
| | | return ResponseUtil.success(ledProgramService.addProgram(ledProgramParam)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | public ResponseVO<Object> updateLEDProgram(@RequestBody @Validated LEDProgramParam ledProgramParam) { |
| | | return ResponseUtil.success(ledProgramService.updateProgram(ledProgramParam)); |
| | | @PostMapping("/update/{pid}") |
| | | public ResponseVO<Object> updateLEDProgram(@PathVariable Long pid, @RequestBody @Validated LEDProgramParam ledProgramParam) { |
| | | return ResponseUtil.success(ledProgramService.updateProgram(pid,ledProgramParam)); |
| | | } |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | public ResponseVO<Object> deleteLEDProgram(@PathVariable Long id) { |
| | | return ResponseUtil.success(ledProgramService.deleteProgram(id)); |
| | | @GetMapping("/getbypid/{pid}") |
| | | public ResponseVO<Object> getByPid(@PathVariable Long pid) { |
| | | return ResponseUtil.success(ledProgramService.getByPid(pid)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/delete/{pid}") |
| | | public ResponseVO<Object> deleteLEDProgram(@PathVariable Long pid) { |
| | | return ResponseUtil.success(ledProgramService.deleteProgram(pid)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listProgram() { |
| | | //LambdaQueryWrapper<LEDProgram> wrapper = ledProgramService.listProgram(); |
| | | return ResponseUtil.success(ledProgramService.list(ledProgramService.listProgram())); |
| | | public ResponseVO<Object> listProgram(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | LambdaQueryWrapper<LEDProgram> wrapper = ledProgramService.listProgram(); |
| | | if(null!=keyword){ |
| | | wrapper.like(LEDProgram::getName,keyword); |
| | | } |
| | | return ResponseUtil.successPage(ledProgramService.list(wrapper)); |
| | | |
| | | } |
| | | |