diff --git a/pom.xml b/pom.xml index bf4f2abf2fb6b8334627afa266200b75dcbeada4..4ff45e9551367d5997589cb58af7f29660f0a610 100644 --- a/pom.xml +++ b/pom.xml @@ -1,113 +1,126 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>2.2.4.RELEASE</version> - <relativePath/> <!-- lookup parent from repository --> - </parent> - <groupId>com.example</groupId> - <artifactId>demo</artifactId> - <version>0.0.1-SNAPSHOT</version> - <packaging>jar</packaging> - <name>demo</name> - <description>Demo project for Spring Boot</description> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>2.2.4.RELEASE</version> + <relativePath/> <!-- lookup parent from repository --> + </parent> + <groupId>com.example</groupId> + <artifactId>demo</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>jar</packaging> + <name>demo</name> + <description>Demo project for Spring Boot</description> - <properties> - <java.version>11</java.version> + <properties> + <java.version>11</java.version> - <projectlombok.version>1.18.12</projectlombok.version> - <org.mapstruct.version>1.3.1.Final</org.mapstruct.version> - </properties> + <projectlombok.version>1.18.12</projectlombok.version> + <org.mapstruct.version>1.3.1.Final</org.mapstruct.version> + </properties> - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-data-jpa</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - </dependency> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-jpa</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-tomcat</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.junit.vintage</groupId> - <artifactId>junit-vintage-engine</artifactId> - </exclusion> - </exclusions> - </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-tomcat</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - <version>1.18.12</version> -<!-- <version>${projectlombok.version}</version>--> - </dependency> + <!-- TODO: just for development purposes--> +<!-- <dependency>--> +<!-- <groupId>com.h2database</groupId>--> +<!-- <artifactId>h2</artifactId>--> +<!-- <version>1.4.200</version>--> +<!-- </dependency>--> - <dependency> - <groupId>org.mapstruct</groupId> - <artifactId>mapstruct</artifactId> - <version>1.3.1.Final</version> -<!-- <version>${org.mapstruct.version}</version>--> - </dependency> + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <scope>runtime</scope> + </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-collections4</artifactId> - <version>4.4</version> - </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.18.12</version> + <!-- <version>${projectlombok.version}</version>--> + </dependency> - <!-- swagger --> - <dependency> - <groupId>io.springfox</groupId> - <artifactId>springfox-swagger2</artifactId> - <version>2.9.2</version> -<!-- <version>${swagger.version}</version>--> - </dependency> - <dependency> - <groupId>io.springfox</groupId> - <artifactId>springfox-swagger-ui</artifactId> - <version>2.9.2</version> -<!-- <version>${swagger.version}</version>--> - </dependency> - </dependencies> + <dependency> + <groupId>org.mapstruct</groupId> + <artifactId>mapstruct</artifactId> + <version>1.3.1.Final</version> + <!-- <version>${org.mapstruct.version}</version>--> + </dependency> - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - </plugin> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-collections4</artifactId> + <version>4.4</version> + </dependency> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.5.1</version> - <configuration> - <source>11</source> - <target>11</target> - <annotationProcessorPaths> - <path> - <groupId>org.mapstruct</groupId> - <artifactId>mapstruct-processor</artifactId> - <version>${org.mapstruct.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> + <!-- swagger --> + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger2</artifactId> + <version>2.9.2</version> + <!-- <version>${swagger.version}</version>--> + </dependency> + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger-ui</artifactId> + <version>2.9.2</version> + <!-- <version>${swagger.version}</version>--> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.5.1</version> + <configuration> + <source>11</source> + <target>11</target> + <annotationProcessorPaths> + <path> + <groupId>org.mapstruct</groupId> + <artifactId>mapstruct-processor</artifactId> + <version>${org.mapstruct.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index cc28f6ce91551581986380a0ab31a26a239795a6..b619423f9d55efb2c339c73d530961bb18b29851 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -23,31 +23,31 @@ public class DemoApplication { SpringApplication.run(DemoApplication.class, args); } - @Bean - CommandLineRunner anotherDemo(GameLevelRepository gameLevelRepository) { - return args -> { - - gameLevelRepository.deleteAll(); - - GameLevel gameLevel = new GameLevel(); - gameLevel.setTitle("Title"); - - - GameLevel savedGameLevel = gameLevelRepository.save(gameLevel); - log.info("Saved game level: {}", savedGameLevel); - - Optional<GameLevel> foundGameLevel = gameLevelRepository.findById(savedGameLevel.getId()); - log.info("Saved game level: {}", foundGameLevel); - }; - } - - @Bean - CommandLineRunner yetAnotherDemo(GameLevelService gameLevelService) { - return args -> { - - List<GameLevelDto> allGameLevels = gameLevelService.findAllGameLevels(); - allGameLevels.forEach(gameLevel -> log.info("Found game level with ID {} and title {}", gameLevel.getId(), - gameLevel.getTitle())); - }; - } +// @Bean +// CommandLineRunner anotherDemo(GameLevelRepository gameLevelRepository) { +// return args -> { +// +// gameLevelRepository.deleteAll(); +// +// GameLevel gameLevel = new GameLevel(); +// gameLevel.setTitle("Title"); +// +// +// GameLevel savedGameLevel = gameLevelRepository.save(gameLevel); +// log.info("Saved game level: {}", savedGameLevel); +// +// Optional<GameLevel> foundGameLevel = gameLevelRepository.findById(savedGameLevel.getId()); +// log.info("Saved game level: {}", foundGameLevel); +// }; +// } +// +// @Bean +// CommandLineRunner yetAnotherDemo(GameLevelService gameLevelService) { +// return args -> { +// +// List<GameLevelDto> allGameLevels = gameLevelService.findAllGameLevels(); +// allGameLevels.forEach(gameLevel -> log.info("Found game level with ID {} and title {}", gameLevel.getId(), +// gameLevel.getTitle())); +// }; +// } } diff --git a/src/main/java/com/example/demo/controller/GameDefinitionController.java b/src/main/java/com/example/demo/controller/GameDefinitionController.java new file mode 100644 index 0000000000000000000000000000000000000000..7b27160b9218bc46578170dd684a2cb9f4183ba4 --- /dev/null +++ b/src/main/java/com/example/demo/controller/GameDefinitionController.java @@ -0,0 +1,45 @@ +package com.example.demo.controller; + +import com.example.demo.dto.input.GameDefinitionCreateDto; +import com.example.demo.service.GameDefinitionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/game-definition") +@CrossOrigin(origins = "*", allowCredentials = "true", allowedHeaders = "*", + methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE, RequestMethod.PUT}) +@Api(value = "/game-definition", tags = {"Game Definition"}) +public class GameDefinitionController { + + private static final Logger LOG = LoggerFactory.getLogger(GameDefinitionController.class); + + private final GameDefinitionService gameDefinitionService; + + @Autowired + public GameDefinitionController(GameDefinitionService gameDefinitionService) { + this.gameDefinitionService = gameDefinitionService; + } + + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) + @ApiOperation(value = "Create a new game definition") + @ApiResponses(value = {@ApiResponse(code = 200, message = "New game definition created"), + @ApiResponse(code = 500, message = "Unexpected application error")}) + public GameDefinitionCreateDto createGameLevel(@ApiParam(value = "Game definition", required = true) @RequestBody(required = true) + GameDefinitionCreateDto gameLevelCreateDto) { + return gameDefinitionService.createGameDefinition(gameLevelCreateDto); + } +} diff --git a/src/main/java/com/example/demo/domain/AssessmentLevel.java b/src/main/java/com/example/demo/domain/AssessmentLevel.java index ac25e69aec3468329c819183999207253456dc08..a23406304403812b8de891285f2c5f83c9ec31cf 100644 --- a/src/main/java/com/example/demo/domain/AssessmentLevel.java +++ b/src/main/java/com/example/demo/domain/AssessmentLevel.java @@ -2,27 +2,12 @@ package com.example.demo.domain; import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; @Entity public class AssessmentLevel extends BaseLevel { - @Id - @GeneratedValue - private Long id; - private String assessmentType; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public String getAssessmentType() { return assessmentType; } @@ -33,9 +18,6 @@ public class AssessmentLevel extends BaseLevel { @Override public String toString() { - return "AssessmentLevel{" + - "id=" + id + - ", assessmentType='" + assessmentType + '\'' + - "} " + super.toString(); + return "AssessmentLevel{" + ", assessmentType='" + assessmentType + '\'' + "} " + super.toString(); } } diff --git a/src/main/java/com/example/demo/domain/Attachment.java b/src/main/java/com/example/demo/domain/Attachment.java index 0231a99b944326b83e0ad0822a8469cb48d28135..439aadede0be4925cc2036efaa11daf82112755e 100644 --- a/src/main/java/com/example/demo/domain/Attachment.java +++ b/src/main/java/com/example/demo/domain/Attachment.java @@ -1,8 +1,10 @@ package com.example.demo.domain; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.ManyToOne; import java.time.LocalDateTime; @Entity @@ -15,6 +17,9 @@ public class Attachment { private String content; private LocalDateTime creationTime; + @ManyToOne(fetch = FetchType.LAZY) + private GameLevel gameLevel; + public Long getId() { return id; } @@ -39,6 +44,14 @@ public class Attachment { this.creationTime = creationTime; } + public GameLevel getGameLevel() { + return gameLevel; + } + + public void setGameLevel(GameLevel gameLevel) { + this.gameLevel = gameLevel; + } + @Override public String toString() { return "Attachment{" + "id=" + id + ", content='" + content + '\'' + ", creationTime=" + creationTime + '}'; diff --git a/src/main/java/com/example/demo/domain/BaseLevel.java b/src/main/java/com/example/demo/domain/BaseLevel.java index adc11e1980145d81110b114fbd9469d70efa7b7a..37f6ddf3207333569f19d0aa0562210db44128d4 100644 --- a/src/main/java/com/example/demo/domain/BaseLevel.java +++ b/src/main/java/com/example/demo/domain/BaseLevel.java @@ -1,13 +1,32 @@ package com.example.demo.domain; -import javax.persistence.MappedSuperclass; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.ManyToOne; -@MappedSuperclass + +// good source for entity inheritance: http://blog.marcinchwedczuk.pl/mapping-inheritance-in-hibernate + +@Entity +@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class BaseLevel { + + @Id + @GeneratedValue + private Long id; + private String title; private String estimatedDuration; private Long maxScore; + private Integer orderInTrainingDefinition; + + @ManyToOne(fetch = FetchType.LAZY) + private UnityLevel unityLevel; public String getTitle() { return title; @@ -33,12 +52,33 @@ public abstract class BaseLevel { this.maxScore = maxScore; } + public Integer getOrderInTrainingDefinition() { + return orderInTrainingDefinition; + } + + public void setOrderInTrainingDefinition(Integer orderInTrainingDefinition) { + this.orderInTrainingDefinition = orderInTrainingDefinition; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public UnityLevel getUnityLevel() { + return unityLevel; + } + + public void setUnityLevel(UnityLevel unityLevel) { + this.unityLevel = unityLevel; + } + @Override public String toString() { - return "BaseLevel{" + - "title='" + title + '\'' + - ", estimatedDuration='" + estimatedDuration + '\'' + - ", maxScore=" + maxScore + - '}'; + return "BaseLevel{" + "title='" + title + '\'' + ", estimatedDuration='" + estimatedDuration + '\'' + + ", maxScore=" + maxScore + '}'; } } diff --git a/src/main/java/com/example/demo/domain/GameLevel.java b/src/main/java/com/example/demo/domain/GameLevel.java index fbbe2dbafb8509a90806e8b43036ad1836749f62..4edf0956a3d1511657bcc359f6eda581fe0b70fd 100644 --- a/src/main/java/com/example/demo/domain/GameLevel.java +++ b/src/main/java/com/example/demo/domain/GameLevel.java @@ -1,8 +1,10 @@ package com.example.demo.domain; +import javax.persistence.CascadeType; import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import javax.persistence.FetchType; +import javax.persistence.OneToMany; +import javax.persistence.OrderBy; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -11,28 +13,20 @@ import java.util.Objects; @Entity public class GameLevel extends BaseLevel { - @Id - @GeneratedValue - private Long id; - private String content; private boolean solutionPenalized; private String flag; private String solution; private Long incorrectFlagLimit; + @OrderBy + @OneToMany(mappedBy = "gameLevel", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) private List<Attachment> attachments; + @OrderBy + @OneToMany(mappedBy = "gameLevel", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) private List<Hint> hints; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public String getContent() { return content; } @@ -94,15 +88,8 @@ public class GameLevel extends BaseLevel { @Override public String toString() { - return "GameLevel{" + - "id=" + id + - ", content='" + content + '\'' + - ", solutionPenalized='" + solutionPenalized + '\'' + - ", flag='" + flag + '\'' + - ", solution='" + solution + '\'' + - ", attachments='" + attachments + '\'' + - ", incorrectFlagLimit='" + incorrectFlagLimit + '\'' + - ", hints=" + hints + - "} " + super.toString(); + return "GameLevel{" + ", content='" + content + '\'' + ", solutionPenalized='" + solutionPenalized + '\'' + + ", flag='" + flag + '\'' + ", solution='" + solution + '\'' + ", attachments='" + attachments + '\'' + + ", incorrectFlagLimit='" + incorrectFlagLimit + '\'' + ", hints=" + hints + "} " + super.toString(); } } diff --git a/src/main/java/com/example/demo/domain/Hint.java b/src/main/java/com/example/demo/domain/Hint.java index c820873d82ddba5103827a4d256f8a1a0c6d920a..40217ed6c3a9705e889f9b084790b1947ec04398 100644 --- a/src/main/java/com/example/demo/domain/Hint.java +++ b/src/main/java/com/example/demo/domain/Hint.java @@ -2,8 +2,10 @@ package com.example.demo.domain; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.ManyToOne; @Entity public class Hint { @@ -17,6 +19,9 @@ public class Hint { private Long hintPenalty; private Long orderInLevel; + @ManyToOne(fetch = FetchType.LAZY) + private GameLevel gameLevel; + public Long getId() { return id; } @@ -57,6 +62,14 @@ public class Hint { this.orderInLevel = orderInLevel; } + public GameLevel getGameLevel() { + return gameLevel; + } + + public void setGameLevel(GameLevel gameLevel) { + this.gameLevel = gameLevel; + } + @Override public String toString() { return "Hint{" + diff --git a/src/main/java/com/example/demo/domain/InfoLevel.java b/src/main/java/com/example/demo/domain/InfoLevel.java index 49de0947e65769e1186a0ddc801944eac59cf3e9..f862d56568337cac5e1e0aded78549f0754bea65 100644 --- a/src/main/java/com/example/demo/domain/InfoLevel.java +++ b/src/main/java/com/example/demo/domain/InfoLevel.java @@ -1,26 +1,12 @@ package com.example.demo.domain; import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; @Entity public class InfoLevel extends BaseLevel { - @Id - @GeneratedValue - private Long id; - private String content; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public String getContent() { return content; } @@ -31,9 +17,6 @@ public class InfoLevel extends BaseLevel { @Override public String toString() { - return "InfoLevel{" + - "id=" + id + - ", content='" + content + '\'' + - "} " + super.toString(); + return "InfoLevel{" + ", content='" + content + '\'' + "} " + super.toString(); } } diff --git a/src/main/java/com/example/demo/domain/UnityLevel.java b/src/main/java/com/example/demo/domain/UnityLevel.java new file mode 100644 index 0000000000000000000000000000000000000000..3b145a3844a9b997e43c1c44b39cbb940aa1a43b --- /dev/null +++ b/src/main/java/com/example/demo/domain/UnityLevel.java @@ -0,0 +1,22 @@ +package com.example.demo.domain; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.OrderBy; +import java.util.List; + +@Entity +public class UnityLevel { + + @Id + @GeneratedValue + private Long id; + + @OrderBy + @OneToMany(mappedBy = "unityLevel", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) + private List<BaseLevel> subLevels; +} diff --git a/src/main/java/com/example/demo/dto/BaseLevelDto.java b/src/main/java/com/example/demo/dto/BaseLevelDto.java index fb0ea942dee02d8855dc27d6a02a91704b1cbdf6..b00c134c7f363a25e3fdc23ef58a29ec7d5a13e6 100644 --- a/src/main/java/com/example/demo/dto/BaseLevelDto.java +++ b/src/main/java/com/example/demo/dto/BaseLevelDto.java @@ -2,12 +2,22 @@ package com.example.demo.dto; import java.io.Serializable; -public class BaseLevelDto implements Serializable { +public abstract class BaseLevelDto implements Serializable { + private Long id; private String title; + private Integer order; private String estimatedDuration; private Long maxScore; + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public String getTitle() { return title; } @@ -16,6 +26,14 @@ public class BaseLevelDto implements Serializable { this.title = title; } + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + public String getEstimatedDuration() { return estimatedDuration; } @@ -34,10 +52,7 @@ public class BaseLevelDto implements Serializable { @Override public String toString() { - return "BaseLevelDto{" + - "title='" + title + '\'' + - ", estimatedDuration='" + estimatedDuration + '\'' + - ", maxScore=" + maxScore + - '}'; + return "BaseLevelDto{" + "id=" + id + ", title='" + title + '\'' + ", order=" + order + + ", estimatedDuration='" + estimatedDuration + '\'' + ", maxScore=" + maxScore + '}'; } } diff --git a/src/main/java/com/example/demo/dto/input/GameDefinitionCreateDto.java b/src/main/java/com/example/demo/dto/input/GameDefinitionCreateDto.java new file mode 100644 index 0000000000000000000000000000000000000000..60ead66063b2b48054f81bc03a430810ac4cafd2 --- /dev/null +++ b/src/main/java/com/example/demo/dto/input/GameDefinitionCreateDto.java @@ -0,0 +1,14 @@ +package com.example.demo.dto.input; + +import lombok.Data; + +import java.util.List; + +@Data +public class GameDefinitionCreateDto { + private Long id; + private String title; + private Integer order; + private LevelType type; + private List<? extends GameDefinitionCreateDto> subLevels; +} diff --git a/src/main/java/com/example/demo/dto/input/LevelType.java b/src/main/java/com/example/demo/dto/input/LevelType.java new file mode 100644 index 0000000000000000000000000000000000000000..9b0c5cd37d5fc1527367e55a11f7c85a8d027bd0 --- /dev/null +++ b/src/main/java/com/example/demo/dto/input/LevelType.java @@ -0,0 +1,8 @@ +package com.example.demo.dto.input; + +public enum LevelType { + ASSESSMENT, + GAME, + INFO, + UNITY +} diff --git a/src/main/java/com/example/demo/service/GameDefinitionService.java b/src/main/java/com/example/demo/service/GameDefinitionService.java new file mode 100644 index 0000000000000000000000000000000000000000..3e343398e482dc3d00dc4bc2db64dadcb714c8e5 --- /dev/null +++ b/src/main/java/com/example/demo/service/GameDefinitionService.java @@ -0,0 +1,14 @@ +package com.example.demo.service; + +import com.example.demo.dto.input.GameDefinitionCreateDto; +import org.springframework.stereotype.Service; + +@Service +public class GameDefinitionService { + + public GameDefinitionCreateDto createGameDefinition(GameDefinitionCreateDto gameDefinitionCreateDto) { + + + return null; + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 13c2b023186d2e3a98bec9da1e5cadf30881c587..5e482e30f530847a5a70400fc2064b5c4c74333a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,5 @@ -spring.data.neo4j.username=neo4j -spring.data.neo4j.password=password - +#spring.datasource.url=jdbc:h2:mem:testdb +#spring.datasource.driverClassName=org.h2.Driver +#spring.datasource.username=sa +#spring.datasource.password=password +#spring.jpa.database-platform=org.hibernate.dialect.H2Dialect