调整请求方式

This commit is contained in:
王志成 2025-02-18 15:26:28 +08:00
parent f36e6703a3
commit 62e47e55be
4 changed files with 13 additions and 18 deletions

View File

@ -4,10 +4,7 @@ import com.dpkj.common.vo.Result;
import com.dpkj.modules.autoReplyPrint.service.AutoReplyPrintService; import com.dpkj.modules.autoReplyPrint.service.AutoReplyPrintService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 壁挂打印机 * 壁挂打印机
@ -22,7 +19,7 @@ public class AutoReplyPrintController {
/** /**
* 获取打印机固件版本 * 获取打印机固件版本
*/ */
@GetMapping("CPPrinterGetPrinterFirmwareVersion") @PostMapping("CPPrinterGetPrinterFirmwareVersion")
public Result<?> CPPrinterGetPrinterFirmwareVersion(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String USBName) { public Result<?> CPPrinterGetPrinterFirmwareVersion(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String USBName) {
return autoReplyPrintService.CPPrinterGetPrinterFirmwareVersion(USBName); return autoReplyPrintService.CPPrinterGetPrinterFirmwareVersion(USBName);
} }
@ -30,7 +27,7 @@ public class AutoReplyPrintController {
/** /**
* 测试打印 * 测试打印
*/ */
@GetMapping("/testWrite") @PostMapping("/testWrite")
private Result<?> testWrite(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String USBName){ private Result<?> testWrite(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String USBName){
return this.autoReplyPrintService.testWrite(USBName); return this.autoReplyPrintService.testWrite(USBName);
} }

View File

@ -3,6 +3,7 @@ package com.dpkj.modules.autoReplyPrint.controller;
import com.dpkj.common.vo.Result; import com.dpkj.common.vo.Result;
import com.dpkj.modules.autoReplyPrint.service.ImagePrintService; import com.dpkj.modules.autoReplyPrint.service.ImagePrintService;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -25,7 +26,7 @@ public class ImagePrintController {
/** /**
* 图片打印通过路径 * 图片打印通过路径
*/ */
@GetMapping("/usb/imagePrint/path") @PostMapping("/usb/imagePrint/path")
Result<Void> usbImagePrintFromPath(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName, Result<Void> usbImagePrintFromPath(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName,
@RequestParam(defaultValue = "500") Integer width, @RequestParam(defaultValue = "500") Integer width,
@RequestParam(defaultValue = "500") Integer height, @RequestParam(defaultValue = "500") Integer height,
@ -38,7 +39,7 @@ public class ImagePrintController {
/** /**
* 图片打印通过byte[] * 图片打印通过byte[]
*/ */
@GetMapping("/usb/imagePrint/pathData") @PostMapping("/usb/imagePrint/pathData")
Result<Void> usbImagePrintFromData(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName, Result<Void> usbImagePrintFromData(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName,
@RequestParam(defaultValue = "500") Integer width, @RequestParam(defaultValue = "500") Integer width,
@RequestParam(defaultValue = "500") Integer height, @RequestParam(defaultValue = "500") Integer height,
@ -51,7 +52,7 @@ public class ImagePrintController {
/** /**
* 图片打印通过multipartFile文件 * 图片打印通过multipartFile文件
*/ */
@GetMapping("/usb/imagePrint/multipartFile") @PostMapping("/usb/imagePrint/multipartFile")
Result<Void> usbImagePrintFromData(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName, Result<Void> usbImagePrintFromData(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName,
@RequestParam(defaultValue = "500") Integer width, @RequestParam(defaultValue = "500") Integer width,
@RequestParam(defaultValue = "500") Integer height, @RequestParam(defaultValue = "500") Integer height,
@ -64,7 +65,7 @@ public class ImagePrintController {
/** /**
* 图片打印通过byte[] * 图片打印通过byte[]
*/ */
@GetMapping("/usb/imagePrint/data") @PostMapping("/usb/imagePrint/data")
Result<Void> usbImagePrintFromData(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName, Result<Void> usbImagePrintFromData(@RequestParam(defaultValue = "VID:0x0FE6,PID:0x811E") String usbName,
@RequestParam(defaultValue = "500") Integer width, @RequestParam(defaultValue = "500") Integer width,
@RequestParam(defaultValue = "500") Integer height, @RequestParam(defaultValue = "500") Integer height,

View File

@ -22,7 +22,7 @@ public class TemplateController {
private TemplateService templateService; private TemplateService templateService;
@GetMapping("/template/{templateName}") @PostMapping("/template/{templateName}")
public Result<String> testTemplate(@RequestParam String jsonData, public Result<String> testTemplate(@RequestParam String jsonData,
@RequestParam Integer width, @RequestParam Integer width,
@RequestParam Integer height, @RequestParam Integer height,
@ -32,7 +32,7 @@ public class TemplateController {
return Result.ok("模板生成成功"); return Result.ok("模板生成成功");
} }
@GetMapping("/template") @PostMapping("/template")
public Result<String> testTemplate(@RequestParam String jsonData, public Result<String> testTemplate(@RequestParam String jsonData,
@RequestParam Integer width, @RequestParam Integer width,
@RequestParam Integer height, @RequestParam(defaultValue = "E:\\images") String saveDir) { @RequestParam Integer height, @RequestParam(defaultValue = "E:\\images") String saveDir) {

View File

@ -4,10 +4,7 @@ import com.dpkj.common.vo.Result;
import com.dpkj.modules.cardReader.service.CardReaderService; import com.dpkj.modules.cardReader.service.CardReaderService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 多合一读卡器 * 多合一读卡器
@ -23,7 +20,7 @@ public class CardReaderController {
* 连接设备并读取身份证信息 * 连接设备并读取身份证信息
* @return * @return
*/ */
@GetMapping("IDCardReader") @PostMapping("IDCardReader")
public Result IDCardReader() { public Result IDCardReader() {
try { try {
return cardReaderService.IDCardReader(); return cardReaderService.IDCardReader();
@ -39,7 +36,7 @@ public class CardReaderController {
* 连接设备并读取社保卡信息 * 连接设备并读取社保卡信息
* @return * @return
*/ */
@GetMapping("SocialSecurityCardReader") @PostMapping("SocialSecurityCardReader")
public Result<?> SocialSecurityCardReader() { public Result<?> SocialSecurityCardReader() {
try { try {
return cardReaderService.SocialSecurityCardReader(); return cardReaderService.SocialSecurityCardReader();