|
|
@@ -14,6 +14,7 @@ import com.coffee.bus.exception.ErrorStatus;
|
|
|
import com.coffee.bus.service.LocalBusDeviceService;
|
|
|
import com.coffee.bus.service.dto.DeviceQuery;
|
|
|
import com.coffee.bus.service.dto.DeviceResult;
|
|
|
+import com.coffee.common.annotation.Log;
|
|
|
import com.coffee.common.crud.BaseService;
|
|
|
import com.coffee.common.crud.controller.BaseCrudController;
|
|
|
import com.coffee.common.exception.CustomException;
|
|
|
@@ -43,6 +44,8 @@ import java.util.List;
|
|
|
@Api(tags = "设备管理",description = "统一权限前缀(device:info),device:info:add")
|
|
|
public class BusDeviceController extends BaseCrudController<BusDeviceEntity, String> {
|
|
|
private final LocalBusDeviceService deviceService;
|
|
|
+
|
|
|
+ @Log(title = "设备换绑")
|
|
|
@PostMapping("/shift/bind")
|
|
|
@ApiOperation(value = "设备换绑",notes = "权限【device:info:shift】")
|
|
|
public R shift(@RequestBody DeviceBindVo vo){
|
|
|
@@ -103,6 +106,7 @@ public class BusDeviceController extends BaseCrudController<BusDeviceEntity, Str
|
|
|
* 从阿里云同步系统所有的设备,只有超级管理员才有此权限。将阿里云所有的设备同步到系统。
|
|
|
* @return
|
|
|
*/
|
|
|
+ @Log(title = "从阿里云同步设备")
|
|
|
@ApiOperation(value = "从阿里云同步设备",notes = "从阿里云平台获取设备并更新,权限【device:info:poll】")
|
|
|
@SaCheckPermission("device:info:poll")
|
|
|
@PutMapping("/sync-device")
|
|
|
@@ -118,27 +122,30 @@ public class BusDeviceController extends BaseCrudController<BusDeviceEntity, Str
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * @author 龙三郎
|
|
|
- * 从阿里云同步系统所有的设备,只有超级管理员才有此权限。将阿里云所有的设备同步到系统。
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "从阿里云同步设备1",notes = "从阿里云平台获取设备并更新,权限【device:info:poll】")
|
|
|
- @SaCheckPermission("device:info:poll")
|
|
|
- @PutMapping("/sync-device1")
|
|
|
- public R syncDevice1() {
|
|
|
- int i = deviceService.syncAllDevice();
|
|
|
- if (i > 0){
|
|
|
- return R.success(i,"同步成功");
|
|
|
- }else {
|
|
|
- return R.fail("同步失败");
|
|
|
- }
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * @author 龙三郎
|
|
|
+// * 从阿里云同步系统所有的设备,只有超级管理员才有此权限。将阿里云所有的设备同步到系统。
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "从阿里云同步设备1",notes = "从阿里云平台获取设备并更新,权限【device:info:poll】")
|
|
|
+// @SaCheckPermission("device:info:poll")
|
|
|
+// @PutMapping("/sync-device1")
|
|
|
+// public R syncDevice1() {
|
|
|
+// int i = deviceService.syncAllDevice();
|
|
|
+// if (i > 0){
|
|
|
+// return R.success(i,"同步成功");
|
|
|
+// }else {
|
|
|
+// return R.fail("同步失败");
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* @author 龙三郎
|
|
|
* 从阿里云更新系统中存在的设备,如果设备在系统中不存在,则不更新。
|
|
|
* @return
|
|
|
*/
|
|
|
+ @Log(title = "从阿里云更新本地设备")
|
|
|
+
|
|
|
@SaCheckPermission("device:info:poll")
|
|
|
@ApiOperation(value = "从阿里云更新本地设备",notes = "从阿里云平台获取设备并更新,参数为设备id列表,格式如['123456','456123'],参数可为空。权限【device:info:poll】")
|
|
|
@PutMapping("/sync-device/batch")
|