Cpte-Cloud/cpte-server-cloud/cpte-demo-cloud-start/src/main/java/org/jeecg/JeecgDemoCloudApplication.java

39 lines
1.5 KiB
Java
Raw Normal View History

2025-10-16 18:05:09 +08:00
package org.jeecg;
import com.xkcoding.justauth.autoconfigure.JustAuthAutoConfiguration;
import org.jeecg.common.base.BaseMap;
import org.jeecg.common.constant.GlobalConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.data.redis.core.RedisTemplate;
@SpringBootApplication
@EnableFeignClients
@ImportAutoConfiguration(JustAuthAutoConfiguration.class) // spring boot 3.x justauth 兼容性处理
public class JeecgDemoCloudApplication implements CommandLineRunner {
@Autowired
private RedisTemplate<String, Object> redisTemplate;
public static void main(String[] args) {
SpringApplication.run(JeecgDemoCloudApplication.class, args);
}
/**
* gateway
*
* gatewaySwagger访
* @param args
*/
@Override
public void run(String... args) {
BaseMap params = new BaseMap();
params.put(GlobalConstants.HANDLER_NAME, GlobalConstants.LODER_ROUDER_HANDLER);
//刷新网关
redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params);
}
}