|
|
|
|
@@ -77,29 +77,32 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|
|
|
|
entity.setPage(page);
|
|
|
|
|
List<CachePolicyUserRegion> list = commonPolicyDao.getCachePolicyUserRegionList(entity);
|
|
|
|
|
for (CachePolicyUserRegion c : list) {
|
|
|
|
|
JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1());
|
|
|
|
|
CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class);
|
|
|
|
|
c.setCache_cookied_cont(stu.getCache_cookied_cont());
|
|
|
|
|
c.setCache_dyn_url(stu.getCache_dyn_url());
|
|
|
|
|
c.setForce_caching(stu.getForce_caching());
|
|
|
|
|
c.setIgnore_req_nocache(stu.getIgnore_req_nocache());
|
|
|
|
|
c.setIgnore_res_nocache(stu.getIgnore_res_nocache());
|
|
|
|
|
c.setInactive_time(stu.getInactive_time());
|
|
|
|
|
c.setMax_cache_obj_size(stu.getMax_cache_obj_size());
|
|
|
|
|
c.setMax_cache_size(stu.getMax_cache_size());
|
|
|
|
|
c.setMin_use(stu.getMin_use());
|
|
|
|
|
c.setNo_revalidate(stu.getNo_revalidate());
|
|
|
|
|
c.setPinning_time(stu.getPinning_time());
|
|
|
|
|
if(stu.getCache_key()!=null){
|
|
|
|
|
String ignore=String.valueOf(stu.getCache_key().get("ignore_qs"));
|
|
|
|
|
String cookie=String.valueOf(stu.getCache_key().get("cookie"));
|
|
|
|
|
if(!ignore.equals("null") && ignore!=null){
|
|
|
|
|
c.setIgnore_qs(ignore);
|
|
|
|
|
}
|
|
|
|
|
if(!cookie.equals("null") && cookie!=null){
|
|
|
|
|
c.setCookie(cookie);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!StringUtil.isBlank(c.getUserRegion1())) { // action为缓存白名单时 userRegion1 为null
|
|
|
|
|
JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1());
|
|
|
|
|
CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class);
|
|
|
|
|
c.setCache_cookied_cont(stu.getCache_cookied_cont());
|
|
|
|
|
c.setCache_dyn_url(stu.getCache_dyn_url());
|
|
|
|
|
c.setForce_caching(stu.getForce_caching());
|
|
|
|
|
c.setIgnore_req_nocache(stu.getIgnore_req_nocache());
|
|
|
|
|
c.setIgnore_res_nocache(stu.getIgnore_res_nocache());
|
|
|
|
|
c.setInactive_time(stu.getInactive_time());
|
|
|
|
|
c.setMax_cache_obj_size(stu.getMax_cache_obj_size());
|
|
|
|
|
c.setMax_cache_size(stu.getMax_cache_size());
|
|
|
|
|
c.setMin_use(stu.getMin_use());
|
|
|
|
|
c.setNo_revalidate(stu.getNo_revalidate());
|
|
|
|
|
c.setPinning_time(stu.getPinning_time());
|
|
|
|
|
if(stu.getCache_key()!=null){
|
|
|
|
|
String ignore=String.valueOf(stu.getCache_key().get("ignore_qs"));
|
|
|
|
|
String cookie=String.valueOf(stu.getCache_key().get("cookie"));
|
|
|
|
|
if(!ignore.equals("null") && ignore!=null){
|
|
|
|
|
c.setIgnore_qs(ignore);
|
|
|
|
|
}
|
|
|
|
|
if(!cookie.equals("null") && cookie!=null){
|
|
|
|
|
c.setCookie(cookie);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
page.setList(list);
|
|
|
|
|
return page;
|
|
|
|
|
@@ -109,20 +112,21 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|
|
|
|
public List<CachePolicyUserRegion> getCachePolicyByUserRegionList(String ids){
|
|
|
|
|
List<CachePolicyUserRegion> list = commonPolicyDao.getCachePolicyByUserRegionList(ids);
|
|
|
|
|
for (CachePolicyUserRegion c : list) {
|
|
|
|
|
JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1());
|
|
|
|
|
CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class);
|
|
|
|
|
c.setCache_cookied_cont(stu.getCache_cookied_cont());
|
|
|
|
|
c.setCache_dyn_url(stu.getCache_dyn_url());
|
|
|
|
|
c.setForce_caching(stu.getForce_caching());
|
|
|
|
|
c.setIgnore_req_nocache(stu.getIgnore_req_nocache());
|
|
|
|
|
c.setIgnore_res_nocache(stu.getIgnore_res_nocache());
|
|
|
|
|
c.setInactive_time(stu.getInactive_time());
|
|
|
|
|
c.setMax_cache_obj_size(stu.getMax_cache_obj_size());
|
|
|
|
|
c.setMax_cache_size(stu.getMax_cache_size());
|
|
|
|
|
c.setMin_use(stu.getMin_use());
|
|
|
|
|
c.setNo_revalidate(stu.getNo_revalidate());
|
|
|
|
|
c.setPinning_time(stu.getPinning_time());
|
|
|
|
|
if(stu.getCache_key()!=null){
|
|
|
|
|
if(!StringUtil.isBlank(c.getUserRegion1())) { // action为缓存白名单时 userRegion1 为null
|
|
|
|
|
JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1());
|
|
|
|
|
CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class);
|
|
|
|
|
c.setCache_cookied_cont(stu.getCache_cookied_cont());
|
|
|
|
|
c.setCache_dyn_url(stu.getCache_dyn_url());
|
|
|
|
|
c.setForce_caching(stu.getForce_caching());
|
|
|
|
|
c.setIgnore_req_nocache(stu.getIgnore_req_nocache());
|
|
|
|
|
c.setIgnore_res_nocache(stu.getIgnore_res_nocache());
|
|
|
|
|
c.setInactive_time(stu.getInactive_time());
|
|
|
|
|
c.setMax_cache_obj_size(stu.getMax_cache_obj_size());
|
|
|
|
|
c.setMax_cache_size(stu.getMax_cache_size());
|
|
|
|
|
c.setMin_use(stu.getMin_use());
|
|
|
|
|
c.setNo_revalidate(stu.getNo_revalidate());
|
|
|
|
|
c.setPinning_time(stu.getPinning_time());
|
|
|
|
|
if(stu.getCache_key()!=null){
|
|
|
|
|
String ignore=String.valueOf(stu.getCache_key().get("ignore_qs"));
|
|
|
|
|
String cookie=String.valueOf(stu.getCache_key().get("cookie"));
|
|
|
|
|
if(!ignore.equals("null") && ignore!=null){
|
|
|
|
|
@@ -131,7 +135,8 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|
|
|
|
if(!cookie.equals("null") && cookie!=null){
|
|
|
|
|
c.setCookie(cookie);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|