修改音频色情实际添加视频色情功能
策略管控增加多个url和多个权限标识
This commit is contained in:
@@ -530,6 +530,12 @@ public class MaatCfg implements Serializable {
|
||||
public String getAreaEffectiveIds() {
|
||||
return areaEffectiveIds;
|
||||
}
|
||||
/**
|
||||
* areaEffectiveIds
|
||||
* areaEffectiveIds=7242:5,7212:4,7122:3
|
||||
* 接口要求格式为:72425,72124,71223
|
||||
* @param areaEffectiveIds
|
||||
*/
|
||||
public void setAreaEffectiveIds(String areaEffectiveIds) {
|
||||
if(StringUtils.isEmpty(areaEffectiveIds)){
|
||||
areaEffectiveIds="0";
|
||||
|
||||
@@ -75,6 +75,19 @@ public class AvController extends BaseController {
|
||||
return "/cfg/av/fileSampleList";
|
||||
}
|
||||
//音视频标志样例配置列表
|
||||
@RequestMapping(value = {"/sample/audioSignSampleList"})
|
||||
public String audioSignSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){
|
||||
Page<AvSignSampleCfg> page = avCfgService.getAvSignSampleList(new Page<AvSignSampleCfg>(request, response,"a"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
for(FunctionRegionDict region:regionList){
|
||||
model.addAttribute("regionValue",region.getConfigRegionValue());
|
||||
break;
|
||||
}
|
||||
return "/cfg/av/signSampleList";
|
||||
}
|
||||
//视频标志样例配置列表
|
||||
@RequestMapping(value = {"/sample/signSampleList"})
|
||||
public String signSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){
|
||||
List<AvSignSampleCfg> list = avCfgService.getSignSampleList(entity);
|
||||
@@ -101,8 +114,8 @@ public class AvController extends BaseController {
|
||||
return "/cfg/av/fileSampleForm";
|
||||
}
|
||||
//标志样例配置界面
|
||||
@RequestMapping(value = {"/sample/signSampleForm"})
|
||||
public String signSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){
|
||||
@RequestMapping(value = {"/sample/audioSignSampleForm"})
|
||||
public String audioSignSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
entity = avCfgService.getAvSignSampleById(Long.parseLong(ids));
|
||||
}
|
||||
@@ -167,10 +180,10 @@ public class AvController extends BaseController {
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
//保存标志样例配置
|
||||
@RequestMapping(value = {"/sample/saveSignSample"})
|
||||
public String saveSignSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,String ids,AvSignSampleCfg entity){
|
||||
@RequestMapping(value = {"/sample/saveAudioSignSample"})
|
||||
public String saveAudioSignSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,String ids,AvSignSampleCfg entity){
|
||||
avCfgService.saveOrUpdateAvSignSample(entity);
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+entity.getFunctionId();
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/audioSignSampleList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
//修改文件样例配置状态
|
||||
@RequestMapping(value = {"/sample/updateAvFileSampleValid"})
|
||||
@@ -266,6 +279,37 @@ public class AvController extends BaseController {
|
||||
avCfgService.updateAvSignSampleValid(isAudit,isValid,ids);
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId;
|
||||
}
|
||||
|
||||
//修改标志样例配置审核状态
|
||||
/**
|
||||
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/sample/auditAvAudioSignSample"})
|
||||
public String auditAvAudioSignSample(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes){
|
||||
// avCfgService.auditAvSignSample(isAudit,isValid,ids);
|
||||
AvSignSampleCfg entity = new AvSignSampleCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = avCfgService.getAvSignSampleById(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
try {
|
||||
avCfgService.audioAuditAvSignSample(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("音视频标识样例配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/audioSignSampleList?functionId="+functionId;
|
||||
}
|
||||
//修改标志样例配置审核状态
|
||||
/**
|
||||
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
||||
|
||||
@@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -35,7 +36,7 @@ import com.nis.web.security.UserUtils;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/proxy/control/httpRedirect")
|
||||
public class HttpRedirectPolicyController extends BaseController{
|
||||
@RequestMapping(value = {"list"})
|
||||
@RequestMapping(value = {"httpRedirectList","httpBlockList","httpReplaceList","httpMonitList","httpWhitelistList"})
|
||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg){
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(searchPage, cfg);
|
||||
@@ -44,7 +45,13 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
return "/cfg/proxy/control/httpRedirectList";
|
||||
}
|
||||
@RequestMapping(value = {"form"})
|
||||
@RequiresPermissions(value={"control:httpRedirect:config"})
|
||||
@RequiresPermissions(value={"control:httpBlock:config"
|
||||
,"control:httpRedirect:config"
|
||||
,"control:httpReplace:config"
|
||||
,"control:httpMinit:config"
|
||||
,"control:httpWhitelist:config"
|
||||
}
|
||||
,logical=Logical.OR)
|
||||
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity){
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids));
|
||||
@@ -135,7 +142,12 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"saveOrUpdate"})
|
||||
@RequiresPermissions(value={"control:httpRedirect:config"})
|
||||
@RequiresPermissions(value={"control:httpBlock:config"
|
||||
,"control:httpRedirect:config"
|
||||
,"control:httpReplace:config"
|
||||
,"control:httpMinit:config"
|
||||
,"control:httpWhitelist:config"}
|
||||
,logical=Logical.OR)
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
@@ -147,10 +159,9 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+cfg.getFunctionId();
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"ajaxHttpSubList"})
|
||||
@RequiresPermissions(value={"control:httpRedirect:config"})
|
||||
public String ajaxHttpSubList(Model model,Long cfgId,Integer index) {
|
||||
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
@@ -158,13 +169,23 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
return "/cfg/proxy/control/httpRedirectSubList";
|
||||
}
|
||||
@RequestMapping(value = {"delete"})
|
||||
@RequiresPermissions(value={"control:httpRedirect:config"})
|
||||
@RequiresPermissions(value={"control:httpBlock:config"
|
||||
,"control:httpRedirect:config"
|
||||
,"control:httpReplace:config"
|
||||
,"control:httpMinit:config"
|
||||
,"control:httpWhitelist:config"}
|
||||
,logical=Logical.OR)
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){
|
||||
httpRedirectCfgService.updateHttpCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"audit"})
|
||||
@RequiresPermissions(value={"control:httpRedirect:confirm"})
|
||||
@RequiresPermissions(value={"control:httpBlock:confirm"
|
||||
,"control:httpRedirect:confirm"
|
||||
,"control:httpReplace:confirm"
|
||||
,"control:httpMinit:confirm"
|
||||
,"control:httpWhitelist:confirm"}
|
||||
,logical=Logical.OR)
|
||||
public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
@@ -183,6 +204,6 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +470,12 @@
|
||||
dest_port,
|
||||
dest_ip_address,
|
||||
cfg_type,
|
||||
cfg_region_code
|
||||
cfg_region_code,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
@@ -502,7 +507,12 @@
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER}
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<!-- insert http_req_hdr_cfg表信息 -->
|
||||
|
||||
@@ -229,6 +229,10 @@ public class AvCfgService extends BaseService{
|
||||
entity.setIsAudit(0);
|
||||
avCfgDao.updateAvSignSample(entity);
|
||||
}
|
||||
//添加即时生效
|
||||
entity.setIsValid(1);
|
||||
entity.setIsAudit(1);
|
||||
audioAuditAvSignSample(entity,1);
|
||||
}
|
||||
public void updateAvFileSampleValid(Integer isAudit,Integer isValid,String ids){
|
||||
AvFileSampleCfg entity = new AvFileSampleCfg();
|
||||
@@ -285,6 +289,33 @@ public class AvCfgService extends BaseService{
|
||||
}
|
||||
}
|
||||
|
||||
public void audioAuditAvSignSample(AvSignSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
if(isAudit==1){
|
||||
list.add(entity);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(list);
|
||||
logger.info("文件样例下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||
logger.info("音视频标志样例配置下发响应信息:"+result.getMsg());
|
||||
|
||||
}else if(isAudit==3){
|
||||
AvSignSampleCfg cfg = new AvSignSampleCfg();
|
||||
cfg.setIsValid(0);
|
||||
cfg.setCompileId(entity.getCompileId());
|
||||
cfg.setServiceId(entity.getServiceId());
|
||||
list.add(cfg);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(list);
|
||||
logger.info("标志样例下发配置参数:"+json);
|
||||
//调用服务接口取消配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
logger.info("音视频标志样例配置取消配置响应信息:"+result.getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
public void auditAvSignSample(AvSignSampleCfg entity) throws MaatConvertException{
|
||||
|
||||
avCfgDao.updateAvSignSampleValid(entity);
|
||||
@@ -296,8 +327,8 @@ public class AvCfgService extends BaseService{
|
||||
String json=gsonToJson(list);
|
||||
logger.info("标志状态变更:"+json);
|
||||
//调用服务接口取消配置
|
||||
//ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
//logger.info("音视频标志样状态变更响应信息:"+result.getMsg());
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
logger.info("音视频标志样状态变更响应信息:"+result.getMsg());
|
||||
|
||||
}
|
||||
/*public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||
|
||||
Reference in New Issue
Block a user