You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
1 year ago
|
package com.ynxbd.wx.pwe;
|
||
|
|
||
|
import com.ynxbd.common.helper.ProperHelper;
|
||
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
||
|
@Slf4j
|
||
|
public class PWEConfig {
|
||
|
|
||
|
public static final String PARTNER_ID;
|
||
|
public static final String PARTNER_SECRET; // 合作方密钥
|
||
|
public static final String HOSPITAL_ID; // 医院ID
|
||
|
public static final String SECRET_KEY; // 私钥
|
||
|
//
|
||
|
public static final boolean IS_DEV;
|
||
|
|
||
|
static {
|
||
|
ProperHelper config = new ProperHelper().read("pwe.properties");
|
||
|
|
||
|
boolean isEnable = config.getBoolean("pwe.is_enable", false);
|
||
|
if (isEnable) {
|
||
|
IS_DEV = config.getBoolean("pwe.is_dev", false);
|
||
|
|
||
|
HOSPITAL_ID = config.getString("pwe.hospital_id");
|
||
|
PARTNER_ID = config.getString("pwe.partner_id");
|
||
|
PARTNER_SECRET = config.getString(IS_DEV ? "pwe.dev.partner_secret" : "pwe.partner_secret");
|
||
|
SECRET_KEY = config.getString(IS_DEV ? "pwe.dev.secret_key" : "pwe.secret_key");
|
||
|
} else {
|
||
|
IS_DEV = false;
|
||
|
HOSPITAL_ID = null;
|
||
|
PARTNER_ID = null;
|
||
|
PARTNER_SECRET = null;
|
||
|
SECRET_KEY = null;
|
||
|
}
|
||
|
if (PARTNER_ID == null || PARTNER_SECRET == null) {
|
||
|
log.error("[预问诊]读取配置文件pwe.properties失败");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|