-
Notifications
You must be signed in to change notification settings - Fork 3
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
26d300a
commit e757d70
Showing
46 changed files
with
715 additions
and
386 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>org.robbins.flashcards</groupId> | ||
<artifactId>FlashCards_App</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>FlashCards_API</artifactId> | ||
<name>FlashCards_API</name> | ||
<description>FlashCards_API description</description> | ||
<properties> | ||
<skip.coveralls>true</skip.coveralls> | ||
<skip.cobertura>true</skip.cobertura> | ||
</properties> | ||
<scm> | ||
<connection>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</connection> | ||
<url>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</url> | ||
<developerConnection>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</developerConnection> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.robbins.flashcards</groupId> | ||
<artifactId>FlashCards_DTO</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<finalName>FlashCards_API</finalName> | ||
</build> | ||
</project> |
File renamed without changes.
11 changes: 4 additions & 7 deletions
11
...ns/flashcards/facade/FlashcardFacade.java → ...ns/flashcards/facade/FlashcardFacade.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
11 changes: 11 additions & 0 deletions
11
FlashCards_API/src/main/java/org/robbins/flashcards/facade/TagFacade.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,11 @@ | ||
|
||
package org.robbins.flashcards.facade; | ||
|
||
import org.robbins.flashcards.dto.TagDto; | ||
import org.robbins.flashcards.exceptions.ServiceException; | ||
import org.robbins.flashcards.facade.base.GenericCrudFacade; | ||
|
||
public interface TagFacade extends GenericCrudFacade<TagDto> { | ||
|
||
TagDto findByName(String name) throws ServiceException; | ||
} |
11 changes: 11 additions & 0 deletions
11
FlashCards_API/src/main/java/org/robbins/flashcards/facade/UserFacade.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,11 @@ | ||
|
||
package org.robbins.flashcards.facade; | ||
|
||
import org.robbins.flashcards.dto.UserDto; | ||
import org.robbins.flashcards.exceptions.ServiceException; | ||
import org.robbins.flashcards.facade.base.GenericCrudFacade; | ||
|
||
public interface UserFacade extends GenericCrudFacade<UserDto> { | ||
|
||
UserDto findUserByOpenid(String openid) throws ServiceException; | ||
} |
File renamed without changes.
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,31 @@ | ||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>org.robbins.flashcards</groupId> | ||
<artifactId>FlashCards_App</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>FlashCards_Client</artifactId> | ||
<name>FlashCards_Client</name> | ||
<description>FlashCards_Client description</description> | ||
<properties> | ||
<skip.coveralls>true</skip.coveralls> | ||
<skip.cobertura>true</skip.cobertura> | ||
</properties> | ||
<scm> | ||
<connection>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</connection> | ||
<url>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</url> | ||
<developerConnection>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</developerConnection> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.robbins.flashcards</groupId> | ||
<artifactId>FlashCards_Domain</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<finalName>FlashCards_Client</finalName> | ||
</build> | ||
</project> |
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,45 @@ | ||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>org.robbins.flashcards</groupId> | ||
<artifactId>FlashCards_App</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>FlashCards_DTO</artifactId> | ||
<name>FlashCards_DTO</name> | ||
<description>FlashCards_DTO description</description> | ||
<properties> | ||
<skip.coveralls>true</skip.coveralls> | ||
<skip.cobertura>true</skip.cobertura> | ||
</properties> | ||
<scm> | ||
<connection>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</connection> | ||
<url>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</url> | ||
<developerConnection>scm:git:git@github.com:justinhrobbins/FlashCards_App.git</developerConnection> | ||
</scm> | ||
<dependencies> | ||
<!-- Spring data commons for Auditable and Persistable --> | ||
<dependency> | ||
<groupId>org.springframework.data</groupId> | ||
<artifactId>spring-data-commons-core</artifactId> | ||
</dependency> | ||
|
||
<!-- Jackson dependencies --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<finalName>FlashCards_DTO</finalName> | ||
</build> | ||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
11 changes: 4 additions & 7 deletions
11
...ns/flashcards/facade/base/CrudFacade.java → ...s/flashcards/conversion/DtoConverter.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
18 changes: 18 additions & 0 deletions
18
...ds_Service/src/main/java/org/robbins/flashcards/conversion/impl/AbstractDtoConverter.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,18 @@ | ||
package org.robbins.flashcards.conversion.impl; | ||
|
||
import org.dozer.Mapper; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class AbstractDtoConverter { | ||
@Inject | ||
private Mapper mapper; | ||
|
||
public Mapper getMapper() { | ||
return mapper; | ||
} | ||
|
||
public void setMapper(final Mapper mapper) { | ||
this.mapper = mapper; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...ce/src/main/java/org/robbins/flashcards/conversion/impl/DefaultFlashcardDtoConverter.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,54 @@ | ||
package org.robbins.flashcards.conversion.impl; | ||
|
||
|
||
import org.robbins.flashcards.conversion.DtoConverter; | ||
import org.robbins.flashcards.dto.FlashCardDto; | ||
import org.robbins.flashcards.exceptions.ServiceException; | ||
import org.robbins.flashcards.model.FlashCard; | ||
import org.robbins.flashcards.service.util.DtoUtil; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
@Component("flashcardDtoConverter") | ||
public class DefaultFlashcardDtoConverter extends AbstractDtoConverter implements DtoConverter<FlashCardDto, FlashCard> { | ||
@Override | ||
public FlashCardDto getDto(final FlashCard entity) throws ServiceException { | ||
return getDto(entity, null); | ||
} | ||
|
||
@Override | ||
public FlashCardDto getDto(final FlashCard entity, final Set<String> fields) | ||
throws ServiceException { | ||
FlashCardDto flashCardDto = getMapper().map(entity, FlashCardDto.class); | ||
DtoUtil.filterFields(flashCardDto, fields); | ||
return flashCardDto; | ||
} | ||
|
||
@Override | ||
public FlashCard getEntity(final FlashCardDto dto) { | ||
return getMapper().map(dto, FlashCard.class); | ||
} | ||
|
||
@Override | ||
public List<FlashCardDto> getDtos(final List<FlashCard> entities, | ||
final Set<String> fields) | ||
throws ServiceException { | ||
List<FlashCardDto> dtos = new ArrayList<>(); | ||
for (FlashCard entity : entities) { | ||
dtos.add(getDto(entity)); | ||
} | ||
return dtos; | ||
} | ||
|
||
@Override | ||
public List<FlashCard> getEtnties(final List<FlashCardDto> dtos) { | ||
List<FlashCard> entities = new ArrayList<>(); | ||
for (FlashCardDto dto : dtos) { | ||
entities.add(getEntity(dto)); | ||
} | ||
return entities; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
..._Service/src/main/java/org/robbins/flashcards/conversion/impl/DefaultTagDtoConverter.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,53 @@ | ||
package org.robbins.flashcards.conversion.impl; | ||
|
||
import org.robbins.flashcards.conversion.DtoConverter; | ||
import org.robbins.flashcards.dto.TagDto; | ||
import org.robbins.flashcards.exceptions.ServiceException; | ||
import org.robbins.flashcards.model.Tag; | ||
import org.robbins.flashcards.service.util.DtoUtil; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
@Component("tagDtoConverter") | ||
public class DefaultTagDtoConverter extends AbstractDtoConverter implements DtoConverter<TagDto, Tag> { | ||
|
||
@Override | ||
public TagDto getDto(final Tag entity) throws ServiceException { | ||
return getDto(entity, null); | ||
} | ||
|
||
@Override | ||
public TagDto getDto(final Tag entity, final Set<String> fields) | ||
throws ServiceException { | ||
TagDto tagDto = getMapper().map(entity, TagDto.class); | ||
DtoUtil.filterFields(tagDto, fields); | ||
return tagDto; | ||
} | ||
|
||
@Override | ||
public Tag getEntity(final TagDto dto) { | ||
return getMapper().map(dto, Tag.class); | ||
} | ||
|
||
@Override | ||
public List<TagDto> getDtos(final List<Tag> entities, final Set<String> fields) | ||
throws ServiceException { | ||
List<TagDto> dtos = new ArrayList<>(); | ||
for (Tag entity : entities) { | ||
dtos.add(getDto(entity, fields)); | ||
} | ||
return dtos; | ||
} | ||
|
||
@Override | ||
public List<Tag> getEtnties(final List<TagDto> dtos) { | ||
List<Tag> entities = new ArrayList<>(); | ||
for (TagDto dto : dtos) { | ||
entities.add(getEntity(dto)); | ||
} | ||
return entities; | ||
} | ||
} |
Oops, something went wrong.