Files
wangmingwei f0453ff3a3 初始代码
2026-04-21 16:49:46 +08:00

52 lines
1.4 KiB
Java
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.yunzhupaas.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunzhupaas.util.DownUtil;
import com.yunzhupaas.util.ServletUtil;
import com.yunzhupaas.util.ZxingCodeUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.awt.image.BufferedImage;
/**
* 生成条码
*
* @author 云筑产品开发平台组
* @version V3.1.0
* @copyright 深圳市乐程软件有限公司http://www.szlecheng.cn
* @date 2024-09-26 上午9:18
*/
@RestController
@Tag(name = "(待定)生成条码", description = "BarCode")
@RequestMapping("/api/extend/BarCode")
public class BarCodeController {
/**
* 生成二维码
*
* @return
*/
@Operation(summary = "生成二维码")
@GetMapping("/BuildQRCode")
public void buildQrCode() {
BufferedImage image = ZxingCodeUtil.createCode(ServletUtil.getHeader("F_QRCodeContent"), 400, 400);
DownUtil.write(image);
}
/**
* 生成条形码
*
* @return
*/
@Operation(summary = "生成条形码")
@GetMapping("/BuildBarCode")
public void buildBarCode() {
BufferedImage image = ZxingCodeUtil.getBarcode(ServletUtil.getHeader("F_BarCodeContent"), 265, 50);
DownUtil.write(image);
}
}