Browse Source

mq抽离 redis抽离

by su 3 years ago
parent
commit
3948650c8f

+ 1 - 1
4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/ModelingApplication.java

@@ -9,7 +9,7 @@ import org.springframework.context.annotation.ComponentScan;
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients("com.fdkankan.*.api.feign")
-@ComponentScan(basePackages = {"com.fdkankan.common", "com.fdkankan.modeling","com.fdkankan.oss","com.fdkankan.redis"})
+@ComponentScan(basePackages = {"com.fdkankan.common", "com.fdkankan.modeling","com.fdkankan.oss","com.fdkankan.redis","com.fdkankan.mq"})
 public class ModelingApplication {
 
 	public static void main(String[] args) {

+ 2 - 2
4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/receiver/BuildSceneMQListener.java

@@ -79,10 +79,10 @@ public class BuildSceneMQListener implements RocketMQListener<String> {
     @Value("${oss.type}")
     private String ossType;
 
-    @Value("${oss.url.prefix}")
+    @Value("${prefix.ali}")
     private String prefixAli;
 
-    @Resource
+    @Autowired
     private UploadToOssUtil uploadUtils;
 
     @Autowired

+ 1 - 1
4dkankan-center-platform/src/main/java/com/fdkankan/platform/agent/service/impl/AgentServiceImpl.java

@@ -86,7 +86,7 @@ public class AgentServiceImpl extends ServiceImpl<IAgentMapper, Agent> implement
         }
         String key = SsoUtil.PREFIX_CACHE_AGENT + agent.getAgentId();
         String token = JwtUtil.createJWT(-1, key, LoginType.AGENT.name());
-        redisUtil.set(key,token, DefaultConfig.USER_EXPIRE_TIME, DefaultConfig.DEFAULT_TIME_UNIT);
+        redisUtil.set(key,token, DefaultConfig.USER_EXPIRE_TIME);
         JSONObject obj = new JSONObject();
         obj.put("token", token);
         return obj;

+ 1 - 1
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -1036,7 +1036,7 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
                     }else {
                         count = scene.getViewCount();
                     }
-                    redisUtil.set(key, count);
+                    redisUtil.set(key,  String.valueOf(count));
                 }
             }finally {
                 redisLockUtil.unlockLua(lockKey);

+ 1 - 1
4dkankan-center-scene/src/main/resources/bootstrap.yml

@@ -21,7 +21,7 @@ spring:
             group: DEFAULT_GROUP
             refresh: true
 
-          - data-id: common-mq-config2.yaml
+          - data-id: common-mq-config.yaml
             group: DEFAULT_GROUP
             refresh: true
 

+ 2 - 0
4dkankan-gateway/src/main/java/com/fdkankan/gateway/GatewayApplication.java

@@ -6,11 +6,13 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.ComponentScan;
 
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
 @EnableDiscoveryClient
 //@Controller
 @RefreshScope
+@ComponentScan(basePackages = {"com.fdkankan.redis","com.fdkankan.gateway"})
 public class GatewayApplication {
 
     public static void main(String[] args) {