RefreshPayCacheServiceImpl.java 1.47 KB
package com.zteits.pay.cache;

import com.zteits.clouds.api.apibase.bean.BizResult;
import com.zteits.clouds.api.dto.pay.RefreshPayCacheRequest;
import com.zteits.clouds.api.service.pay.RefreshPayCacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("com.zteits.pay.cache.RefreshPayCacheServiceImpl")
public class RefreshPayCacheServiceImpl implements RefreshPayCacheService {

    @Autowired
    private AppOrgCache appOrgCache;
    @Autowired
    private AppAuthorizationCache appAuthorizationCache;
    @Autowired
    private SpecialCarCache specialCarCache;

    @Override
    public BizResult<String> refreshCache(RefreshPayCacheRequest request) {
        String msg = "成功";
        switch (request.getType()) {
            case -1:
                appOrgCache.writeData();
                appAuthorizationCache.writeLittleKeyData();
                specialCarCache.writeLittleKeyData();
                break;
            case 2:
                appOrgCache.writeData();
                break;
            case 3:
                appAuthorizationCache.writeLittleKeyData();
                break;
            case 4:
                specialCarCache.writeLittleKeyData();
                break;
            default:
                msg = "入参不正确:-1:全部刷新;2:app_org,3:授权信息,4:特殊车牌配置";
                break;
        }
        return new BizResult<String>(msg);
    }

}