|
|
package com.monitor.other.degrade.service.impl;
|
|
|
|
|
|
import com.monitor.cmdb.service.IZkMoitorService;
|
|
|
import com.monitor.other.degrade.model.DegradeConfig;
|
|
|
import com.monitor.other.degrade.model.DegradeReq;
|
|
|
import com.monitor.other.degrade.service.DegradeService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by zhaoqi on 2016/8/26 0026.
|
|
|
*/
|
|
|
@Service
|
|
|
public class DegradeServiceImpl implements DegradeService {
|
|
|
|
|
|
@Resource
|
|
|
private IZkMoitorService zkMoitorService;
|
|
|
|
|
|
@Override
|
|
|
public List<DegradeConfig> getDegradeConfigList(DegradeReq req) {
|
|
|
// 从zk中获取降级开关信息
|
|
|
List<DegradeConfig> configListZk= getFromZk(req);
|
|
|
// 从数据库中获取附加信息
|
|
|
List<DegradeConfig> configListDb= getFromDatabase(req);
|
|
|
|
|
|
return mergeDegradeConfig(configListZk,configListDb);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 合并zk和数据库的结果
|
|
|
* @param configListZk
|
|
|
* @param configListDb
|
|
|
* @return
|
|
|
*/
|
|
|
private List<DegradeConfig> mergeDegradeConfig(List<DegradeConfig> configListZk, List<DegradeConfig> configListDb) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
private List<DegradeConfig> getFromDatabase(DegradeReq req) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
private List<DegradeConfig> getFromZk(DegradeReq req) {
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
} |
...
|
...
|
|