Skip to content

Commit

Permalink
MODLD-23: microservice base (Bibframe entity is abstract) (#1)
Browse files Browse the repository at this point in the history
* MODLD-23: microservice base (Bibframe entity is abstract)

* MODLD-23: minor renaming in swagger api & controller

* MODLD-23: code review remarks fixes

* MODLD-23: BibframeControllerIT added

* MODLD-23: IT common logic extracted

* MODLD-23: more tests added

* MODLD-23: local run config, profile and docker-compose added

* MODLD-23: local properties adjustment
  • Loading branch information
PBobylev committed May 16, 2023
1 parent 91be32c commit 34dea08
Show file tree
Hide file tree
Showing 48 changed files with 2,320 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
ij_continuation_indent_size = 2
indent_style = space
max_line_length = 120
insert_final_newline = true
trim_trailing_whitespace = true
17 changes: 11 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
.idea/
*.iml

node_modules/
/target

.settings/
.classpath
.project
.factorypath

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
Expand Down
16 changes: 16 additions & 0 deletions .run/LinkedDataApplication [Local].run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="LinkedDataApplication [Local]" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.folio.linked.data.LinkedDataApplication" />
<module name="mod-linked-data" />
<option name="VM_PARAMETERS" value="-Dspring.profiles.active=local" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.folio.linked.data.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
371 changes: 371 additions & 0 deletions checkstyle/checkstyle.xml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions descriptors/DeploymentDescriptor-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"srvcId": "@artifactId@-@version@",
"nodeId": "localhost",
"descriptor": {
"exec": "java -Dserver.port=%p -jar ../mod-linked-data/target/@artifactId@-@[email protected]"
}
}
77 changes: 77 additions & 0 deletions descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"id": "@artifactId@-@version@",
"name": "Linked Data Module",
"provides": [
{
"id": "bibframes",
"version": "0.1",
"handlers": [
{
"methods": [ "POST" ],
"pathPattern": "/bibframes",
"permissionsRequired": [ "linked.data.bibframe.post" ],
"modulePermissions": []
},
{
"methods": [ "GET" ],
"pathPattern": "/bibframes/{id}",
"permissionsRequired": [ "linked.data.bibframe.get" ],
"modulePermissions": []
}
]
},
{
"id": "_tenant",
"version": "1.0",
"interfaceType": "system",
"handlers": [
{
"methods": [ "POST" ],
"pathPattern": "/_/tenant",
"modulePermissions": []
},
{
"methods": [ "DELETE", "GET" ],
"pathPattern": "/_/tenant/{id}"
}
]
}
],
"requires": [],
"permissionSets": [
{
"permissionName": "linked.data.bibframe.post",
"displayName": "LinkedData - creates a Bibframe record",
"description": "Creates an Bibframe"
},
{
"permissionName": "linked.data.bibframe.get",
"displayName": "LinkedData - reads a Bibframe record",
"description": "Reads a Bibframe"
}
],
"launchDescriptor": {
"dockerImage": "@artifactId@:@version@",
"dockerPull": false,
"dockerArgs": {
"HostConfig": {
"Memory": 1073741824,
"PortBindings": { "8081/tcp": [ { "HostPort": "%p" } ] }
}
},
"env": [
{ "name": "ENV", "value": "folio" },
{ "name": "JAVA_OPTIONS", "value": "-XX:MaxRAMPercentage=85.0" },
{ "name": "DB_HOST", "value": "postgres" },
{ "name": "DB_PORT", "value": "5432" },
{ "name": "DB_USERNAME", "value": "folio_admin" },
{ "name": "DB_PASSWORD", "value": "folio_admin" },
{ "name": "DB_DATABASE", "value": "okapi_modules" },
{ "name": "DB_QUERYTIMEOUT", "value": "60000" },
{ "name": "DB_CHARSET", "value": "UTF-8" },
{ "name": "DB_MAXPOOLSIZE", "value": "5" },
{ "name": "INITIAL_LANGUAGES", "value": "eng" },
{ "name": "SYSTEM_USER_PASSWORD", "value": "Mod-linked-data-1-0-0" }
]
}
}
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.8'
services:
db:
image: postgres:12-alpine
restart: always
environment:
- POSTGRES_DB=okapi_modules
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- '5432:5432'
volumes:
- db:/var/lib/postgresql/data
volumes:
db:
driver: local
3 changes: 3 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lombok.addLombokGeneratedAnnotation = true
lombok.anyconstructor.addconstructorproperties = true
lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier
Loading

0 comments on commit 34dea08

Please sign in to comment.