|
@ -2,11 +2,11 @@ package a8k.app.controler.api.v1.app.ctrl; |
|
|
|
|
|
|
|
|
import a8k.app.service.lowerctrl.DeviceMoveToZeroCtrlService; |
|
|
import a8k.app.service.lowerctrl.DeviceMoveToZeroCtrlService; |
|
|
import a8k.app.service.mainctrl.DeviceInitService; |
|
|
import a8k.app.service.mainctrl.DeviceInitService; |
|
|
import a8k.app.type.ui.ApiRet; |
|
|
|
|
|
|
|
|
import a8k.app.service.statemgr.GStateMgrService; |
|
|
import a8k.app.type.exception.AppException; |
|
|
import a8k.app.type.exception.AppException; |
|
|
|
|
|
import a8k.app.type.ui.ApiRet; |
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
import jakarta.annotation.Resource; |
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.stereotype.Controller; |
|
|
import org.springframework.stereotype.Controller; |
|
@ -21,19 +21,27 @@ import org.springframework.web.bind.annotation.ResponseBody; |
|
|
@ResponseBody |
|
|
@ResponseBody |
|
|
@RequiredArgsConstructor |
|
|
@RequiredArgsConstructor |
|
|
public class DeviceInitControler { |
|
|
public class DeviceInitControler { |
|
|
private final DeviceInitService deviceInitService; |
|
|
|
|
|
|
|
|
private final DeviceInitService deviceInitService; |
|
|
|
|
|
private final GStateMgrService gStateMgrService; |
|
|
|
|
|
|
|
|
|
|
|
@Operation(description = "初始化设备") |
|
|
|
|
|
@PostMapping("/initDevice") |
|
|
|
|
|
public ApiRet<?> initDevice() throws AppException { |
|
|
|
|
|
deviceInitService.initDeviceAsync(); |
|
|
|
|
|
return ApiRet.success(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(description = "初始化设备") |
|
|
|
|
|
@PostMapping("/initDevice") |
|
|
|
|
|
public ApiRet<?> initDevice() throws AppException { |
|
|
|
|
|
deviceInitService.initDeviceAsync(); |
|
|
|
|
|
return ApiRet.success(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Operation(description = "获取设备初始化状态") |
|
|
|
|
|
@PostMapping("/getDeviceInitedTaskState") |
|
|
|
|
|
public ApiRet<DeviceMoveToZeroCtrlService.State> getDeviceInitedTaskState() { |
|
|
|
|
|
return ApiRet.success(deviceInitService.getDeviceInitedTaskState()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Operation(description = "获取设备是否完成启动") |
|
|
|
|
|
@PostMapping("/isBoardParamInited") |
|
|
|
|
|
public ApiRet<Boolean> isBoardParamInited() { |
|
|
|
|
|
return ApiRet.success(gStateMgrService.getBoardParamInited()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Operation(description = "获取设备初始化状态") |
|
|
|
|
|
@PostMapping("/getDeviceInitedTaskState") |
|
|
|
|
|
public ApiRet<DeviceMoveToZeroCtrlService.State> getDeviceInitedTaskState() { |
|
|
|
|
|
return ApiRet.success(deviceInitService.getDeviceInitedTaskState()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |