feat:增加小票打印机接口以及获取状态接口

This commit is contained in:
2025-03-17 10:28:17 +08:00
parent d3d908a407
commit 46097c0825
11 changed files with 173 additions and 38 deletions

View File

@@ -28,8 +28,8 @@ public class TemplateController {
@RequestParam Integer height,
@PathVariable String templateName,
@RequestParam(defaultValue = "E:\\images") String saveDir) {
StringBuilder fileDir = new StringBuilder(saveDir);
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), templateName, width, height, fileDir);
StringBuilder filePath = new StringBuilder();
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), templateName, width, height, filePath);
return Result.ok("模板生成成功");
}
@@ -45,8 +45,8 @@ public class TemplateController {
"<h2><span th:text='${name}'> </span></h2>\n" +
"</body>\n" +
"</html>";
StringBuilder fileDir = new StringBuilder(saveDir);
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), html, width, height, fileDir);
StringBuilder filePath = new StringBuilder();
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), html, width, height, filePath);
return Result.ok("模板生成成功");
}