package com.ruoyi.benyun.utils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.benyun.constant.RedisInitContant;
import com.ruoyi.benyun.entity.AddrCategory;
import com.ruoyi.benyun.entity.ManageType;
import com.ruoyi.benyun.entity.TypeBy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Component
public class InitMapUtil {
    @Autowired
    RedisTemplate redisTemplate;


    public String getInitCityTierMap(String addrCode){
        return (String) redisTemplate.boundHashOps(RedisInitContant.INIT_CITY_TIER_MAP).get(addrCode.substring(0,4));
    }

    public List<String> getInitCityTierListMap(String cityTier){
        return (List<String>) redisTemplate.boundHashOps(RedisInitContant.INIT_CITY_TIER_LIST_MAP).get(cityTier);
    }

    public ManageType getInitManageType(String manageTypeCode){
        return (ManageType) redisTemplate.boundHashOps(RedisInitContant.INIT_MANAGE_TYPE).get(manageTypeCode);
    }

    public String getInitAddrCodeMap(String addrCode){
        return (String) redisTemplate.boundHashOps(RedisInitContant.INIT_ADDR_CODE_MAP).get(addrCode);
    }

    public String getInitTypeByMap(String typeCodeBy){
        return (String) redisTemplate.boundHashOps(RedisInitContant.INIT_TYPE_BY_MAP).get(typeCodeBy);
    }

}
