关键字转url时,新增的http url配置来函取自关键字配置

This commit is contained in:
duandongmei
2018-11-10 12:26:00 +08:00
parent 7772c0c206
commit 40bcfea683
6 changed files with 18 additions and 4 deletions

View File

@@ -138,9 +138,12 @@ public class WhiteListController extends CommonController{
@RequestMapping(value = {"saveHttpUrlCfgs"})
public String saveHttpUrlCfgs(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,CfgIndexInfo entity) {
if(!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())){
CfgIndexInfo sourceCfg=websiteCfgService.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId());
for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) {
CfgIndexInfo cfg=new CfgIndexInfo();
List httpList=new ArrayList<>();
httpUrlCfg.setRequestId(sourceCfg.getRequestId());
BeanUtils.copyProperties(httpUrlCfg, cfg);
httpList.add(httpUrlCfg);
cfg.setHttpUrlList(httpList);

View File

@@ -353,7 +353,7 @@
and cfg_id=#{cfgId}
</if>
<if test="compileId != null">
and compileId=#{compileId}
and compile_id=#{compileId}
</if>
<if test="functionId != null">
and function_id=#{functionId}

View File

@@ -62,6 +62,15 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
@Autowired
private ServiceDictInfoDao serviceDictInfoDao;
public CfgIndexInfo getCfgIndexInfo(Integer compileId){
CfgIndexInfo entity=new CfgIndexInfo();
entity.setCompileId(compileId);
List<CfgIndexInfo> cfgs=websiteCfgDao.getCfgIndexInfos(entity);
if(!StringUtil.isEmpty(cfgs)){
entity=cfgs.get(0);
}
return entity;
}
public CfgIndexInfo getHttpCfg(Long cfgId){
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
List<IpPortCfg> ipPortList = websiteCfgDao.getIpPortList(entity);