| | |
| | | package com.moral.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.moral.common.bean.PageBean; |
| | | import com.moral.common.bean.ResultBean; |
| | | import com.moral.entity.DeviceVersion; |
| | | import com.moral.service.DeviceVersionService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | @RestController |
| | | @RequestMapping("device-version") |
| | | @CrossOrigin(origins = "*", maxAge = 3600) |
| | | public class DeviceVersionController { |
| | | @Resource |
| | | private DeviceVersionService deviceVersionService; |
| | | |
| | | @GetMapping("page-list") |
| | | public PageBean<DeviceVersion> pageList(PageBean pageBean) throws NoSuchMethodException, UnsupportedEncodingException { |
| | | return deviceVersionService.queryByPageBean(pageBean); |
| | | } |
| | | @PostMapping("delete-by-ids") |
| | | public ResultBean deleteByIds(@RequestBody Integer [] ids){ |
| | | deviceVersionService.deleteByIds(ids); |
| | | ResultBean resultBean = new ResultBean(ResultBean.SUCCESS); |
| | | return resultBean; |
| | | } |
| | | @PostMapping("add-or-modify") |
| | | public ResultBean addOrModify(@RequestBody DeviceVersion deviceVersion){ |
| | | deviceVersionService.addOrModify(deviceVersion); |
| | | ResultBean resultBean = new ResultBean(ResultBean.SUCCESS); |
| | | return resultBean; |
| | | } |
| | | } |