6 changed files with 176 additions and 0 deletions
-
17src/main/java/com/qyft/ms/app/common/constant/FrontSendStatus.java
-
7src/main/java/com/qyft/ms/app/common/constant/FrontSendType.java
-
15src/main/java/com/qyft/ms/app/common/emitter/FrontSend.java
-
28src/main/java/com/qyft/ms/app/controller/SelfTestController.java
-
89src/main/java/com/qyft/ms/app/model/vo/SelfTestVO.java
-
20src/main/java/com/qyft/ms/app/service/SelfTestService.java
@ -0,0 +1,17 @@ |
|||
package com.qyft.ms.app.common.constant; |
|||
|
|||
public class FrontSendStatus { |
|||
private FrontSendStatus() { |
|||
} |
|||
|
|||
/** |
|||
* 正常 |
|||
*/ |
|||
public static final String SUCCESS = "success"; |
|||
/** |
|||
* 错误 |
|||
*/ |
|||
public static final String ERROR = "error"; |
|||
|
|||
|
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.qyft.ms.app.common.constant; |
|||
|
|||
public class FrontSendType { |
|||
private FrontSendType() {} |
|||
|
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.qyft.ms.app.common.emitter; |
|||
|
|||
import cn.hutool.json.JSONObject; |
|||
|
|||
public class FrontSend { |
|||
|
|||
public static String buildResponse(String type, String status, Object data) { |
|||
JSONObject jsonObject = new JSONObject(); |
|||
jsonObject.set("type", type); |
|||
jsonObject.set("status", status); |
|||
jsonObject.set("data", data); |
|||
return jsonObject.toString(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.qyft.ms.app.controller; |
|||
|
|||
import com.qyft.ms.app.model.vo.SelfTestVO; |
|||
import com.qyft.ms.app.service.SelfTestService; |
|||
import com.qyft.ms.system.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.GetMapping; |
|||
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 SelfTestService selfTestService; |
|||
|
|||
@Operation(summary = "开始自检") |
|||
@GetMapping("/") |
|||
public Result<SelfTestVO> startTest() { |
|||
return Result.success(selfTestService.startTest()); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,89 @@ |
|||
package com.qyft.ms.app.model.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 自检结果 BO,用于存储各项设备的自检状态 |
|||
*/ |
|||
@Data |
|||
public class SelfTestVO { |
|||
|
|||
/** |
|||
* X 轴是否正常 |
|||
*/ |
|||
@Schema(description = "X 轴是否正常") |
|||
private boolean xAxisNormal; |
|||
|
|||
/** |
|||
* Y 轴是否正常 |
|||
*/ |
|||
@Schema(description = "Y 轴是否正常") |
|||
private boolean yAxisNormal; |
|||
|
|||
/** |
|||
* Z 轴是否正常 |
|||
*/ |
|||
@Schema(description = "Z 轴是否正常") |
|||
private boolean zAxisNormal; |
|||
|
|||
/** |
|||
* 注射泵是否正常 |
|||
*/ |
|||
@Schema(description = "注射泵是否正常") |
|||
private boolean syringePumpNormal; |
|||
|
|||
/** |
|||
* 三通阀是否正常 |
|||
*/ |
|||
@Schema(description = "三通阀是否正常") |
|||
private boolean threeWayValveNormal; |
|||
|
|||
/** |
|||
* 清洗阀是否正常 |
|||
*/ |
|||
@Schema(description = "清洗阀是否正常") |
|||
private boolean washValveNormal; |
|||
|
|||
/** |
|||
* 喷嘴阀是否正常 |
|||
*/ |
|||
@Schema(description = "喷嘴阀是否正常") |
|||
private boolean nozzleValveNormal; |
|||
|
|||
/** |
|||
* 除湿阀是否正常 |
|||
*/ |
|||
@Schema(description = "除湿阀是否正常") |
|||
private boolean dehumidifierValveNormal; |
|||
|
|||
/** |
|||
* 照明灯是否正常 |
|||
*/ |
|||
@Schema(description = "照明灯是否正常") |
|||
private boolean lightingPanelNormal; |
|||
|
|||
/** |
|||
* 电压控制器是否正常 |
|||
*/ |
|||
@Schema(description = "电压控制器是否正常") |
|||
private boolean highVoltageNormal; |
|||
|
|||
/** |
|||
* X 轴是否在原点 |
|||
*/ |
|||
@Schema(description = "X 轴是否在原点") |
|||
private boolean xAxisAtOrigin; |
|||
|
|||
/** |
|||
* Y 轴是否在原点 |
|||
*/ |
|||
@Schema(description = "Y 轴是否在原点") |
|||
private boolean yAxisAtOrigin; |
|||
|
|||
/** |
|||
* Z 轴是否在原点 |
|||
*/ |
|||
@Schema(description = "Z 轴是否在原点") |
|||
private boolean zAxisAtOrigin; |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.qyft.ms.app.service; |
|||
|
|||
import com.qyft.ms.app.model.vo.SelfTestVO; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class SelfTestService { |
|||
|
|||
/** |
|||
* 开始自检 |
|||
*/ |
|||
public SelfTestVO startTest() { |
|||
SelfTestVO selfTestBO = new SelfTestVO(); |
|||
return selfTestBO; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue