Skip to content
Snippets Groups Projects
Commit 2e46b24e authored by Jan Tymel's avatar Jan Tymel
Browse files

Remove code related to hints

parent 1e69b769
No related branches found
No related tags found
No related merge requests found
...@@ -23,10 +23,6 @@ public class GameLevel extends BaseLevel { ...@@ -23,10 +23,6 @@ public class GameLevel extends BaseLevel {
@OneToMany(mappedBy = "gameLevel", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) @OneToMany(mappedBy = "gameLevel", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private List<Attachment> attachments; private List<Attachment> attachments;
@OrderBy
@OneToMany(mappedBy = "gameLevel", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private List<Hint> hints;
public String getContent() { public String getContent() {
return content; return content;
} }
...@@ -75,21 +71,10 @@ public class GameLevel extends BaseLevel { ...@@ -75,21 +71,10 @@ public class GameLevel extends BaseLevel {
this.incorrectFlagLimit = incorrectFlagLimit; this.incorrectFlagLimit = incorrectFlagLimit;
} }
public List<Hint> getHints() {
if (Objects.isNull(hints)) {
hints = new ArrayList<>();
}
return hints;
}
public void setHints(List<Hint> hints) {
this.hints = hints;
}
@Override @Override
public String toString() { public String toString() {
return "GameLevel{" + ", content='" + content + '\'' + ", solutionPenalized='" + solutionPenalized + '\'' + return "GameLevel{" + "content='" + content + '\'' + ", solutionPenalized=" + solutionPenalized + ", flag='" +
", flag='" + flag + '\'' + ", solution='" + solution + '\'' + ", attachments='" + attachments + '\'' + flag + '\'' + ", solution='" + solution + '\'' + ", incorrectFlagLimit=" + incorrectFlagLimit +
", incorrectFlagLimit='" + incorrectFlagLimit + '\'' + ", hints=" + hints + "} " + super.toString(); ", attachments=" + attachments + "} " + super.toString();
} }
} }
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 {
@Id
@GeneratedValue
private Long id;
private String title;
private String content;
private Long hintPenalty;
private Long orderInLevel;
@ManyToOne(fetch = FetchType.LAZY)
private GameLevel gameLevel;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Long getHintPenalty() {
return hintPenalty;
}
public void setHintPenalty(Long hintPenalty) {
this.hintPenalty = hintPenalty;
}
public Long getOrderInLevel() {
return orderInLevel;
}
public void setOrderInLevel(Long orderInLevel) {
this.orderInLevel = orderInLevel;
}
public GameLevel getGameLevel() {
return gameLevel;
}
public void setGameLevel(GameLevel gameLevel) {
this.gameLevel = gameLevel;
}
@Override
public String toString() {
return "Hint{" +
"id=" + id +
", title='" + title + '\'' +
", content='" + content + '\'' +
", hintPenalty='" + hintPenalty + '\'' +
", orderInLevel='" + orderInLevel + '\'' +
'}';
}
}
...@@ -13,7 +13,6 @@ public class GameLevelUpdateDto extends BaseLevelDto { ...@@ -13,7 +13,6 @@ public class GameLevelUpdateDto extends BaseLevelDto {
private Long incorrectFlagLimit; private Long incorrectFlagLimit;
private List<AttachmentDto> attachments; private List<AttachmentDto> attachments;
private List<HintDto> hints;
public String getContent() { public String getContent() {
return content; return content;
...@@ -63,17 +62,6 @@ public class GameLevelUpdateDto extends BaseLevelDto { ...@@ -63,17 +62,6 @@ public class GameLevelUpdateDto extends BaseLevelDto {
this.incorrectFlagLimit = incorrectFlagLimit; this.incorrectFlagLimit = incorrectFlagLimit;
} }
public List<HintDto> getHints() {
if (Objects.isNull(hints)) {
hints = new ArrayList<>();
}
return hints;
}
public void setHints(List<HintDto> hints) {
this.hints = hints;
}
@Override @Override
public String toString() { public String toString() {
return "GameLevelDto{" + return "GameLevelDto{" +
...@@ -83,7 +71,6 @@ public class GameLevelUpdateDto extends BaseLevelDto { ...@@ -83,7 +71,6 @@ public class GameLevelUpdateDto extends BaseLevelDto {
", solution='" + solution + '\'' + ", solution='" + solution + '\'' +
", attachments='" + attachments + '\'' + ", attachments='" + attachments + '\'' +
", incorrectFlagLimit='" + incorrectFlagLimit + '\'' + ", incorrectFlagLimit='" + incorrectFlagLimit + '\'' +
", hints=" + hints +
"} " + super.toString(); "} " + super.toString();
} }
} }
package com.example.demo.dto;
import java.io.Serializable;
public class HintDto implements Serializable {
private Long id;
private String title;
private String content;
private Long hintPenalty;
private Long orderInLevel;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Long getHintPenalty() {
return hintPenalty;
}
public void setHintPenalty(Long hintPenalty) {
this.hintPenalty = hintPenalty;
}
public Long getOrderInLevel() {
return orderInLevel;
}
public void setOrderInLevel(Long orderInLevel) {
this.orderInLevel = orderInLevel;
}
@Override
public String toString() {
return "HintDto{" +
"id=" + id +
", title='" + title + '\'' +
", content='" + content + '\'' +
", hintPenalty='" + hintPenalty + '\'' +
", orderInLevel='" + orderInLevel + '\'' +
'}';
}
}
package com.example.demo.dto.input; package com.example.demo.dto.input;
import com.example.demo.dto.AttachmentDto; import com.example.demo.dto.AttachmentDto;
import com.example.demo.dto.HintDto;
import java.util.List; import java.util.List;
...@@ -22,7 +21,6 @@ public class GameDefinitionCreateDto { ...@@ -22,7 +21,6 @@ public class GameDefinitionCreateDto {
private Long incorrectFlagLimit; private Long incorrectFlagLimit;
private List<AttachmentDto> attachments; private List<AttachmentDto> attachments;
private List<HintDto> hints;
// info level fields // info level fields
// currently none special // currently none special
...@@ -118,14 +116,6 @@ public class GameDefinitionCreateDto { ...@@ -118,14 +116,6 @@ public class GameDefinitionCreateDto {
this.attachments = attachments; this.attachments = attachments;
} }
public List<HintDto> getHints() {
return hints;
}
public void setHints(List<HintDto> hints) {
this.hints = hints;
}
public List<GameDefinitionCreateDto> getSubLevels() { public List<GameDefinitionCreateDto> getSubLevels() {
return subLevels; return subLevels;
} }
......
...@@ -2,9 +2,7 @@ package com.example.demo.mapper; ...@@ -2,9 +2,7 @@ package com.example.demo.mapper;
import com.example.demo.domain.AssessmentLevel; import com.example.demo.domain.AssessmentLevel;
import com.example.demo.domain.Attachment; import com.example.demo.domain.Attachment;
import com.example.demo.domain.BaseLevel;
import com.example.demo.domain.GameLevel; import com.example.demo.domain.GameLevel;
import com.example.demo.domain.Hint;
import com.example.demo.domain.InfoLevel; import com.example.demo.domain.InfoLevel;
import com.example.demo.domain.TrainingDefinition; import com.example.demo.domain.TrainingDefinition;
import com.example.demo.domain.UnityLevel; import com.example.demo.domain.UnityLevel;
...@@ -13,7 +11,6 @@ import com.example.demo.dto.AttachmentDto; ...@@ -13,7 +11,6 @@ import com.example.demo.dto.AttachmentDto;
import com.example.demo.dto.GameLevelCreateDto; import com.example.demo.dto.GameLevelCreateDto;
import com.example.demo.dto.GameLevelDto; import com.example.demo.dto.GameLevelDto;
import com.example.demo.dto.GameLevelUpdateDto; import com.example.demo.dto.GameLevelUpdateDto;
import com.example.demo.dto.HintDto;
import com.example.demo.dto.InfoLevelCreateDto; import com.example.demo.dto.InfoLevelCreateDto;
import com.example.demo.dto.InfoLevelDto; import com.example.demo.dto.InfoLevelDto;
import com.example.demo.dto.InfoLevelUpdateDto; import com.example.demo.dto.InfoLevelUpdateDto;
...@@ -60,13 +57,9 @@ public interface BeanMapper { ...@@ -60,13 +57,9 @@ public interface BeanMapper {
@Mapping(target = "orderInTrainingDefinition", source = "order") @Mapping(target = "orderInTrainingDefinition", source = "order")
InfoLevel toEntity(InfoLevelUpdateDto gameLevel); InfoLevel toEntity(InfoLevelUpdateDto gameLevel);
HintDto toDto(Hint hint); AttachmentDto toDto(Attachment attachment);
Hint toEntity(HintDto hint); Attachment toEntity(AttachmentDto attachment);
AttachmentDto toDto(Attachment hint);
Attachment toEntity(AttachmentDto hint);
UnityLevelDto toDto(UnityLevel unityLevel); UnityLevelDto toDto(UnityLevel unityLevel);
...@@ -97,7 +90,6 @@ public interface BeanMapper { ...@@ -97,7 +90,6 @@ public interface BeanMapper {
@Mapping(target = "trainingDefinition", ignore = true) @Mapping(target = "trainingDefinition", ignore = true)
@Mapping(target = "unityLevel", ignore = true) @Mapping(target = "unityLevel", ignore = true)
@Mapping(target = "attachments", ignore = true) // TODO not really sure about this @Mapping(target = "attachments", ignore = true) // TODO not really sure about this
@Mapping(target = "hints", ignore = true) // TODO not really sure about this
GameLevel updateGameLevel(@MappingTarget GameLevel gameLevel, GameDefinitionCreateDto gameDefinitionCreateDto); GameLevel updateGameLevel(@MappingTarget GameLevel gameLevel, GameDefinitionCreateDto gameDefinitionCreateDto);
@Mapping(target = "orderInTrainingDefinition", source = "order") @Mapping(target = "orderInTrainingDefinition", source = "order")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment