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;
|
}
|
}
|