File tree Expand file tree Collapse file tree 4 files changed +65
-3
lines changed
src/main/java/com/apporelbotna/gameserver/persistencewsclient Expand file tree Collapse file tree 4 files changed +65
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ dependencies {
24
24
testImplementation ' junit:junit:4.12'
25
25
26
26
// https://mvnrepository.com/artifact/org.springframework.hateoas/spring-hateoas
27
- compile ' org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
27
+ compileOnly ' org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
28
28
29
29
// PersistenceWS Stubs
30
30
compileOnly ' com.github.java-game-server:stubs:0.6.2'
Original file line number Diff line number Diff line change 19
19
//esto se podria hacer alguna clase que controlase los codigos que se mostraran en la applicacion
20
20
//personalizados y en diferentes idiomas
21
21
22
- public class DAO
22
+ public class GameDAO
23
23
{
24
24
public static final String SERVER_URL = "http://localhost:8082/" ;
25
25
RestTemplate restTemplate = new RestTemplate ();
26
26
27
- public DAO ()
27
+ public GameDAO ()
28
28
{
29
29
30
30
}
Original file line number Diff line number Diff line change
1
+ package com .apporelbotna .gameserver .persistencewsclient .properties ;
2
+
3
+ import java .io .FileInputStream ;
4
+ import java .io .IOException ;
5
+ import java .util .Properties ;
6
+
7
+ import org .slf4j .Logger ;
8
+ import org .slf4j .LoggerFactory ;
9
+
10
+ public final class ApplicationProperties
11
+ {
12
+ private static final Logger logger = LoggerFactory .getLogger (ApplicationProperties .class );
13
+
14
+ private static String version ;
15
+ private static String name ;
16
+
17
+ private static String serverUrl ;
18
+
19
+ private ApplicationProperties ()
20
+ {
21
+ throw new UnsupportedOperationException ("ApplicationProperties must not be instantiated!" );
22
+ }
23
+
24
+ static
25
+ {
26
+ String rootPath = Thread .currentThread ().getContextClassLoader ().getResource ("" ).getPath ();
27
+ String applicationPropertiesPath = rootPath + "com\\ apporelbotna\\ gameserver\\ persistencewsclient\\ properties\\ application.properties" ;
28
+
29
+ Properties applicationProperties = new Properties ();
30
+ try
31
+ {
32
+ applicationProperties .load (new FileInputStream (applicationPropertiesPath ));
33
+ version = applicationProperties .getProperty ("version" );
34
+ name = applicationProperties .getProperty ("name" );
35
+
36
+ serverUrl = applicationProperties .getProperty ("server.url" );
37
+ }
38
+ catch (IOException e )
39
+ {
40
+ logger .error (e .getMessage ());
41
+ }
42
+ }
43
+
44
+ public static String getVersion ()
45
+ {
46
+ return version ;
47
+ }
48
+
49
+ public static String getName ()
50
+ {
51
+ return name ;
52
+ }
53
+
54
+ public static String getServerUrl ()
55
+ {
56
+ return serverUrl ;
57
+ }
58
+ }
Original file line number Diff line number Diff line change
1
+ version =2.0.0
2
+ name =PersistenceWSClient
3
+
4
+ server.url =http\://localhost\:8082/
You can’t perform that action at this time.
0 commit comments