|
@@ -1,7 +1,9 @@
|
|
|
package com.fdkankan.ucenter.controller;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
|
import com.fdkankan.ucenter.common.BaseController;
|
|
@@ -78,9 +80,9 @@ public class CameraController extends BaseController {
|
|
|
*用户绑定设备
|
|
|
*/
|
|
|
@PostMapping("/add")
|
|
|
- public Result add(@RequestBody JSONObject jsonObject,@RequestHeader String token){
|
|
|
+ public Result add(@RequestBody JSONObject jsonObject,@RequestHeader String token) throws Exception {
|
|
|
String username = JwtUtil.getUsername(token);
|
|
|
- List<String> existCodes = cameraService.bind(jsonObject.getInteger("cameraType"),jsonObject.getString("snCode"),username);
|
|
|
+ List<String> existCodes = cameraService.bind(jsonObject.getInteger("cameraType"),jsonObject.getString("snCode"),username, jsonObject.getString("key"));
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("errorSnCode",existCodes);
|
|
|
return Result.success(object);
|