-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mapping for services, product and gsbpm
- Loading branch information
Showing
7 changed files
with
162 additions
and
14 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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/fr/insee/knowledge/git/access/GsbpmDataAccess.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,26 @@ | ||
package fr.insee.knowledge.git.access; | ||
|
||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import fr.insee.knowledge.domain.Gsbpm; | ||
import fr.insee.knowledge.domain.KnowledgeFile; | ||
|
||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
@org.springframework.stereotype.Service | ||
public class GsbpmDataAccess { | ||
|
||
public List<Gsbpm> serializeFromFile(KnowledgeFile resource) throws IOException { | ||
|
||
ObjectMapper objectMapper = new ObjectMapper(); | ||
List<Gsbpm> gsbpms; | ||
gsbpms = objectMapper.readValue(new File(resource.getPath()), new TypeReference<List<Gsbpm>>() {}); | ||
return gsbpms; | ||
|
||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/fr/insee/knowledge/git/access/ProductDataAccess.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,25 @@ | ||
package fr.insee.knowledge.git.access; | ||
|
||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import fr.insee.knowledge.domain.KnowledgeFile; | ||
import fr.insee.knowledge.domain.Product; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
@org.springframework.stereotype.Service | ||
public class ProductDataAccess { | ||
|
||
public List<Product> serializeFromFile(KnowledgeFile resource) throws IOException { | ||
|
||
ObjectMapper objectMapper = new ObjectMapper(); | ||
List<Product> products; | ||
products = objectMapper.readValue(new File(resource.getPath()), new TypeReference<List<Product>>() {}); | ||
return products; | ||
|
||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...wledge/data/access/ServiceDataAccess.java → ...owledge/git/access/ServiceDataAccess.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