fix model

This commit is contained in:
2025-10-17 00:37:26 +02:00
parent 23262d8be6
commit 22cc3166bd
13 changed files with 68 additions and 16 deletions

View File

@@ -22,7 +22,7 @@ ENTITY_PKG=de.infinimotion.bean
ProjectVariable.MAVEN_ARTIFACT_ID=model
ProjectVariable.MAVEN_GROUP_ID=de.infinimotion
ProjectVariable.PROJECT_NAME=infinimodel
ProjectVariable.PROJECT_VERSION=0.0.0
ProjectVariable.PROJECT_VERSION=0.0.3
ProjectVariable.REST_SERVER_PORT=3000
ProjectVariable.REST_API_ROOT=/api/v1
ProjectVariable.REST_URL_ROOT=http://localhost:3000

View File

@@ -3,7 +3,7 @@
* Created on $now.date ( $now.time )
* Generated by $generator.name ( version $generator.version )
*/
package ${target.javaPackageFromFolder(${SRC})};
package ${target.javaPackageFromFolder("backend/${SRC}")};
import java.io.Serializable;

View File

@@ -30,4 +30,12 @@
</plugins>
</build>
<distributionManagement>
<repository>
<id>gitea</id>
<name>InfiniMotion Apache Maven Packages</name>
<url>https://git.chequeo.de/api/packages/infinimotion/maven</url>
</repository>
</distributionManagement>
</project>

View File

@@ -1 +1 @@
@InfiniMotion:registry=https://npm.pkg.github.com
@infinimotion:registry=https://git.chequeo.de/api/packages/infinimotion/npm/

View File

@@ -1,6 +0,0 @@
#set( $env.language = 'TypeScript' )
export default interface $entity.name {
#foreach( $attribute in $entity.attributes )
${attribute.name}: ${attribute.type};
#end
}

View File

@@ -0,0 +1,13 @@
#set( $env.language = 'TypeScript' )
#foreach( $link in $entity.links )
import $link.fieldType from "./${link.fieldType}";
#end
export default interface $entity.name {
#foreach( $attribute in $entity.attributes )
${attribute.name}: ${attribute.type};
#end
#foreach( $link in $entity.links )
${link.fieldName}: ${link.fieldType};
#end
}

View File

@@ -1,6 +1,6 @@
{
"name": "@InfiniMotion/model-frontend",
"version": "0.0.0",
"name": "@infinimotion/model-frontend",
"version": "$fn.get("PROJECT_VERSION","0.0.0")",
"description": "InfiniMotion Model for Frontend",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
@@ -22,6 +22,6 @@
},
"repository": "https://github.com/InfiniMotion/model.git",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
"registry": "https://git.chequeo.de/api/packages/infinimotion/npm/"
}
}

View File

@@ -2,7 +2,7 @@
#parse("persistence/include/init_var_entity.vm")
#parse("persistence/include/java_header.vm")
##--------------------------------------------------------------------------------------------------------
package ${target.javaPackageFromFolder($SRC)};
package ${target.javaPackageFromFolder("persistence/${SRC}")};
import java.io.Serializable;

View File

@@ -26,7 +26,7 @@
## #set($jpa.oneToManyFetchType = "EAGER" )
## #set($jpa.manyToManyFetchType = "EAGER" )
##---------------------------------------------------------------------------------------
package ${target.javaPackageFromFolder(${SRC})};
package ${target.javaPackageFromFolder("persistence/${SRC}")};
## IF ENTITY HAS A COMPOSITE PRIMARY KEY => GENERATE AN 'ID CLASS' FOR THIS PRIMARY KEY
#if ( $entity.hasCompositePrimaryKey() )
$generator.generate($target.entityName , "${jpaEntityIdClass}.java", $target.folder, "persistence/persistence_entity_id_java.vm" )

View File

@@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>$fn.get("MAVEN_GROUP_ID","to.be.defined")</groupId>
<artifactId>$fn.get("MAVEN_ARTIFACT_ID","to.be.defined")-persistence</artifactId>
<version>$fn.get("PROJECT_VERSION","1.0.0")</version>
<version>$fn.get("PROJECT_VERSION","0.0.0")</version>
<packaging>jar</packaging>
<properties>
@@ -38,4 +38,12 @@
</plugins>
</build>
<distributionManagement>
<repository>
<id>gitea</id>
<name>InfiniMotion Apache Maven Packages</name>
<url>https://git.chequeo.de/api/packages/infinimotion/maven</url>
</repository>
</distributionManagement>
</project>

View File

@@ -20,7 +20,7 @@ package.json ; package.json ; frontend
tsconfig.json ; tsconfig.json ; frontend ; frontend/tsconfig_json.vm ; 1
tsup.config.ts ; tsup.config.ts ; frontend ; frontend/tsup.config_ts.vm ; 1
index.ts ; index.ts ; frontend ; frontend/index_ts.vm ; 1
TypeScript Models ; ${BEANNAME}.ts ; frontend ; frontend/Xmodel_ts.vm
TypeScript Models ; ${BEANNAME}.ts ; frontend ; frontend/frontend_entity_ts.vm
### Backend ###
Java Backend Models ; ${BEANNAME}.java ; backend/${SRC}/${ROOT_PKG}/backend ; backend/backend_entity_java.vm

26
build-all.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
latest=$(npm view @infinimotion/model-frontend --registry https://git.chequeo.de/api/packages/infinimotion/npm/ | grep latest)
latest=($latest)
version=${latest[1]}
major=$(cut -d'.' -f1 <<<"$version")
minor=$(cut -d'.' -f2 <<<"$version")
patch=$(cut -d'.' -f3 <<<"$version")
new_patch=$((patch+1))
new_version=$major.$minor.$new_patch
version_cfg="ProjectVariable\.PROJECT_VERSION=[0-9]*\.[0-9]*\.[0-9]*$"
new_version_cfg="ProjectVariable.PROJECT_VERSION="$new_version
echo "Changing version..."
sed -i -E -e "s/"$version_cfg"/"$new_version_cfg"/g" ./TelosysTools/telosys-tools.cfg
echo $version" -> "$new_version
java -jar /c/Program\ Files/telosys-cli/telosys-cli-4.2.0-001.jar -h . -i input-telosys-cli.txt
(cd frontend && npm install && tsup && npm publish)
(cd backend && mvn package deploy)
(cd persistence && mvn package deploy)
echo "Published new version "$new_version

3
input-telosys-cli.txt Normal file
View File

@@ -0,0 +1,3 @@
gen * * -y
q