Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Matúš Valko
Online Gaming Management System
Commits
f9934b48
Commit
f9934b48
authored
May 20, 2022
by
Marek Kadlečík
Browse files
Fixed rest api startup
parent
98cf26de
Pipeline
#141874
passed with stage
in 1 minute and 21 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
f9934b48
...
...
@@ -24,7 +24,7 @@ You can run the Online Gaming Management System with maven:
-
UI - open
`http://localhost:8080/pa165/`
in the browser
#### REST demo
We exposed
`Player`
entity in REST API.
We exposed
`Player`
entity in REST API.
Execute
`mvn cargo:run`
on rest module to run rest api.
Create a new player:
```
bash
...
...
gaming-rest/pom.xml
View file @
f9934b48
...
...
@@ -13,6 +13,8 @@
<artifactId>
gaming-rest
</artifactId>
<build>
<finalName>
pa165
</finalName>
<defaultGoal>
cargo:run
</defaultGoal>
<plugins>
<!-- embedded tomcat -->
<plugin>
...
...
@@ -60,6 +62,12 @@
<artifactId>
jackson-databind
</artifactId>
<version>
2.13.2.2
</version>
</dependency>
<dependency>
<groupId>
cz.muni.fi.pa165
</groupId>
<artifactId>
gaming-sample-data
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<properties>
...
...
gaming-rest/src/main/java/cz/muni/fi/pa165/RootWebContext.java
View file @
f9934b48
...
...
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.fasterxml.jackson.databind.MapperFeature
;
import
cz.muni.fi.pa165.config.ServiceConfiguration
;
import
cz.muni.fi.pa165.sampledata.ManagementSystemSampleDataConfiguration
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
...
...
@@ -22,7 +23,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@EnableWebMvc
@Configuration
@Import
({
Service
Configuration
.
class
})
@Import
({
ManagementSystemSampleData
Configuration
.
class
})
@ComponentScan
(
basePackages
=
{
"cz.muni.fi.pa165.rest.controllers"
})
public
class
RootWebContext
implements
WebMvcConfigurer
{
...
...
@@ -44,10 +45,6 @@ public class RootWebContext implements WebMvcConfigurer {
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
objectMapper
.
disable
(
SerializationFeature
.
WRITE_DATES_AS_TIMESTAMPS
);
objectMapper
.
setDateFormat
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
,
Locale
.
ENGLISH
));
// TODO toto je nieco s hasovanim tyc hesiel
// objectMapper.addMixIn(UserDTO.class, UserDTOMixin.class);
objectMapper
.
disable
(
MapperFeature
.
DEFAULT_VIEW_INCLUSION
);
jsonConverter
.
setObjectMapper
(
objectMapper
);
...
...
gaming-rest/src/main/java/cz/muni/fi/pa165/rest/RootUris.java
View file @
f9934b48
package
cz.muni.fi.pa165.rest
;
public
final
class
RootUris
{
public
static
final
String
restPlayer
=
"/
pa165/
rest/players"
;
public
static
final
String
restPlayer
=
"/rest/players"
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment