增加DNS阻断无策略检验.
This commit is contained in:
@@ -180,6 +180,22 @@ public class DnsIpCfgController extends BaseController {
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* DNS阻断无策略时检验
|
||||
* @param entity
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/dnsNoStrategyCheck"})
|
||||
public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response){
|
||||
List<DnsIpCfg> list = dnsIpCfgService.getValidCfgInfo(entity);
|
||||
if(list.size() > 0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//dnsIp配置导出
|
||||
@RequestMapping(value = "exportDnsIp")
|
||||
|
||||
@@ -13,4 +13,5 @@ public interface DnsIpCfgDao extends CrudDao<DnsIpCfg> {
|
||||
List<DnsIpCfg> findPage(DnsIpCfg dnsIpCfg);
|
||||
DnsIpCfg getDnsIpCfg(Long cfgId);
|
||||
List<DnsIpCfg> findDnsIpCfg(DnsIpCfg entity);
|
||||
List<DnsIpCfg> getValidCfgInfo(DnsIpCfg cfg);
|
||||
}
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getValidCfgInfo" resultMap="dnsIpCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
dns_ip_cfg r
|
||||
WHERE r.dns_strategy_id = #{dnsStrategyId} AND r.is_valid = 1 AND r.is_audit = 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.nis.domain.configuration.DnsIpCfg" >
|
||||
insert into dns_ip_cfg (
|
||||
CFG_DESC,
|
||||
|
||||
@@ -54,6 +54,10 @@ public class DnsIpCfgService extends BaseService{
|
||||
public DnsIpCfg getDnsIpCfg(Long cfgId) {
|
||||
return dnsIpCfgDao.getDnsIpCfg(cfgId);
|
||||
}
|
||||
public List<DnsIpCfg> getValidCfgInfo(DnsIpCfg cfg) {
|
||||
return dnsIpCfgDao.getValidCfgInfo(cfg);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(DnsIpCfg entity){
|
||||
Date createTime=new Date();
|
||||
|
||||
Reference in New Issue
Block a user