k94314517
2024-07-11 6a8bcc5d6dcf0fcd98458e87122a64ddd7dfae9a
server/service/src/main/java/com/doumee/service/business/InitService.java
@@ -1,5 +1,6 @@
package com.doumee.service.business;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.utils.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@@ -23,12 +24,24 @@
    @Autowired
    @Lazy
    private ShopService shopService;
    @Autowired
    @Lazy
    private SystemDictDataBiz  systemDictDataBiz;
    @PostConstruct
    public void clearImporting(){
        redisTemplate.delete(Constants.RedisKeys.IMPORTING_SHOP);
    }
    @PostConstruct
    public void initIamAppIdAndAppKey(){
        redisTemplate.opsForValue().set(Constants.RedisKeys.IAM_APPKEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_APPKEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.IAM_APPID,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_APPID).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_KEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_SMS_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_SMS_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_SMS_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_SMS_API_KEY).getCode());
    }
    @PostConstruct
    public void cacheShopTree(){
//        redisTemplate.opsForValue().set(Constants.RedisKeys.SHOP_TREE,shopService.shopTree(null));
    }