@@ -29,5 +29,23 @@ import java.util.Properties; | |||
@Configuration | |||
@ConfigurationProperties(prefix = "position") | |||
public class PositionConfig { | |||
@Value("${position.hello}") | |||
private String hello; | |||
PositionConfig() | |||
{ | |||
} | |||
private static PositionConfig instance; | |||
public static PositionConfig getInstance(){ | |||
if (instance==null){ | |||
try { | |||
Thread.sleep(100); | |||
} catch (InterruptedException e) { | |||
e.printStackTrace(); | |||
} | |||
instance = new PositionConfig(); | |||
} | |||
return instance; | |||
} | |||
} |
@@ -44,7 +44,7 @@ public class DipperPositionController { | |||
// //log.info(positionId + ":" + content.positionId) | |||
// Map<String, Object> dataMap = NacosDataParserHandler.getInstance().parseNacosData(content,"yaml"); | |||
// return dataMap == null ? "" : (String)dataMap.get(positionId); | |||
return RzlAccount.getInstance().getHello(); | |||
return PositionConfig.getInstance().getHello(); | |||
//return "Helle world!"; //ContextLoader.getCurrentWebApplicationContext().toString(); | |||
} | |||
} |