package com.ruoyi.system.config;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 百度OCR服务配置类
|
* 用于管理百度AI开放平台OCR服务的相关配置
|
*/
|
@Component
|
@ConfigurationProperties(prefix = "baidu.ocr")
|
public class BaiduOCRConfig {
|
|
/**
|
* App ID
|
*/
|
private String appId;
|
|
/**
|
* API Key
|
*/
|
private String apiKey;
|
|
/**
|
* Secret Key
|
*/
|
private String secretKey;
|
|
// Getter 和 Setter 方法
|
public String getAppId() {
|
return appId;
|
}
|
|
public void setAppId(String appId) {
|
this.appId = appId;
|
}
|
|
public String getApiKey() {
|
return apiKey;
|
}
|
|
public void setApiKey(String apiKey) {
|
this.apiKey = apiKey;
|
}
|
|
public String getSecretKey() {
|
return secretKey;
|
}
|
|
public void setSecretKey(String secretKey) {
|
this.secretKey = secretKey;
|
}
|
|
/**
|
* 验证配置是否完整
|
* @return 配置是否完整
|
*/
|
public boolean isValid() {
|
return appId != null && !appId.trim().isEmpty() &&
|
apiKey != null && !apiKey.trim().isEmpty() &&
|
secretKey != null && !secretKey.trim().isEmpty();
|
}
|
|
@Override
|
public String toString() {
|
return "BaiduOCRConfig{" +
|
"appId='" + (appId != null ? "***" : "null") + '\'' +
|
", apiKey='" + (apiKey != null ? "***" : "null") + '\'' +
|
", secretKey='" + (secretKey != null ? "***" : "null") + '\'' +
|
'}';
|
}
|
}
|