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 石头人
* @since 2025-02-08 11:49:46
*/
@RestController
@RequestMapping("/print")
public class RegisterController {
@Resource(name = "registerService")
private PrintService printService;
/**
* 挂号
*/
@GetMapping("/register/{templateName}")
public Result 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 registerByFilePath(@RequestParam(defaultValue = "D:\\images") String filePath){
return Result.ok((LexMarkResultDTO)printService.printImage(null, null, 0, 0, filePath));
}
}