Files
mdm/src/main/java/com/midm/controller/lib/BarcodeController.java
T
rick 10aa1829f5 fix: repair decompiled sources and add exhaustive documentation
- restore generic signatures, scoped variables and missing code from original bytecode
- remove decompiler artifacts and document classes, methods, fields and packages
- restore resources, add Batik/BouncyCastle dependencies and build/runtime docs
2026-11-16 17:28:23 +08:00

43 lines
1.6 KiB
Java
Raw 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.midm.controller.lib;
import com.mitac.cell.barcode.QrCode;
import com.mitac.cell.io.McResource;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 【Web 控制器】{@code BarcodeController}
*
* 类职责:
* <ul>
* <li>接收 HTTP 请求、做参数绑定/鉴权,并把业务委托给 Service。</li>
* </ul>
*
* 学习提示:先看类上的 @RequestMapping 路径,再沿 public 方法里的 service 调用链阅读。
*/
@Controller
public class BarcodeController {
/**
* 处理qr代码。
*
* 框架注解:{@code @RequestMapping(value = {"/barcode/qr/{code}"}, method = {RequestMethod.GET})}。
*
* @param response HTTP 响应({@code HttpServletResponse})
* @param code 状态码/业务码({@code String})
* @param size 每页数量({@code Integer})
* @param margin 参数 {@code margin}({@code Integer})
* @param encrypt 参数 {@code encrypt}({@code Boolean})
*/
@RequestMapping(
value = {"/barcode/qr/{code}"},
method = {RequestMethod.GET}
)
public void qrCode(HttpServletResponse response, @PathVariable String code, @RequestParam(required = false) Integer size, @RequestParam(required = false) Integer margin, @RequestParam(required = false) Boolean encrypt) {
McResource.copyToResponse(response, QrCode.toImage(code, size, margin));
}
}