Bläddra i källkod

修改到docker外运行环境

tags/v1.0.0^2
林万龙 3 år sedan
förälder
incheckning
3d0675b874
2 ändrade filer med 13 tillägg och 20 borttagningar
  1. +5
    -5
      src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java
  2. +8
    -15
      src/main/java/com/telpo/dipperposition/config/PositionConfig.java

+ 5
- 5
src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java Visa fil

@@ -15,19 +15,19 @@ import org.springframework.context.annotation.Configuration;
@Getter
@Setter
@Configuration
@NacosPropertySource(dataId="position-server", autoRefreshed=true)
@NacosPropertySource(dataId="dipperposition-service", autoRefreshed=true)
public class NettyServerConfig {

@NacosValue(value = "${serverAddr}")
@NacosValue(value = "${position-server.serverAddr}")
private String serverAddr;

@NacosValue(value = "${timeAsycPort:9011}")
@NacosValue(value = "${position-server.timeAsycPort:9011}")
private String timeAsycServerPort;

@NacosValue(value = "${posAsycPort}")
@NacosValue(value = "${position-server.posAsycPort}")
private String posAsycServerPort;

@NacosValue(value = "${starsAsycPort}")
@NacosValue(value = "${position-server.starsAsycPort}")
private String starsAsycServerPort;

}

+ 8
- 15
src/main/java/com/telpo/dipperposition/config/PositionConfig.java Visa fil

@@ -2,15 +2,8 @@ package com.telpo.dipperposition.config;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import com.telpo.dipperposition.co.PositionConfigInfo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import okhttp3.OkHttpClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
@@ -22,24 +15,24 @@ import org.springframework.context.annotation.Configuration;
@Getter
@Setter
@Configuration
@NacosPropertySource(dataId="pos", autoRefreshed=true)
@NacosPropertySource(dataId="dipperposition-service", autoRefreshed=true)
public class PositionConfig {

@NacosValue("${centerProvinceFilePath}")
@NacosValue("${pos.centerProvinceFilePath}")
String centerProvinceFilePath;

@NacosValue("${ipPositionRequestPath}")
@NacosValue("${pos.ipPositionRequestPath}")
String ipPositionRequestPath;
@NacosValue("${ipPositionRequestKey}")
@NacosValue("${pos.ipPositionRequestKey}")
String ipPositionRequestKey;
@NacosValue("${centerProvince}")
@NacosValue("${pos.centerProvince}")
String centerProvince;


@NacosValue("${astServer}")
@NacosValue("${pos.astServer}")
String astServer;
@NacosValue("${astPosAstPort}")
@NacosValue("${pos.astPosAstPort}")
int posAstPort;
@NacosValue("${astTimeout}")
@NacosValue("${pos.astTimeout}")
int astTimeout;
}

Laddar…
Avbryt
Spara