Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
27d74f15
提交
27d74f15
编写于
7月 16, 2022
作者:
ibiz4j
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
接口实体
上级
44178267
变更
6
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
58 行增加
和
31 行删除
+58
-31
ActionModel.java
...e/src/main/java/cn/ibizlab/codegen/model/ActionModel.java
+23
-0
{{entities@NONE}}.java.hbs
...ckageName}}/{{modules}}/domain/{{entities@NONE}}.java.hbs
+1
-1
{{entities@NoSQL}}.java.hbs
...kageName}}/{{modules}}/domain/{{entities@NoSQL}}.java.hbs
+1
-1
{{entities@SQL}}.java.hbs
...ackageName}}/{{modules}}/domain/{{entities@SQL}}.java.hbs
+1
-1
{{entities@ServiceAPI}}.java.hbs
...ame}}/{{modules}}/domain/{{entities@ServiceAPI}}.java.hbs
+1
-1
{{entities@ServiceAPI}}Service.java.hbs
...modules}}/service/{{entities@ServiceAPI}}Service.java.hbs
+31
-27
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ActionModel.java
浏览文件 @
27d74f15
...
@@ -73,6 +73,29 @@ public class ActionModel extends BaseModel{
...
@@ -73,6 +73,29 @@ public class ActionModel extends BaseModel{
return
true
;
return
true
;
}
}
public
boolean
isListReturn
()
{
if
(
getDEAction
().
getPSDEActionReturn
()==
null
)
return
false
;
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
true
;
return
false
;
}
public
String
typeReturn
()
{
if
(
isListReturn
())
{
if
(
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
;
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
this
.
getEntity
().
getCodeName
();
}
return
""
;
}
public
String
getOutParam
()
public
String
getOutParam
()
{
{
String
param
=
this
.
getEntity
().
getCodeName
();
String
param
=
this
.
getEntity
().
getCodeName
();
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities@NONE}}.java.hbs
浏览文件 @
27d74f15
...
@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
...
@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/
*/
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
lowerCase
n
ame
}}
",
{{
camelCase
codeName
}}
);
this.modify("
{{
jsonN
ame
}}
",
{{
camelCase
codeName
}}
);
}
}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities@NoSQL}}.java.hbs
浏览文件 @
27d74f15
...
@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
...
@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/
*/
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
lowerCase
n
ame
}}
",
{{
camelCase
codeName
}}
);
this.modify("
{{
jsonN
ame
}}
",
{{
camelCase
codeName
}}
);
}
}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities@SQL}}.java.hbs
浏览文件 @
27d74f15
...
@@ -114,7 +114,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
...
@@ -114,7 +114,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/
*/
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
lowerCase
n
ame
}}
",
{{
camelCase
codeName
}}
);
this.modify("
{{
jsonN
ame
}}
",
{{
camelCase
codeName
}}
);
}
}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities@ServiceAPI}}.java.hbs
浏览文件 @
27d74f15
...
@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
...
@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/
*/
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
public void set
{{
pascalCase
codeName
}}
(
{{
type
.
java
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
this.modify("
{{
lowerCase
n
ame
}}
",
{{
camelCase
codeName
}}
);
this.modify("
{{
jsonN
ame
}}
",
{{
camelCase
codeName
}}
);
}
}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
{{/
unless
}}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/ibiz-boot/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/service/{{entities@ServiceAPI}}Service.java.hbs
浏览文件 @
27d74f15
...
@@ -19,7 +19,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
...
@@ -19,7 +19,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import net.ibizsys.central.util.ISearchContextDTO;
import net.ibizsys.central.util.ISearchContextDTO;
import net.ibizsys.model.dataentity.action.IPSDEAction;
import net.ibizsys.model.dataentity.action.IPSDEAction;
import net.ibizsys.model.dataentity.ds.IPSDEDataSet;
import net.ibizsys.model.dataentity.ds.IPSDEDataSet;
import net.ibizsys.central.plugin.boot.core.service.I
Base
Service;
import net.ibizsys.central.plugin.boot.core.service.I
ServiceApi
Service;
import net.ibizsys.central.plugin.boot.core.helper.CachedBeanCopier;
import net.ibizsys.central.plugin.boot.core.helper.CachedBeanCopier;
import net.ibizsys.central.plugin.boot.core.helper.SpringContextHolder;
import net.ibizsys.central.plugin.boot.core.helper.SpringContextHolder;
import net.ibizsys.central.dataentity.IDataEntityRuntimeContext;
import net.ibizsys.central.dataentity.IDataEntityRuntimeContext;
...
@@ -35,7 +35,7 @@ import {{packageName}}.{{module}}.service.{{codeName}}Service;
...
@@ -35,7 +35,7 @@ import {{packageName}}.{{module}}.service.{{codeName}}Service;
{{#
dsName
}}
{{#
dsName
}}
@DS("
{{
entity
.
dataSource
}}
")
@DS("
{{
entity
.
dataSource
}}
")
{{/
dsName
}}
{{/
dsName
}}
public interface
{{
entity
.
codeName
}}
Service extends I
Base
Service
<
{{
entity
.
codeName
}}
,
{{
entity
.
codeName
}}
SearchContext
>
{
public interface
{{
entity
.
codeName
}}
Service extends I
ServiceApi
Service
<
{{
entity
.
codeName
}}
,
{{
entity
.
codeName
}}
SearchContext
>
{
@Override
@Override
default String getDataEntityId() {
default String getDataEntityId() {
...
@@ -47,31 +47,31 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
...
@@ -47,31 +47,31 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
}
}
default boolean create(
{{
entity
.
codeName
}}
dto) throws Throwable {
default boolean create(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.create(dto);
return I
ServiceApi
Service.super.create(dto);
}
}
default boolean onCreate(
{{
entity
.
codeName
}}
dto) throws Throwable {
default boolean onCreate(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.onCreate(dto);
return I
ServiceApi
Service.super.onCreate(dto);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
{{/
enableEntityCache
}}
default boolean update(
{{
entity
.
codeName
}}
dto) throws Throwable {
default boolean update(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.update(dto);
return I
ServiceApi
Service.super.update(dto);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
{{/
enableEntityCache
}}
default boolean onUpdate(
{{
entity
.
codeName
}}
dto) throws Throwable {
default boolean onUpdate(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.onUpdate(dto);
return I
ServiceApi
Service.super.onUpdate(dto);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
{{/
enableEntityCache
}}
default boolean remove(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
default boolean remove(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
return I
Base
Service.super.remove(key);
return I
ServiceApi
Service.super.remove(key);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
...
@@ -80,81 +80,85 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
...
@@ -80,81 +80,85 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
default boolean onRemove(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
default boolean onRemove(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
List keys=new ArrayList();
List keys=new ArrayList();
keys.add(key);
keys.add(key);
return I
Base
Service.super.onRemove(keys);
return I
ServiceApi
Service.super.onRemove(keys);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
{{/
enableEntityCache
}}
default boolean remove(List keys) throws Throwable {
default boolean remove(List keys) throws Throwable {
return I
Base
Service.super.remove(keys);
return I
ServiceApi
Service.super.remove(keys);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
{{/
enableEntityCache
}}
default boolean onRemove(List keys) throws Throwable {
default boolean onRemove(List keys) throws Throwable {
return I
Base
Service.super.onRemove(keys);
return I
ServiceApi
Service.super.onRemove(keys);
}
}
default
{{
entity
.
codeName
}}
get(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
default
{{
entity
.
codeName
}}
get(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
return I
Base
Service.super.get(key);
return I
ServiceApi
Service.super.get(key);
}
}
default
{{
entity
.
codeName
}}
onGet(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
default
{{
entity
.
codeName
}}
onGet(
{{
entity
.
keyField
.
type
.
java
}}
key) throws Throwable {
return I
Base
Service.super.onGet(key);
return I
ServiceApi
Service.super.onGet(key);
}
}
default
{{
entity
.
codeName
}}
getDraft(
{{
entity
.
codeName
}}
dto) throws Throwable {
default
{{
entity
.
codeName
}}
getDraft(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.getDraft(dto);
return I
ServiceApi
Service.super.getDraft(dto);
}
}
default
{{
entity
.
codeName
}}
onGetDraft(
{{
entity
.
codeName
}}
dto) throws Throwable {
default
{{
entity
.
codeName
}}
onGetDraft(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.onGetDraft(dto);
return I
ServiceApi
Service.super.onGetDraft(dto);
}
}
default Integer checkKey(
{{
entity
.
codeName
}}
dto) throws Throwable {
default Integer checkKey(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.checkKey(dto);
return I
ServiceApi
Service.super.checkKey(dto);
}
}
default Integer onCheckKey(
{{
entity
.
codeName
}}
dto) throws Throwable {
default Integer onCheckKey(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.onCheckKey(dto);
return I
ServiceApi
Service.super.onCheckKey(dto);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
{{/
enableEntityCache
}}
default boolean save(
{{
entity
.
codeName
}}
dto) throws Throwable {
default boolean save(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.save(dto);
return I
ServiceApi
Service.super.save(dto);
}
}
{{#
enableEntityCache
}}
{{#
enableEntityCache
}}
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
@CacheEvict(value = "
{{
lowerCase
entity
.
codeName
}}
", allEntries = true)
{{/
enableEntityCache
}}
{{/
enableEntityCache
}}
default boolean onSave(
{{
entity
.
codeName
}}
dto) throws Throwable {
default boolean onSave(
{{
entity
.
codeName
}}
dto) throws Throwable {
return I
Base
Service.super.onSave(dto);
return I
ServiceApi
Service.super.onSave(dto);
}
}
{{#
each
entity
.
extActions
}}
{{#
each
entity
.
extActions
}}
default
{{
outParam
}}
{{
camelCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
default
{{
outParam
}}
{{
camelCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
{{#if
voidReturn
}}
I
Base
Service.super.callAction("
{{
codeName
}}
",
{{
inParamName
}}
);
I
ServiceApi
Service.super.callAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
return
{{
inParamName
}}
;
{{else}}
{{else}}
I
Base
Service.super.beforeAction("
{{
codeName
}}
",
{{
inParamName
}}
);
I
ServiceApi
Service.super.beforeAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{
outParam
}}
rt = (
{{
outParam
}}
)I
Base
Service.super.forwardAction("
{{
name
}}
",
{{
inParamName
}}
);
{{
outParam
}}
rt = (
{{
outParam
}}
)I
ServiceApi
Service.super.forwardAction("
{{
name
}}
",
{{
inParamName
}}
);
if(rt!=null)
if(rt!=null)
I
Base
Service.super.afterAction("
{{
codeName
}}
",rt);
I
ServiceApi
Service.super.afterAction("
{{
codeName
}}
",rt);
return rt;
return rt;
{{/if}}
{{/if}}
}
}
default
{{
outParam
}}
on
{{
pascalCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
default
{{
outParam
}}
on
{{
pascalCase
codeName
}}
(
{{
inParam
}}
{{
inParamName
}}
) throws Throwable {
{{#if
voidReturn
}}
{{#if
voidReturn
}}
I
Base
Service.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
I
ServiceApi
Service.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
return
{{
inParamName
}}
;
return
{{
inParamName
}}
;
{{else}}
{{else}}
return (
{{
outParam
}}
)IBaseService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
);
{{#if
listReturn
}}
return IServiceApiService.super.onRealActionList("
{{
codeName
}}
",
{{
inParamName
}}
,
{{
typeReturn
}}
.class);
{{else}}
return IServiceApiService.super.onRealAction("
{{
codeName
}}
",
{{
inParamName
}}
,
{{
outParam
}}
.class);
{{/if}}
{{/if}}
{{/if}}
}
}
...
@@ -162,12 +166,12 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
...
@@ -162,12 +166,12 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
{{#
entity
.
dataSets
}}
{{#
entity
.
dataSets
}}
default Page
<
{{
entity
.
codeName
}}
>
fetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
default Page
<
{{
entity
.
codeName
}}
>
fetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
I
Base
Service.super.beforeFetch("
{{
codeName
}}
",dto);
I
ServiceApi
Service.super.beforeFetch("
{{
codeName
}}
",dto);
return (Page) I
Base
Service.super.forwardFetch("
{{
name
}}
",dto);
return (Page) I
ServiceApi
Service.super.forwardFetch("
{{
name
}}
",dto);
}
}
default Page
<
{{
entity
.
codeName
}}
>
onFetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
default Page
<
{{
entity
.
codeName
}}
>
onFetch
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext dto) throws Throwable {
return (Page) I
Base
Service.super.onRealFetch("
{{
name
}}
",dto);
return (Page) I
ServiceApi
Service.super.onRealFetch("
{{
name
}}
",dto);
}
}
{{/
entity
.
dataSets
}}
{{/
entity
.
dataSets
}}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录