|
|
|
@ -1,10 +1,17 @@
|
|
|
|
|
package ${basePackage}.module.system.mgr;
|
|
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import ${basePackage}.frame.auth.LocalData;
|
|
|
|
|
import ${basePackage}.frame.auth.Token;
|
|
|
|
|
import ${basePackage}.frame.base.ErrorType;
|
|
|
|
|
import ${basePackage}.frame.utils.IDgenerator;
|
|
|
|
|
import ${basePackage}.frame.utils.MapperUtil;
|
|
|
|
|
import ${basePackage}.frame.utils.Message;
|
|
|
|
|
import ${basePackage}.frame.utils.StringUtil;
|
|
|
|
|
import ${basePackage}.frame.utils.ValidationUtil;
|
|
|
|
|
import ${basePackage}.module.system.ent.Profiles;
|
|
|
|
|
import ${basePackage}.module.system.mpr.ProfilesMapper;
|
|
|
|
@ -18,12 +25,7 @@ import ${basePackage}.module.system.rsp.ProfilesDeleteResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ProfilesFindResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ProfilesGetResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ProfilesUpdateResponse;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* PROFILES - 系统配置
|
|
|
|
@ -188,4 +190,64 @@ public class ProfilesManagerImpl implements ProfilesManager {
|
|
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获得当前环境配置
|
|
|
|
|
*
|
|
|
|
|
* @param key 键
|
|
|
|
|
* @param defaultValue 默认值
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public String getString(String key, String defaultValue) {
|
|
|
|
|
ProfilesFindRequest profilesFindRequest = new ProfilesFindRequest();
|
|
|
|
|
profilesFindRequest.setActive(LocalData.getActive());
|
|
|
|
|
profilesFindRequest.setKey(key);
|
|
|
|
|
ProfilesFindResponse profilesFindResponse = this.find(profilesFindRequest, LocalData.getSysToken());
|
|
|
|
|
if (profilesFindResponse.hasError() || profilesFindResponse.getResult().size() == 0) {
|
|
|
|
|
return defaultValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return profilesFindResponse.getResult().get(0).getValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获得当前环境配置
|
|
|
|
|
*
|
|
|
|
|
* @param key 键
|
|
|
|
|
* @param defaultValue 默认值
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int getInt(String key, int defaultValue) {
|
|
|
|
|
String string = this.getString(key, "");
|
|
|
|
|
if (!StringUtil.isEmpty(string)) {
|
|
|
|
|
try {
|
|
|
|
|
return Integer.parseInt(string);
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return defaultValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获得当前环境配置
|
|
|
|
|
*
|
|
|
|
|
* @param key 键
|
|
|
|
|
* @param defaultValue 默认值
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public long getLong(String key, long defaultValue) {
|
|
|
|
|
String string = this.getString(key, "");
|
|
|
|
|
if (!StringUtil.isEmpty(string)) {
|
|
|
|
|
try {
|
|
|
|
|
return Long.parseLong(string);
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return defaultValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|