| | |
| | | import com.ruoyi.iot.util.VelocityInitializer; |
| | | import com.ruoyi.iot.util.VelocityUtils; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.taosdata.jdbc.utils.OSUtils; |
| | | import io.jsonwebtoken.Claims; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 授权 |
| | | * |
| | | * @param clientid |
| | | * @param username |
| | | * @param password |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @ApiOperation("mqtt认证") |
| | | @PostMapping("/mqtt/auth") |
| | | public ResponseEntity mqttAuth(@RequestParam String clientid, @RequestParam String username, @RequestParam String password) throws Exception { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * emqx发给后台消息处理方法 |
| | | * |
| | | * @param model |
| | | */ |
| | | @ApiOperation("mqtt钩子处理") |
| | | @PostMapping("/mqtt/webhook") |
| | | public void webHookProcess(@RequestBody MqttClientConnectModel model) { |
| | |
| | | String deviceNumber = clientArray[1]; |
| | | Long productId = Long.valueOf(clientArray[2]); |
| | | Long userId = Long.valueOf(clientArray[3]); |
| | | |
| | | Device device = deviceService.selectShortDeviceBySerialNumber(deviceNumber); |
| | | // 设备状态(1-未激活,2-禁用,3-在线,4-离线) |
| | | if (model.getAction().equals("client_disconnected")) { |