wlzboy
2025-09-27 c1147646b9ef1d713a202d7ab8cf3ea8d677f142
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.ruoyi.system.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
/**
 * 二维码配置
 * 
 * @author ruoyi
 */
@Component
@ConfigurationProperties(prefix = "qrcode")
public class QRCodeConfig {
    /**
     * 默认二维码URL模板
     */
    private String defaultUrl = "http://localhost:8080/evaluation?vehicle={vehicleNo}";
 
    public String getDefaultUrl() {
        return defaultUrl;
    }
 
    public void setDefaultUrl(String defaultUrl) {
        this.defaultUrl = defaultUrl;
    }
    
    /**
     * 根据车牌号生成二维码URL
     * 
     * @param vehicleNo 车牌号
     * @return 二维码URL
     */
    public String generateUrl(String vehicleNo) {
        if (defaultUrl != null && defaultUrl.contains("{vehicleNo}")) {
            return defaultUrl.replace("{vehicleNo}", vehicleNo);
        }
        return defaultUrl + "?vehicle=" + vehicleNo;
    }
}