1、结构调整

2、抽象工厂优化
This commit is contained in:
2026-03-31 19:35:21 +08:00
parent 87757b352c
commit ebdbdbeb41
667 changed files with 1240 additions and 50173 deletions

View File

@@ -2,27 +2,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.njcn</groupId>
<artifactId>msgpush-framework</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>msgpush-spring-boot-starter-env</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
开发环境拓展,实现类似阿里的特性环境的能力
1. https://segmentfault.com/a/1190000018022987
</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.njcn</groupId>
@@ -62,5 +55,4 @@
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies>
</project>
</project>

View File

@@ -21,7 +21,6 @@ public class EnvEnvironmentPostProcessor implements EnvironmentPostProcessor {
private static final Set<String> TARGET_TAG_KEYS = SetUtils.asSet(
"spring.cloud.nacos.discovery.metadata.tag" // Nacos 注册中心
// MQ TODO
);
@Override
@@ -29,7 +28,6 @@ public class EnvEnvironmentPostProcessor implements EnvironmentPostProcessor {
// 0. 设置 ${HOST_NAME} 兜底的环境变量
String hostNameKey = StrUtil.subBetween(HOST_NAME_VALUE, "{", "}");
if (!environment.containsProperty(hostNameKey)) {
System.out.println(EnvUtils.getHostName());
environment.getSystemProperties().put(hostNameKey, EnvUtils.getHostName());
}

View File

@@ -76,9 +76,9 @@ public class EnvLoadBalancerClient implements ReactorServiceInstanceLoadBalancer
chooseInstances = instances;
}
// TODO 芋艿:https://juejin.cn/post/7056770721858469896 相同网段
// TODO https://juejin.cn/post/7056770721858469896 相同网段
// 随机 + 权重获取实例列表 TODO 芋艿:目前直接使用 Nacos 提供的方法,如果替换注册中心,需要重新失败该方法
// 随机 + 权重获取实例列表 TODO 目前直接使用 Nacos 提供的方法,如果替换注册中心,需要重新失败该方法
return new DefaultResponse(NacosBalancer.getHostByRandomWeight3(chooseInstances));
}

View File

@@ -1 +0,0 @@
package com.njcn.msgpush.framework.env.core;

View File

@@ -1,7 +0,0 @@
/**
* 开发环境拓展,实现类似阿里的特性环境的能力
* 1. https://segmentfault.com/a/1190000018022987
*
* @author hongawen
*/
package com.njcn.msgpush.framework.env;