2020年7月7日

    @Test
    public void buildCache(){
        Map<String,String> roomTypeMap = new HashMap<>();
        roomTypeMap.put("1","大床房");
        roomTypeMap.put("2","双床房");
        roomTypeMap.put("3","套房");
        redisService.hmset(DbDefaultEnum.ROOM_TYPE_DIC,roomTypeMap);

        Map<String,String> citySequenceMap = new HashMap<>();
        citySequenceMap.put("110000","1");
        citySequenceMap.put("310000","2");
        citySequenceMap.put("440100","3");
        citySequenceMap.put("440300","4");
        citySequenceMap.put("330100","5");
        citySequenceMap.put("510100","6");
        citySequenceMap.put("320100","7");
        citySequenceMap.put("320500","8");
        redisService.hmset(DbDefaultEnum.CITY_DIC,citySequenceMap);

        Map<String,String> cityMap = new HashMap<>();
        cityMap.put("110000","北京");
        cityMap.put("310000","上海");
        cityMap.put("440100","广州");
        cityMap.put("440300","深圳");
        cityMap.put("330100","杭州");
        cityMap.put("510100","成都");
        cityMap.put("320100","南京");
        cityMap.put("320500","苏州");
        redisService.hmset(DbDefaultEnum.CITY_SEQUENCE_DIC,cityMap);

        Map<String,String> beijingDistrictMap = new HashMap<>();
        beijingDistrictMap.put("110101","东城区");
        beijingDistrictMap.put("110102","西城区");
        beijingDistrictMap.put("110105","朝阳区");
        beijingDistrictMap.put("110106","丰台区");
        beijingDistrictMap.put("110107","石景山区");
        beijingDistrictMap.put("110108","海淀区");
        beijingDistrictMap.put("110109","门头沟区");
        beijingDistrictMap.put("110111","房山区");
        beijingDistrictMap.put("110112","通州区");
        beijingDistrictMap.put("110113","顺义区");
        beijingDistrictMap.put("110114","昌平区");
        beijingDistrictMap.put("110115","大兴区");
        beijingDistrictMap.put("110116","怀柔区");
        beijingDistrictMap.put("110117","平谷区");
        beijingDistrictMap.put("110228","密云区");
        beijingDistrictMap.put("110229","延庆区");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "110000",beijingDistrictMap);

        Map<String,String> shanghaiDistrictMap = new HashMap<>();
        shanghaiDistrictMap.put("310101","黄浦区");
        shanghaiDistrictMap.put("310104","徐汇区");
        shanghaiDistrictMap.put("310105","长宁区");
        shanghaiDistrictMap.put("310106","静安区");
        shanghaiDistrictMap.put("310107","普陀区");
        shanghaiDistrictMap.put("310109","虹口区");
        shanghaiDistrictMap.put("310110","杨浦区");
        shanghaiDistrictMap.put("310112","闵行区");
        shanghaiDistrictMap.put("310113","宝山区");
        shanghaiDistrictMap.put("310114","嘉定区");
        shanghaiDistrictMap.put("310115","浦东新区");
        shanghaiDistrictMap.put("310116","金山区");
        shanghaiDistrictMap.put("310117","松江区");
        shanghaiDistrictMap.put("310118","青浦区");
        shanghaiDistrictMap.put("310120","奉贤区");
        shanghaiDistrictMap.put("310230","崇明区");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "310000",shanghaiDistrictMap);

        Map<String,String> guangzhouDistrictMap = new HashMap<>();
        guangzhouDistrictMap.put("440101","荔湾区");
        guangzhouDistrictMap.put("440102","海珠区");
        guangzhouDistrictMap.put("440103","越秀区");
        guangzhouDistrictMap.put("440104","天河区");
        guangzhouDistrictMap.put("440105","白云区");
        guangzhouDistrictMap.put("440106","黄埔区");
        guangzhouDistrictMap.put("440107","花都区");
        guangzhouDistrictMap.put("440109","番禺区");
        guangzhouDistrictMap.put("440110","南沙区");
        guangzhouDistrictMap.put("440111","增城区");
        guangzhouDistrictMap.put("440112","从化区");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "440100",guangzhouDistrictMap);

        Map<String,String> shenzhengDistrictMap = new HashMap<>();
        shenzhengDistrictMap.put("440303","罗湖区");
        shenzhengDistrictMap.put("440304","福田区");
        shenzhengDistrictMap.put("440305","南山区");
        shenzhengDistrictMap.put("440306","宝安区");
        shenzhengDistrictMap.put("440307","龙岗区");
        shenzhengDistrictMap.put("440309","盐田区");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "440300",shenzhengDistrictMap);

        Map<String,String> hangzhouDistrictMap = new HashMap<>();
        hangzhouDistrictMap.put("330101","拱墅区");
        hangzhouDistrictMap.put("330102","上城区");
        hangzhouDistrictMap.put("330103","下城区");
        hangzhouDistrictMap.put("330104","江干区");
        hangzhouDistrictMap.put("330105","西湖区");
        hangzhouDistrictMap.put("330106","滨江区");
        hangzhouDistrictMap.put("330107","萧山区");
        hangzhouDistrictMap.put("330108","余杭区");
        hangzhouDistrictMap.put("330109","富阳区");
        hangzhouDistrictMap.put("330110","桐庐县");
        hangzhouDistrictMap.put("330111","淳安县");
        hangzhouDistrictMap.put("330112","建德市");
        hangzhouDistrictMap.put("330113","临安市");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "330100",hangzhouDistrictMap);

        Map<String,String> chengduDistrictMap = new HashMap<>();
        chengduDistrictMap.put("510101","锦江区");
        chengduDistrictMap.put("510102","青羊区");
        chengduDistrictMap.put("510103","金牛区");
        chengduDistrictMap.put("510104","武侯区");
        chengduDistrictMap.put("510105","成华区");
        chengduDistrictMap.put("510107","龙泉驿区");
        chengduDistrictMap.put("510108","温江区");
        chengduDistrictMap.put("510109","新都区");
        chengduDistrictMap.put("510110","青白江区");
        chengduDistrictMap.put("510111","双流区");
        chengduDistrictMap.put("510113","蒲江县");
        chengduDistrictMap.put("510114","大邑县");
        chengduDistrictMap.put("510115","金堂县");
        chengduDistrictMap.put("510116","新津县");
        chengduDistrictMap.put("510117","都江堰市");
        chengduDistrictMap.put("510118","彭州市");
        chengduDistrictMap.put("510119","邛崃市");
        chengduDistrictMap.put("510120","崇州市");
        chengduDistrictMap.put("510124","郫县");
        chengduDistrictMap.put("510185","简阳市");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "510100",chengduDistrictMap);

        Map<String,String> nanjingDistrictMap = new HashMap<>();
        nanjingDistrictMap.put("320101","玄武区");
        nanjingDistrictMap.put("320102","秦淮区");
        nanjingDistrictMap.put("320104","鼓楼区");
        nanjingDistrictMap.put("320105","雨花台区");
        nanjingDistrictMap.put("320106","建邺区");
        nanjingDistrictMap.put("320111","六合区");
        nanjingDistrictMap.put("320113","江宁区");
        nanjingDistrictMap.put("320114","浦口区");
        nanjingDistrictMap.put("320115","溧水区");
        nanjingDistrictMap.put("320116","栖霞区");
        nanjingDistrictMap.put("320117","高淳区");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "320100",nanjingDistrictMap);

        Map<String,String> suzhouDistrictMap = new HashMap<>();
        suzhouDistrictMap.put("320501","姑苏区");
        suzhouDistrictMap.put("320502","相城区");
        suzhouDistrictMap.put("320503","吴中区");
        suzhouDistrictMap.put("320504","虎丘区");
        suzhouDistrictMap.put("320505","吴江区");
        suzhouDistrictMap.put("320507","常熟市");
        suzhouDistrictMap.put("320509","张家港市");
        suzhouDistrictMap.put("320510","太仓市");
        suzhouDistrictMap.put("320583","昆山市");
        redisService.hmset(DbDefaultEnum.DISTRICT_DIC + "320500",suzhouDistrictMap);
    }

 

结束。