sige 2 years ago
parent
commit
0c1c76bb30
  1. 6
      src/main/java/com/dreamworks/boditech/controller/DeviceController.java

6
src/main/java/com/dreamworks/boditech/controller/DeviceController.java

@ -8,6 +8,7 @@ import com.dreamworks.boditech.driver.actuator.ActuatorModule;
import com.dreamworks.boditech.driver.entity.*; import com.dreamworks.boditech.driver.entity.*;
import com.dreamworks.boditech.driver.task.Task; import com.dreamworks.boditech.driver.task.Task;
import com.dreamworks.boditech.service.DeviceService; import com.dreamworks.boditech.service.DeviceService;
import com.dreamworks.boditech.utils.MyCommon;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -171,7 +172,7 @@ public class DeviceController extends BaseController {
private Integer initCount = 3;
private Integer initCount = 2;
@ResponseBody @ResponseBody
@PostMapping("/api/device/init") @PostMapping("/api/device/init")
public ApiResponse init() { public ApiResponse init() {
@ -180,6 +181,7 @@ public class DeviceController extends BaseController {
return this.success(); return this.success();
} }
MyCommon.easySleep(1000);
if ( initCount > 0 ) { if ( initCount > 0 ) {
this.initCount --; this.initCount --;
ApiResponse response = new ApiResponse(); ApiResponse response = new ApiResponse();
@ -193,7 +195,7 @@ public class DeviceController extends BaseController {
); );
return response; return response;
} else { } else {
this.initCount = 3;
this.initCount = 2;
return this.success(); return this.success();
} }
} }

Loading…
Cancel
Save