Browse Source

增加配置文件读取

tags/v1.0.0^2
林万龙 4 years ago
parent
commit
5c13b0c254
2 changed files with 1 additions and 12 deletions
  1. +1
    -1
      src/main/java/com/telpo/dipperposition/co/RzlAccount.java
  2. +0
    -11
      src/main/java/com/telpo/dipperposition/config/PositionConfig.java

+ 1
- 1
src/main/java/com/telpo/dipperposition/co/RzlAccount.java View File

@@ -20,7 +20,7 @@ import org.springframework.stereotype.Component;
@Component @Component
public class RzlAccount { public class RzlAccount {


@Value("${hello}")
@Value("${position.hello}")
private String hello; private String hello;


RzlAccount() RzlAccount()


+ 0
- 11
src/main/java/com/telpo/dipperposition/config/PositionConfig.java View File

@@ -30,15 +30,4 @@ import java.util.Properties;
@ConfigurationProperties(prefix = "position") @ConfigurationProperties(prefix = "position")
public class PositionConfig { public class PositionConfig {


@Value("${hello}")
private String hello;

@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON)
public RzlAccount getRzlAccount() {

RzlAccount rzlAccount = new RzlAccount();
rzlAccount.setHello(hello);
return rzlAccount;
}

} }

Loading…
Cancel
Save