feat:增加挂号打印模块
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.dpkj.modules.print.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dpkj.common.dto.LexMarkResultDTO;
|
||||
import com.dpkj.common.vo.Result;
|
||||
import com.dpkj.modules.print.service.PrintService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 挂号controller
|
||||
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
|
||||
* @since 2025-02-08 11:49:46
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/print")
|
||||
public class RegisterController {
|
||||
|
||||
@Resource(name = "registerService")
|
||||
private PrintService printService;
|
||||
|
||||
/**
|
||||
* 挂号
|
||||
*/
|
||||
@GetMapping("/register/{templateName}")
|
||||
public Result<LexMarkResultDTO> register(@RequestParam String jsonData,
|
||||
@PathVariable String templateName,
|
||||
@RequestParam(defaultValue = "600") Integer width,
|
||||
@RequestParam(defaultValue = "950") Integer height
|
||||
){
|
||||
return Result.ok((LexMarkResultDTO)printService.printImage(JSONObject.parseObject(jsonData), templateName, width, height));
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂号,通过文件路径
|
||||
*/
|
||||
@GetMapping("/register")
|
||||
public Result<LexMarkResultDTO> registerByFilePath(@RequestParam(defaultValue = "D:\\images") String filePath){
|
||||
return Result.ok((LexMarkResultDTO)printService.printImage(null, null, 0, 0, filePath));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user