Blame view

parking-module-pay/src/main/java/com/zteits/pay/cache/RefreshPayCacheServiceImpl.java 1.47 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  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);
      }
  
  }