2025-02-08 15:41:29 +08:00
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 挂号
|
|
|
|
*/
|
2025-02-18 15:24:46 +08:00
|
|
|
@PostMapping("/register/{templateName}")
|
2025-02-08 15:41:29 +08:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 挂号,通过文件路径
|
|
|
|
*/
|
2025-02-18 15:24:46 +08:00
|
|
|
@PostMapping("/register")
|
2025-02-08 15:41:29 +08:00
|
|
|
public Result<LexMarkResultDTO> registerByFilePath(@RequestParam(defaultValue = "D:\\images") String filePath){
|
|
|
|
return Result.ok((LexMarkResultDTO)printService.printImage(null, null, 0, 0, filePath));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|