| | |
| | | |
| | | import com.moral.common.bean.PageBean; |
| | | import com.moral.common.bean.ResultBean; |
| | | import com.moral.entity.Device; |
| | | import com.moral.service.DeviceService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | ResultBean resultBean = new ResultBean(ResultBean.SUCCESS); |
| | | return resultBean; |
| | | } |
| | | @PostMapping("add-or-modify") |
| | | public ResultBean addOrModify(@RequestBody Device device){ |
| | | deviceService.addOrModify(device); |
| | | ResultBean resultBean = new ResultBean(ResultBean.SUCCESS); |
| | | return resultBean; |
| | | } |
| | | |
| | | @GetMapping("monitorPointId") |
| | | public ResultBean<List<Device>> getDevicesByMonitorPointId(@RequestParam(name="monitorPointId")Integer monitorPointId) { |
| | | |
| | | List<Device> devices = deviceService.getDevicesByMonitorPointId(monitorPointId); |
| | | return new ResultBean<List<Device>>(devices); |
| | | } |
| | | } |