feat:增加测试打印接口

This commit is contained in:
2025-01-15 17:35:27 +08:00
parent 8fb13e026b
commit aa46f4c66f
3 changed files with 52 additions and 14 deletions

View File

@@ -21,17 +21,18 @@ public class AutoReplyPrintController {
/**
* 获取打印机固件版本
* @return
*/
@GetMapping("CPPrinterGetPrinterFirmwareVersion")
public Result<?> CPPrinterGetPrinterFirmwareVersion() {
try {
return autoReplyPrintService.CPPrinterGetPrinterFirmwareVersion();
} catch (Exception e) {
e.printStackTrace();
log.info("获取打印机固件版本失败 {}", e.getMessage());
return Result.error("获取打印机固件版本失败");
}
public Result<?> CPPrinterGetPrinterFirmwareVersion(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String USBName) {
return autoReplyPrintService.CPPrinterGetPrinterFirmwareVersion(USBName);
}
/**
* 测试打印
*/
@GetMapping("/testWrite")
private Result<?> testWrite(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String USBName){
return this.autoReplyPrintService.testWrite(USBName);
}
}