55 lines
1.3 KiB
Java
55 lines
1.3 KiB
Java
package config;
|
||
|
||
import manager.STableManager;
|
||
import manager.Table;
|
||
|
||
import java.util.ArrayList;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
@Table(name ="WeekcardRotationConfig")
|
||
public class SWeekcardRotationConfig implements BaseConfig {
|
||
|
||
private int id;
|
||
|
||
private int[][] weekcardType;
|
||
|
||
private int globalActivity;
|
||
|
||
/**
|
||
* key:活动id
|
||
*/
|
||
private static Map<Integer, List<SWeekcardRotationConfig>> map = new HashMap<>();
|
||
|
||
@Override
|
||
public void init() throws Exception {
|
||
Map<Integer, SWeekcardRotationConfig> config = STableManager.getConfig(SWeekcardRotationConfig.class);
|
||
HashMap<Integer, List<SWeekcardRotationConfig>> map1 = new HashMap<>();
|
||
for (SWeekcardRotationConfig value : config.values()) {
|
||
List<SWeekcardRotationConfig> list = map1.getOrDefault(value.getGlobalActivity(), new ArrayList<>());
|
||
list.add(value);
|
||
map1.put(value.getGlobalActivity(),list);
|
||
}
|
||
map.clear();
|
||
map = map1;
|
||
}
|
||
|
||
public static Map<Integer, List<SWeekcardRotationConfig>> getMap() {
|
||
return map;
|
||
}
|
||
|
||
public int getId() {
|
||
return id;
|
||
}
|
||
|
||
public int[][] getWeekcardType() {
|
||
return weekcardType;
|
||
}
|
||
|
||
public int getGlobalActivity() {
|
||
return globalActivity;
|
||
}
|
||
|
||
|
||
} |