File tree Expand file tree Collapse file tree 4 files changed +68
-4
lines changed
src/main/java/com/apporelbotna/gameserver/persistencewsclient Expand file tree Collapse file tree 4 files changed +68
-4
lines changed Original file line number Diff line number Diff line change 13
13
14
14
repositories {
15
15
jcenter()
16
+ maven { url ' https://jitpack.io/' }
16
17
}
17
18
18
19
dependencies {
@@ -23,11 +24,12 @@ dependencies {
23
24
testImplementation ' junit:junit:4.12'
24
25
25
26
// https://mvnrepository.com/artifact/org.springframework.hateoas/spring-hateoas
26
- compile ' org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
27
+ compileOnly ' org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
27
28
28
29
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
29
30
compile group : ' org.springframework.boot' , name : ' spring-boot-starter-web' , version : ' 2.0.0.RELEASE'
30
31
31
- compile fileTree(dir : ' libs' , include : ' *.jar' )
32
+ // PersistenceWS Stubs
33
+ compile ' com.github.java-game-server:stubs:0.6.2'
32
34
33
35
}
Original file line number Diff line number Diff line change 16
16
import com .apporelbotna .gameserver .stubs .User ;
17
17
import com .apporelbotna .gameserver .stubs .UserWrapper ;
18
18
19
- public class DAO {
19
+ public class GameDAO {
20
20
public static final String SERVER_URL = "http://localhost:8082/" ;
21
21
RestTemplate restTemplate = new RestTemplate ();
22
22
23
- public DAO () {
23
+ public GameDAO () {
24
24
25
25
}
26
26
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 =3.0.0
2
+ name =PersistenceWSClient
3
+
4
+ server.url =http\://localhost\:8082/
You can’t perform that action at this time.
0 commit comments