|
|
@ -0,0 +1,40 @@ |
|
|
|
package com.iflytop.colortitration.app.controller; |
|
|
|
|
|
|
|
import com.iflytop.colortitration.app.core.state.DeviceState; |
|
|
|
import com.iflytop.colortitration.common.result.Result; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
@Tag(name = "自检") |
|
|
|
@RestController |
|
|
|
@RequestMapping("/api/self-test") |
|
|
|
@RequiredArgsConstructor |
|
|
|
@Slf4j |
|
|
|
public class SelfTestController { |
|
|
|
private final DeviceState deviceState; |
|
|
|
|
|
|
|
// @Operation(summary = "获取自检状态") |
|
|
|
// @GetMapping("/status") |
|
|
|
// public Result<SelfTestState> getSelfTestStatus() { |
|
|
|
// return Result.success(selfTestService.getSelfTestState()); |
|
|
|
// } |
|
|
|
|
|
|
|
@Operation(summary = "自检完毕") |
|
|
|
@PostMapping("/finish") |
|
|
|
public Result<?> selfTestFinish() throws Exception { |
|
|
|
deviceState.setSelfTest(true); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "改变自检状态") |
|
|
|
@PostMapping("/isFinish") |
|
|
|
public Result<?> selfTestFinish(boolean isFinish) { |
|
|
|
deviceState.setSelfTest(isFinish); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
} |