Commit f9934b48 authored by Marek Kadlečík's avatar Marek Kadlečík
Browse files

Fixed rest api startup

parent 98cf26de
Pipeline #141874 passed with stage
in 1 minute and 21 seconds
......@@ -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
......
......@@ -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>
......
......@@ -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({ServiceConfiguration.class})
@Import({ManagementSystemSampleDataConfiguration.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);
......
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";
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment