ars.module.system.service.AbstractConfigService Maven / Gradle / Ivy
package ars.module.system.service;
import java.util.Map;
import java.util.Map.Entry;
import ars.util.Strings;
import ars.invoke.request.Requester;
import ars.module.system.model.Config;
import ars.module.system.service.ConfigService;
import ars.module.system.repository.ConfigRepository;
import ars.database.service.StandardGeneralService;
/**
* 系统配置业务操作抽象实现
*
* @author yongqiangwu
*
* @param
* 数据模型
*/
public abstract class AbstractConfigService extends StandardGeneralService
implements ConfigService {
@Override
public String get(Requester requester, String key, Map parameters) {
return ((ConfigRepository) this.getRepository()).get(key);
}
@Override
public void set(Requester requester, Map parameters) {
ConfigRepository repository = (ConfigRepository) this.getRepository();
for (Entry entry : parameters.entrySet()) {
repository.set(entry.getKey(), Strings.toString(entry.getValue()));
}
}
@Override
public void remove(Requester requester, String[] keys, Map parameters) {
ConfigRepository repository = (ConfigRepository) this.getRepository();
for (String key : keys) {
repository.remove(key);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy