feat:generateReceiptImage接口增加图片自定义保存路径
This commit is contained in:
@@ -23,13 +23,19 @@ public class TemplateController {
|
||||
|
||||
|
||||
@GetMapping("/template/{templateName}")
|
||||
public Result<String> testTemplate(@RequestParam Integer width, @RequestParam Integer height, String jsonData, @PathVariable String templateName) {
|
||||
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), templateName, width, height);
|
||||
public Result<String> testTemplate(@RequestParam String jsonData,
|
||||
@RequestParam Integer width,
|
||||
@RequestParam Integer height,
|
||||
@PathVariable String templateName,
|
||||
@RequestParam(defaultValue = "E:\\images") String saveDir) {
|
||||
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), templateName, width, height, saveDir);
|
||||
return Result.ok("模板生成成功");
|
||||
}
|
||||
|
||||
@GetMapping("/template")
|
||||
public Result<String> testTemplate(String jsonData, @RequestParam Integer width, @RequestParam Integer height) {
|
||||
public Result<String> testTemplate(@RequestParam String jsonData,
|
||||
@RequestParam Integer width,
|
||||
@RequestParam Integer height, @RequestParam(defaultValue = "E:\\images") String saveDir) {
|
||||
String html = "<!DOCTYPE html>\n" +
|
||||
"<html>\n" +
|
||||
"<head><title>Test</title></head>\n" +
|
||||
@@ -38,7 +44,7 @@ public class TemplateController {
|
||||
"<h2><span th:text='${name}'> </span></h2>\n" +
|
||||
"</body>\n" +
|
||||
"</html>";
|
||||
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), html, width, height);
|
||||
this.templateService.generateReceiptImage(JSONObject.parseObject(jsonData), html, width, height, saveDir);
|
||||
return Result.ok("模板生成成功");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user