| | |
| | | |
| | | |
| | | import com.moral.common.bean.PageBean; |
| | | import com.moral.common.bean.PageResult; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("device-version") |
| | |
| | | ResultBean resultBean = new ResultBean(ResultBean.SUCCESS); |
| | | return resultBean; |
| | | } |
| | | @GetMapping("get-sensor-ids") |
| | | public List<Integer> getSensorIds(Integer deviceVersionId){ |
| | | return deviceVersionService.getSensorIds(deviceVersionId); |
| | | } |
| | | @PostMapping("version-sensor-config/{id}") |
| | | public ResultBean versionSensorConfig(@PathVariable("id") Integer deviceVersionId,@RequestBody Integer [] sensorIds){ |
| | | ResultBean resultBean = new ResultBean(); |
| | | if(deviceVersionId==null){ |
| | | resultBean.setCode(ResultBean.NO_PERMISSION); |
| | | resultBean.setMessage("设备型号ID不能为null"); |
| | | return resultBean; |
| | | }else{ |
| | | deviceVersionService.versionSensorConfig(deviceVersionId,sensorIds); |
| | | resultBean.setCode(ResultBean.SUCCESS); |
| | | } |
| | | return resultBean; |
| | | } |
| | | } |