Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
6177f2ec
提交
6177f2ec
编写于
8月 30, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
接口实体
上级
1d06780b
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
152 行增加
和
9 行删除
+152
-9
ApiEntityModel.java
...rc/main/java/cn/ibizlab/codegen/model/ApiEntityModel.java
+5
-2
VoFieldModel.java
.../src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
+13
-2
FileDto.java
...e}}-api/src/main/java/cn/ibizlab/util/domain/FileDto.java
+66
-3
FileListDto.java
...api/src/main/java/cn/ibizlab/util/domain/FileListDto.java
+36
-0
{{pascalCase ctrls@FORM}}AddDto.java.hbs
...se appEntities}}/{{pascalCase ctrls@FORM}}AddDto.java.hbs
+14
-0
{{pascalCase ctrls@FORM}}BaseDto.java.hbs
...e appEntities}}/{{pascalCase ctrls@FORM}}BaseDto.java.hbs
+4
-2
{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
...appEntities}}/{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
+14
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ApiEntityModel.java
浏览文件 @
6177f2ec
...
...
@@ -95,8 +95,11 @@ public class ApiEntityModel extends BaseModel {
}
}
//接口关系方法
if
(
getApiDataEntity
().
getMinorPSDEServiceAPIRSs
()
!=
null
)
{
for
(
IPSDEServiceAPIRS
iPSDEServiceAPIRS
:
getApiDataEntity
().
getMinorPSDEServiceAPIRSs
())
{
if
(
this
.
getApi
().
getSysServiceApi
().
getPSDEServiceAPIRSs
()
!=
null
)
{
for
(
IPSDEServiceAPIRS
iPSDEServiceAPIRS
:
this
.
getApi
().
getSysServiceApi
().
getPSDEServiceAPIRSs
())
{
if
(!
iPSDEServiceAPIRS
.
getMinorPSDEServiceAPI
().
getId
().
equalsIgnoreCase
(
this
.
getApiDataEntity
().
getId
()))
continue
;
if
(
iPSDEServiceAPIRS
.
getPSDEServiceAPIMethods
()
!=
null
)
{
ApiEntityRSModel
apiEntityRSModel
=
api
.
getApiEntityRS
(
iPSDEServiceAPIRS
.
getName
());
//计算父路径
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
浏览文件 @
6177f2ec
...
...
@@ -96,6 +96,8 @@ public class VoFieldModel extends BaseModel {
private
boolean
singleFile
=
false
;
private
String
fileExt
;
private
boolean
fileList
=
false
;
private
boolean
singleDict
=
false
;
...
...
@@ -126,14 +128,23 @@ public class VoFieldModel extends BaseModel {
}
else
if
(
this
.
getPSEditor
()!=
null
&&(
this
.
getPSDEFormItem
()
instanceof
IPSFileUploader
||
"FILEUPLOADER"
.
equals
(
this
.
getPSEditor
().
getEditorType
())))
{
javaType
=
"List<FileDto>"
;
javaType
=
"FileListDto"
;
serializeUsing
=
"com.alibaba.fastjson.serializer.ToStringSerializer.class"
;
fileList
=
true
;
}
else
if
(
this
.
getPSEditor
()!=
null
&&(
"hfh"
.
equals
(
this
.
getPSEditor
().
getEditorStyle
())||
"zp"
.
equals
(
this
.
getPSEditor
().
getEditorStyle
())))
else
if
(
this
.
getPSEditor
()!=
null
&&(
"zp"
.
equals
(
this
.
getPSEditor
().
getEditorStyle
())))
{
javaType
=
"FileDto"
;
serializeUsing
=
"com.alibaba.fastjson.serializer.ToStringSerializer.class"
;
singleFile
=
true
;
fileExt
=
".png"
;
}
else
if
(
this
.
getPSEditor
()!=
null
&&(
"hfh"
.
equals
(
this
.
getPSEditor
().
getEditorStyle
())))
{
javaType
=
"FileDto"
;
serializeUsing
=
"com.alibaba.fastjson.serializer.ToStringSerializer.class"
;
singleFile
=
true
;
fileExt
=
".doc"
;
}
}
return
javaType
;
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/cn/ibizlab/util/domain/FileDto.java
浏览文件 @
6177f2ec
package
cn
.
ibizlab
.
util
.
domain
;
import
com.
fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.
JsonInclude
;
import
com.
alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.
*
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.SneakyThrows
;
import
java.nio.file.OpenOption
;
import
java.nio.file.Path
;
import
java.io.File
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
@Data
@JsonInclude
(
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"文件"
)
public
class
FileDto
{
...
...
@@ -21,4 +33,55 @@ public class FileDto
private
String
name
;
@ApiModelProperty
(
value
=
"文件流/base64"
,
position
=
3
)
private
byte
[]
content
;
}
@SneakyThrows
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
File
getFile
(
String
rootPath
,
boolean
override
)
{
if
(
id
==
null
&&
content
==
null
)
return
null
;
if
(
id
==
null
)
id
=
UUID
.
randomUUID
().
toString
();
if
(
name
==
null
)
name
=
id
;
Path
path
=
Paths
.
get
(
rootPath
,
id
,
name
);
if
(
override
&&
content
!=
null
)
{
File
dir
=
path
.
getParent
().
toFile
();
if
(!
dir
.
exists
())
dir
.
mkdirs
();
Files
.
write
(
path
,
content
);
}
if
(
Files
.
exists
(
path
))
return
path
.
toFile
();
return
null
;
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
protected
Map
<
String
,
Object
>
extensionparams
=
new
HashMap
<
String
,
Object
>();
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
Object
get
(
String
field
)
{
return
this
.
extensionparams
.
get
(
field
);
}
@JsonAnyGetter
@JSONField
(
name
=
"_any"
,
unwrapped
=
true
,
serialize
=
true
,
deserialize
=
false
)
public
Map
<
String
,
Object
>
any
()
{
return
extensionparams
;
}
@JsonAnySetter
@JSONField
(
name
=
"_any"
,
unwrapped
=
true
,
serialize
=
false
,
deserialize
=
true
)
public
void
set
(
String
field
,
Object
value
)
{
this
.
extensionparams
.
put
(
field
,
value
);
}
@Override
public
String
toString
()
{
return
getId
();
}
}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/cn/ibizlab/util/domain/FileListDto.java
0 → 100644
浏览文件 @
6177f2ec
package
cn
.
ibizlab
.
util
.
domain
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
@Data
@JsonInclude
(
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@AllArgsConstructor
@ApiModel
(
"文件列表"
)
public
class
FileListDto
extends
ArrayList
<
FileDto
>
{
@Override
public
String
toString
()
{
List
<
Map
>
list
=
new
ArrayList
<>();
this
.
forEach
(
item
->{
Map
map
=
new
LinkedHashMap
();
map
.
putAll
(
item
.
getExtensionparams
());
map
.
put
(
"id"
,
item
.
getId
());
map
.
put
(
"name"
,
item
.
getName
());
});
return
JSON
.
toJSONString
(
list
);
}
}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}AddDto.java.hbs
浏览文件 @
6177f2ec
...
...
@@ -58,6 +58,20 @@ public class {{pascalCase ctrl.codeName}}AddDto extends {{pascalCase ctrl.codeNa
@ApiModelProperty(value = "
{{
logicName
}}{{#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
protected
{{
javaType
}}
{{
camelCase
codeName
}}
{{#if
createDefaultValue
}}
=
{{
createDefaultValue
}}{{/if}}
;
{{/if}}
{{#if
javaType
}}
{{#if
singleFile
}}
public void set
{{
pascalCase
codeName
}}
(
{{
javaType
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
}
{{/if}}
{{#if
fileList
}}
public void set
{{
pascalCase
codeName
}}
(
{{
javaType
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
}
{{/if}}
{{/if}}
{{/
each
}}
@Override
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}BaseDto.java.hbs
浏览文件 @
6177f2ec
...
...
@@ -67,7 +67,9 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
public void set
{{
pascalCase
codeName
}}
(String
{{
camelCase
codeName
}}
) {
if(
{{
camelCase
codeName
}}
==null)
return;
FileDto fileDto = new FileDto(
{{
camelCase
codeName
}}
,null,null);
FileDto fileDto = new FileDto();
fileDto.setId(
{{
camelCase
codeName
}}
);
{{#if
fileExt
}}
fileDto.setName("
{{
camelCase
codeName
}}{{
fileExt
}}
");
{{/if}}
this.
{{
camelCase
codeName
}}
= fileDto;
}
{{/if}}
...
...
@@ -75,7 +77,7 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
public void set
{{
pascalCase
codeName
}}
(String
{{
camelCase
codeName
}}
) {
if(
{{
camelCase
codeName
}}
==null)
return;
this.
{{
camelCase
codeName
}}
= JSON.parse
Array(
{{
camelCase
codeName
}}
,File
Dto.class);
this.
{{
camelCase
codeName
}}
= JSON.parse
Object(
{{
camelCase
codeName
}}
,FileList
Dto.class);
}
{{/if}}
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
浏览文件 @
6177f2ec
...
...
@@ -58,6 +58,20 @@ public class {{pascalCase ctrl.codeName}}UpdateDto extends {{pascalCase ctrl.cod
@ApiModelProperty(value = "
{{
logicName
}}{{#if
userTag
}}
,
{{
userTag
}}{{/if}}{{#if
dict
}}
,
{{#
unless
singleSelect
}}
多选
{{/
unless
}}
【字典:
{{
dict
.
name
}}
】
{{/if}}{{#if
timeType
}}
,格式:
{{
format
}}{{/if}}
", position =
{{
position
}}{{#if
timeType
}}
, notes = "格式:
{{
format
}}
"
{{/if}}{{#if
dict
}}
, notes = "字典:
{{
dict
.
name
}}
", dataType = "
{{
lowerCase
type
.
java
}}
", reference = "
{{
dictCodeName
}}
"
{{/if}}{{#if
required
}}
, required = true
{{/if}}{{#if
hidden
}}
, hidden = true
{{/if}}{{#if
example
}}
, example = "
{{
example
}}
"
{{/if}}
)
protected
{{
javaType
}}
{{
camelCase
codeName
}}
{{#if
updateDefaultValue
}}
=
{{
updateDefaultValue
}}{{/if}}
;
{{/if}}
{{#if
javaType
}}
{{#if
singleFile
}}
public void set
{{
pascalCase
codeName
}}
(
{{
javaType
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
}
{{/if}}
{{#if
fileList
}}
public void set
{{
pascalCase
codeName
}}
(
{{
javaType
}}
{{
camelCase
codeName
}}
) {
this.
{{
camelCase
codeName
}}
=
{{
camelCase
codeName
}}
;
}
{{/if}}
{{/if}}
{{/
each
}}
@Override
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录