|
@@ -19,8 +19,8 @@ public class AbTestConfigContainer {
|
|
|
@Value("${ad.abtest.time.plan.code:555}")
|
|
|
String adTestCode;
|
|
|
|
|
|
-
|
|
|
- Map<String,List<Tuple<Integer>>> adTimePlanMap=new HashMap<>();
|
|
|
+//List<Tuple<Integer>>
|
|
|
+ Map<String,List<JSONObject>> adTimePlanMap=new HashMap<>();
|
|
|
@PostConstruct
|
|
|
public void initContainer(){
|
|
|
Timer timer = new Timer();
|
|
@@ -61,8 +61,8 @@ public class AbTestConfigContainer {
|
|
|
|
|
|
public Boolean inWithoutAdTime(String code,Integer hourOfDay){
|
|
|
Boolean flag=false;
|
|
|
- for(Tuple<Integer> tuple:adTimePlanMap.getOrDefault(code,new ArrayList<>())){
|
|
|
- if(tuple.getX()<=hourOfDay&&hourOfDay<tuple.getY()){
|
|
|
+ for(JSONObject object:adTimePlanMap.getOrDefault(code,new ArrayList<>())){
|
|
|
+ if(object.getInteger("x")<=hourOfDay&&hourOfDay<object.getInteger("y")){
|
|
|
return true;
|
|
|
}
|
|
|
}
|