feat: change nacos config

This commit is contained in:
zzs 2025-02-26 15:43:32 +08:00
parent c9ab19d68b
commit b7a6bf4572
2 changed files with 11 additions and 2 deletions
src/main
java/vin/vio/collaboraonline/config/tenant
resources

View File

@ -42,11 +42,19 @@ public class TenantConfigManager {
@Value("${spring.cloud.nacos.config.namespace}")
private String namespace;
@Value("${spring.cloud.nacos.username}")
private String username;
@Value("${spring.cloud.nacos.password}")
private String password;
@PostConstruct
public void init() throws Exception {
Properties properties = new Properties();
properties.put("serverAddr", nacosServerAddr);
properties.put("namespace", namespace);
properties.put("username", username);
properties.put("password", password);
ConfigService configService = NacosFactory.createConfigService(properties);
for (String tenant : tenantProperties.getList()) {

View File

@ -1,14 +1,15 @@
spring:
application:
name: CollaboraOnline
profiles:
active: local
cloud:
nacos:
config:
namespace: office
group: ATTACHMENT_VIA_GROUP
# server-addr: 127.0.0.1:8848
server-addr: 192.168.3.100:8848
username: nacos
password: nacos
config:
import: nacos:application-tenant.yml