-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47f3f6a
commit d4189f9
Showing
76 changed files
with
2,042 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...ain/java/com/kevinguanchedarias/owgejava/business/wiki/generator/DockerWikiGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.kevinguanchedarias.owgejava.business.wiki.generator; | ||
|
||
|
||
import com.github.dockerjava.api.DockerClient; | ||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public class DockerWikiGenerator { | ||
private final DockerClient dockerClient; | ||
} |
8 changes: 8 additions & 0 deletions
8
.../src/main/java/com/kevinguanchedarias/owgejava/business/wiki/generator/WikiGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.kevinguanchedarias.owgejava.business.wiki.generator; | ||
|
||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
public interface WikiGenerator { | ||
List<Path> generateFrontend(String backendUrl); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,27 +4,22 @@ | |
package com.kevinguanchedarias.owgejava.dto; | ||
|
||
import com.kevinguanchedarias.owgejava.entity.EntityWithImprovements; | ||
import org.hibernate.Hibernate; | ||
import com.kevinguanchedarias.owgejava.util.ImprovementDtoUtil; | ||
|
||
/** | ||
* | ||
* @since 0.8.0 | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @since 0.8.0 | ||
*/ | ||
public interface DtoWithImprovements { | ||
ImprovementDto getImprovement(); | ||
|
||
void setImprovement(ImprovementDto improvementDto); | ||
|
||
/** | ||
* | ||
* @since 0.8.0 | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @since 0.8.0 | ||
*/ | ||
default <K> void dtoFromEntity(EntityWithImprovements<K> entity) { | ||
if (Hibernate.isInitialized(entity.getImprovement()) && entity.getImprovement() != null) { | ||
setImprovement(new ImprovementDto()); | ||
getImprovement().dtoFromEntity(entity.getImprovement()); | ||
} | ||
setImprovement(ImprovementDtoUtil.dtoFromEntity(entity)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package com.kevinguanchedarias.owgejava.dto; | ||
|
||
import com.kevinguanchedarias.owgejava.entity.ImprovementUnitType; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class ImprovementUnitTypeDto implements DtoFromEntity<ImprovementUnitType> { | ||
private Integer id; | ||
private String type; | ||
|
@@ -20,83 +22,4 @@ public void dtoFromEntity(ImprovementUnitType entity) { | |
} | ||
value = entity.getValue(); | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @deprecated Use the unit type instead | ||
*/ | ||
@Deprecated(since = "0.9.0") | ||
public Integer getUnitTypeId() { | ||
return unitTypeId; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @deprecated Use the unit type instead | ||
*/ | ||
@Deprecated(since = "0.9.0") | ||
public void setUnitTypeId(Integer unitTypeId) { | ||
this.unitTypeId = unitTypeId; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @deprecated Use the unit type instead | ||
*/ | ||
@Deprecated(since = "0.9.0") | ||
public String getUnitTypeName() { | ||
return unitTypeName; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @deprecated Use the unit type instead | ||
*/ | ||
@Deprecated(since = "0.9.0") | ||
public void setUnitTypeName(String unitTypeName) { | ||
this.unitTypeName = unitTypeName; | ||
} | ||
|
||
/** | ||
* @return the unitType | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @since 0.9.0 | ||
*/ | ||
public UnitTypeDto getUnitType() { | ||
return unitType; | ||
} | ||
|
||
/** | ||
* @param unitType the unitType to set | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
*/ | ||
public void setUnitType(UnitTypeDto unitType) { | ||
this.unitType = unitType; | ||
} | ||
|
||
public Long getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(Long value) { | ||
this.value = value; | ||
} | ||
|
||
} |
148 changes: 29 additions & 119 deletions
148
business/src/main/java/com/kevinguanchedarias/owgejava/dto/SpecialLocationDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,130 +1,40 @@ | ||
package com.kevinguanchedarias.owgejava.dto; | ||
|
||
import com.kevinguanchedarias.owgejava.entity.Galaxy; | ||
import com.kevinguanchedarias.owgejava.entity.Planet; | ||
import com.kevinguanchedarias.owgejava.entity.SpecialLocation; | ||
import lombok.Data; | ||
|
||
/** | ||
* | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
* | ||
*/ | ||
@Data | ||
public class SpecialLocationDto extends CommonDtoWithImageStore<Integer, SpecialLocation> | ||
implements DtoWithImprovements { | ||
|
||
private ImprovementDto improvement; | ||
private Integer galaxyId; | ||
private String galaxyName; | ||
private Long assignedPlanetId; | ||
private String assignedPlanetName; | ||
|
||
@Override | ||
public void dtoFromEntity(SpecialLocation entity) { | ||
super.dtoFromEntity(entity); | ||
DtoWithImprovements.super.dtoFromEntity(entity); | ||
Galaxy galaxy = entity.getGalaxy(); | ||
if (galaxy != null) { | ||
galaxyId = galaxy.getId(); | ||
galaxyName = galaxy.getName(); | ||
} | ||
Planet assignedPlanet = entity.getAssignedPlanet(); | ||
if (assignedPlanet != null) { | ||
assignedPlanetId = assignedPlanet.getId(); | ||
assignedPlanetName = assignedPlanet.getName(); | ||
} | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
* @return the improvement | ||
*/ | ||
@Override | ||
public ImprovementDto getImprovement() { | ||
return improvement; | ||
} | ||
|
||
/** | ||
* @param improvement the improvement to set | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
*/ | ||
@Override | ||
public void setImprovement(ImprovementDto improvement) { | ||
this.improvement = improvement; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
* @return the galaxyId | ||
*/ | ||
public Integer getGalaxyId() { | ||
return galaxyId; | ||
} | ||
|
||
/** | ||
* @param galaxyId the galaxyId to set | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
*/ | ||
public void setGalaxyId(Integer galaxyId) { | ||
this.galaxyId = galaxyId; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
* @return the galaxyName | ||
*/ | ||
public String getGalaxyName() { | ||
return galaxyName; | ||
} | ||
|
||
/** | ||
* @param galaxyName the galaxyName to set | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
*/ | ||
public void setGalaxyName(String galaxyName) { | ||
this.galaxyName = galaxyName; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
* @return the assignedPlanetId | ||
*/ | ||
public Long getAssignedPlanetId() { | ||
return assignedPlanetId; | ||
} | ||
|
||
/** | ||
* @param assignedPlanetId the assignedPlanetId to set | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
*/ | ||
public void setAssignedPlanetId(Long assignedPlanetId) { | ||
this.assignedPlanetId = assignedPlanetId; | ||
} | ||
|
||
/** | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
* @return the assignedPlanetName | ||
*/ | ||
public String getAssignedPlanetName() { | ||
return assignedPlanetName; | ||
} | ||
|
||
/** | ||
* @param assignedPlanetName the assignedPlanetName to set | ||
* @author Kevin Guanche Darias | ||
* @since 0.9.0 | ||
*/ | ||
public void setAssignedPlanetName(String assignedPlanetName) { | ||
this.assignedPlanetName = assignedPlanetName; | ||
} | ||
|
||
implements DtoWithImprovements { | ||
|
||
private ImprovementDto improvement; | ||
private Integer galaxyId; | ||
private String galaxyName; | ||
private Long assignedPlanetId; | ||
private String assignedPlanetName; | ||
|
||
@Override | ||
public void dtoFromEntity(SpecialLocation entity) { | ||
super.dtoFromEntity(entity); | ||
DtoWithImprovements.super.dtoFromEntity(entity); | ||
loadGalaxy(entity); | ||
Planet assignedPlanet = entity.getAssignedPlanet(); | ||
if (assignedPlanet != null) { | ||
assignedPlanetId = assignedPlanet.getId(); | ||
assignedPlanetName = assignedPlanet.getName(); | ||
} | ||
} | ||
|
||
protected void loadGalaxy(SpecialLocation entity) { | ||
var galaxy = entity.getGalaxy(); | ||
if (galaxy != null) { | ||
galaxyId = galaxy.getId(); | ||
galaxyName = galaxy.getName(); | ||
} | ||
} | ||
} |
Oops, something went wrong.