Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
f321288d
提交
f321288d
编写于
8月 17, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vo
上级
f8ac6c7d
变更
11
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
298 行增加
和
57 行删除
+298
-57
Catalog.java
...-core/src/main/java/cn/ibizlab/codegen/model/Catalog.java
+12
-1
VoFieldModel.java
.../src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
+43
-5
SwaggerDisplayEnum.java
...n/java/cn/ibizlab/util/annotation/SwaggerDisplayEnum.java
+14
-0
DictItem.java
...}}-api/src/main/java/cn/ibizlab/util/domain/DictItem.java
+24
-0
FileDto.java
...e}}-api/src/main/java/cn/ibizlab/util/domain/FileDto.java
+24
-0
{{dicts}}Dict.java.hbs
.../{{packageName}}/api/{{apps}}/dict/{{dicts}}Dict.java.hbs
+108
-43
{{pascalCase ctrls@FORM}}AddDto.java.hbs
...se appEntities}}/{{pascalCase ctrls@FORM}}AddDto.java.hbs
+6
-2
{{pascalCase ctrls@FORM}}BaseDto.java.hbs
...e appEntities}}/{{pascalCase ctrls@FORM}}BaseDto.java.hbs
+3
-2
{{pascalCase ctrls@FORM}}Dto.java.hbs
...lCase appEntities}}/{{pascalCase ctrls@FORM}}Dto.java.hbs
+6
-2
{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
...appEntities}}/{{pascalCase ctrls@FORM}}UpdateDto.java.hbs
+6
-2
DictResource.java.hbs
...a/{{packageName}}/api/{{apps}}/rest/DictResource.java.hbs
+52
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/Catalog.java
浏览文件 @
f321288d
...
...
@@ -40,6 +40,17 @@ public class Catalog extends BaseModel
return
(
IPSAppCodeList
)
opt
;
}
public
String
getValueSeparator
()
{
return
getCodeList
().
getValueSeparator
()==
null
?
";"
:
getCodeList
().
getValueSeparator
();
}
public
String
getTextSeparator
()
{
return
getCodeList
().
getTextSeparator
()==
null
?
";"
:
getCodeList
().
getTextSeparator
();
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
String
getValueType
()
...
...
@@ -64,7 +75,7 @@ public class Catalog extends BaseModel
@JSONField
(
serialize
=
false
)
public
Collection
getOptionItems
()
{
if
(
getSets
().
size
()>
100
)
if
(
getSets
().
size
()>
100
0
)
return
options
;
else
return
sets
.
values
();
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/VoFieldModel.java
浏览文件 @
f321288d
...
...
@@ -9,6 +9,7 @@ import net.ibizsys.model.app.dataentity.IPSAppDEField;
import
net.ibizsys.model.control.IPSEditor
;
import
net.ibizsys.model.control.editor.IPSCheckBoxList
;
import
net.ibizsys.model.control.editor.IPSCodeListEditor
;
import
net.ibizsys.model.control.editor.IPSFileUploader
;
import
net.ibizsys.model.control.editor.IPSMDropDownList
;
import
net.ibizsys.model.control.form.IPSDEFDCatGroupLogic
;
import
net.ibizsys.model.control.form.IPSDEForm
;
...
...
@@ -92,13 +93,52 @@ public class VoFieldModel extends BaseModel {
javaType
=
getType
().
getJava
();
if
(
this
.
getDict
()!=
null
)
{
javaType
=
StringAdvUtils
.
pascalcase
(
this
.
getDictCodeName
())+
"Dict"
;
if
(!
singleSelect
)
javaType
=
javaType
+
"[]"
;
if
(!
singleSelect
)
{
javaType
=
javaType
+
".LIST"
;
formatShape
=
"STRING"
;
serializeUsing
=
"com.alibaba.fastjson.serializer.ToStringSerializer.class"
;
}
else
{
javaType
=
javaType
+
".ENUM"
;
if
(
"Integer"
.
equals
(
getType
().
getJava
()))
formatShape
=
"NUMBER"
;
else
formatShape
=
"STRING"
;
}
}
else
if
(
this
.
getPSEditor
()!=
null
&&(
this
.
getPSDEFormItem
()
instanceof
IPSFileUploader
||
"FILEUPLOADER"
.
equals
(
this
.
getPSEditor
().
getEditorType
())))
{
javaType
=
"List<FileDto>"
;
}
else
if
(
this
.
getPSEditor
()!=
null
&&(
"hfh"
.
equals
(
this
.
getPSEditor
().
getEditorStyle
())||
"zp"
.
equals
(
this
.
getPSEditor
().
getEditorStyle
())))
{
javaType
=
"FileDto"
;
serializeUsing
=
"com.alibaba.fastjson.serializer.ToStringSerializer.class"
;
}
}
return
javaType
;
}
private
String
serializeUsing
;
public
String
getSerializeUsing
()
{
if
(
serializeUsing
==
null
)
{
serializeUsing
=
""
;
getJavaType
();
}
return
serializeUsing
;
}
private
String
formatShape
;
public
String
getFormatShape
(){
if
(
formatShape
==
null
)
{
formatShape
=
""
;
getJavaType
();
}
return
formatShape
;
}
private
String
dictCodeName
;
private
boolean
singleSelect
=
true
;
private
Catalog
dict
;
...
...
@@ -110,8 +150,6 @@ public class VoFieldModel extends BaseModel {
IPSCodeListEditor
codeListEditor
=(
IPSCodeListEditor
)
getPSDEFormItem
().
getPSEditor
();
if
(
codeListEditor
.
getPSAppCodeList
()!=
null
)
{
dictCodeName
=
codeListEditor
.
getPSAppCodeList
().
getCodeName
();
if
(
dictCodeName
.
equals
(
"CL_TYYW_36"
))
System
.
out
.
println
(
1
);
dict
=
this
.
getVoModel
().
getApp
().
getDictMaps
().
get
(
dictCodeName
);
if
(
dict
==
null
)
{
...
...
@@ -202,7 +240,7 @@ public class VoFieldModel extends BaseModel {
public
String
getDefaultValue
(
String
dv
)
{
if
(!
ObjectUtils
.
isEmpty
(
dv
))
{
if
(
this
.
getDict
()
!=
null
)
{
dv
=
StringAdvUtils
.
pascalcase
(
dictCodeName
)
+
"Dict.V_"
+
dv
.
replace
(
"("
,
""
).
replace
(
")"
,
""
)
dv
=
StringAdvUtils
.
pascalcase
(
dictCodeName
)
+
"Dict.
ENUM.
V_"
+
dv
.
replace
(
"("
,
""
).
replace
(
")"
,
""
)
.
replace
(
"("
,
""
).
replace
(
")"
,
""
)
.
replace
(
":"
,
""
).
replace
(
":"
,
""
)
.
replace
(
"、"
,
""
).
replace
(
"."
,
""
)
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/cn/ibizlab/util/annotation/SwaggerDisplayEnum.java
0 → 100644
浏览文件 @
f321288d
package
cn
.
ibizlab
.
util
.
annotation
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Target
({
ElementType
.
TYPE
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
SwaggerDisplayEnum
{
String
code
()
default
"value"
;
String
desc
()
default
"label"
;
Class
<?>
type
()
default
String
.
class
;
}
\ 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/DictItem.java
0 → 100644
浏览文件 @
f321288d
package
cn
.
ibizlab
.
util
.
domain
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@ApiModel
(
"字典项"
)
public
class
DictItem
{
@ApiModelProperty
(
value
=
"实际值"
,
position
=
1
)
private
String
value
;
@ApiModelProperty
(
value
=
"显示内容"
,
position
=
2
)
private
String
label
;
@ApiModelProperty
(
value
=
"上级"
,
position
=
3
)
private
String
parent
;
}
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/cn/ibizlab/util/domain/FileDto.java
0 → 100644
浏览文件 @
f321288d
package
cn
.
ibizlab
.
util
.
domain
;
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
;
@Data
@JsonInclude
(
Include
.
NON_NULL
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@AllArgsConstructor
@ApiModel
(
"文件"
)
public
class
FileDto
{
@ApiModelProperty
(
value
=
"文件标识"
,
position
=
1
)
private
String
id
;
@ApiModelProperty
(
value
=
"文件名"
,
position
=
2
)
private
String
name
;
@ApiModelProperty
(
value
=
"文件流/base64"
,
position
=
3
)
private
byte
[]
content
;
}
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dict/{{dicts}}Dict.java.hbs
浏览文件 @
f321288d
{{#
eq
apps
"link"
}}
package
{{
packageName
}}
.api.
{{
apps
}}
.dict;
import cn.ibizlab.util.domain.DictItem;
import com.alibaba.fastjson.annotation.JSONCreator;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import cn.ibizlab.util.annotation.SwaggerDisplayEnum;
import io.swagger.annotations.ApiModelProperty;
import java.util.*;
/**
* 字典:
{{
dict
.
name
}}
*/
@SwaggerDisplayEnum
{{#
eq
dict
.
valueType
"Integer"
}}
(type = Integer.class)
{{/
eq
}}
@ApiModel(value = "字典:
{{
dict
.
name
}}
", description = "
{{
dict
.
codeName
}}
")
public enum
{{
pascalCase
dict
.
codeName
}}
Dict {
{{#
each
dict
.
optionItems
}}
{{#
eq
dict
.
valueType
"String"
}}
{{
name
}}
("
{{
value
}}
","
{{
label
}}
",
{{#if
parent
}}
"
{{
parent
}}
"
{{else}}
null
{{/if}}
)
{{#if
@last
}}
;
{{else}}
,
{{/if}}
{{/
eq
}}
{{#
eq
dict
.
valueType
"Integer"
}}
{{
name
}}
(
{{
value
}}
,"
{{
label
}}
",
{{#if
parent
}}{{
parent
}}{{else}}
null
{{/if}}
)
{{#if
@last
}}
;
{{else}}
,
{{/if}}
{{/
eq
}}
{{/
each
}}
private
{{
dict
.
valueType
}}
value;
@JsonValue
@JSONField
public
{{
dict
.
valueType
}}
getValue() {
return value;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "
{{
pascalCase
dict
.
codeName
}}
Dict", description = "字典:
{{
dict
.
name
}}
")
public class
{{
pascalCase
dict
.
codeName
}}
Dict {
private String label;
public String getLabel() {
return label;
}
@SwaggerDisplayEnum
public static enum ENUM{
{{#
each
dict
.
optionItems
}}
{{#
eq
dict
.
valueType
"String"
}}
{{
name
}}
("
{{
value
}}
","
{{
label
}}
",
{{#if
parent
}}
"
{{
parent
}}
"
{{else}}
null
{{/if}}
)
{{#if
@last
}}
;
{{else}}
,
{{/if}}
{{/
eq
}}
{{#
eq
dict
.
valueType
"Integer"
}}
{{
name
}}
(
{{
value
}}
,"
{{
label
}}
",
{{#if
parent
}}{{
parent
}}{{else}}
null
{{/if}}
)
{{#if
@last
}}
;
{{else}}
,
{{/if}}
{{/
eq
}}
{{/
each
}}
private
{{
dict
.
valueType
}}
value;
@JsonValue
@JSONField
public
{{
dict
.
valueType
}}
getValue() {
return value;
}
private String label;
public String getLabel() {
return label;
}
private
{{
dict
.
valueType
}}
parent;
public
{{
dict
.
valueType
}}
getParent() {
return parent;
}
private
{{
dict
.
valueType
}}
parent;
public
{{
dict
.
valueType
}}
getParent() {
return parent;
ENUM(
{{
dict
.
valueType
}}
value, String label,
{{
dict
.
valueType
}}
parent) {
this.value = value;
this.label = label;
this.parent = parent;
}
@JsonCreator
@JSONCreator
public static ENUM from(Object tag) {
if(tag==null)
return null;
for (ENUM item : values())
if (item.getValue().equals(tag)
{{#
eq
dict
.
valueType
"Integer"
}}
||item.getValue().toString().equals(tag)
{{/
eq
}}
)
return item;
ENUM ret =null;
for (ENUM item : values())
if (item.getLabel().equals(tag))
ret = item;
return ret;
}
}
{{
pascalCase
dict
.
codeName
}}
Dict(
{{
dict
.
valueType
}}
value, String label,
{{
dict
.
valueType
}}
parent) {
this.value = value;
this.label = label;
this.parent = parent;
@SwaggerDisplayEnum
public static class LIST extends ArrayList
<ENUM>
{
public boolean isEnum() {
return true;
}
@JsonValue
public String getValue() {
if(this.size()==0)
return null;
List
<String>
values=new ArrayList
<>
();
this.forEach(item->values.add(item.getValue().toString()));
return String.join("
{{
dict
.
valueSeparator
}}
",values);
}
public String getLabel() {
if(this.size()==0)
return null;
List
<String>
values=new ArrayList
<>
();
this.forEach(item->values.add(item.getLabel()));
return String.join("
{{
dict
.
textSeparator
}}
",values);
}
@Override
public String toString() {
return getValue();
}
@JsonCreator
@JSONCreator
public static LIST form(Object tags) {
LIST list=new LIST();
Arrays.asList(tags.toString().split(";|,")).forEach(tag->{
ENUM item=ENUM.from(tag);
if(item!=null)
list.add(item);
});
if(list.size()==0)
return null;
return list;
}
}
@JsonCreator
@JSONCreator
public static
{{
pascalCase
dict
.
codeName
}}
Dict valueOf(Object tag) {
if(tag==null)
return null;
for (
{{
pascalCase
dict
.
codeName
}}
Dict item : values())
if (item.getValue().equals(tag)
{{#
eq
dict
.
valueType
"Integer"
}}
||item.getValue().toString().equals(tag)
{{/
eq
}}
)
return item;
{{
pascalCase
dict
.
codeName
}}
Dict ret =null;
for (
{{
pascalCase
dict
.
codeName
}}
Dict item : values())
if (item.getLabel().equals(tag))
ret = item;
return ret;
@ApiModelProperty(value = "字典:
{{
dict
.
name
}}
,示例", position = 1)
public ENUM example;
@ApiModelProperty(value = "字典项清单", position = 2)
private List
<DictItem>
allItems;
public List
<DictItem>
getAllItems()
{
if(allItems==null) {
allItems=new ArrayList
<>
();
Arrays.asList(ENUM.values()).forEach(item->allItems.add(new DictItem().setValue(item.getValue().toString()).setLabel(item.getLabel()).setParent(item.getParent()!=null?item.getParent().toString():null)));
}
return allItems;
}
}
{{/
eq
}}
\ 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
浏览文件 @
f321288d
...
...
@@ -23,6 +23,7 @@ import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import cn.ibizlab.util.domain.*;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
/**
...
...
@@ -39,12 +40,15 @@ public class {{pascalCase ctrl.codeName}}AddDto extends {{pascalCase ctrl.codeNa
/**
*
{{
logicName
}}
*/
@JsonProperty("
{{
camelCase
code
Name
}}
")
@JsonProperty("
{{
json
Name
}}
")
{{#
timeType
}}
@JsonFormat(pattern = "
{{
format
}}
", locale = "zh", timezone = "GMT+8")
@DateTimeFormat(pattern = "
{{
format
}}
")
{{/
timeType
}}
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}
)
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
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
浏览文件 @
f321288d
...
...
@@ -23,6 +23,7 @@ import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import cn.ibizlab.util.domain.*;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
/**
...
...
@@ -39,7 +40,7 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
/**
*
{{
logicName
}}
*/
@JsonProperty("
{{
camelCase
code
Name
}}
")
@JsonProperty("
{{
json
Name
}}
")
{{#
timeType
}}
@JsonFormat(pattern = "
{{
format
}}
", locale = "zh", timezone = "GMT+8")
@DateTimeFormat(pattern = "
{{
format
}}
")
...
...
@@ -47,7 +48,7 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}
)
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}
{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-api/src/main/java/{{packageName}}/api/{{apps}}/dto/{{pascalCase appEntities}}/{{pascalCase ctrls@FORM}}Dto.java.hbs
浏览文件 @
f321288d
...
...
@@ -23,6 +23,7 @@ import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import cn.ibizlab.util.domain.*;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
/**
...
...
@@ -39,12 +40,15 @@ public class {{pascalCase ctrl.codeName}}Dto extends {{pascalCase ctrl.codeName}
/**
*
{{
logicName
}}
*/
@JsonProperty("
{{
camelCase
code
Name
}}
")
@JsonProperty("
{{
json
Name
}}
")
{{#
timeType
}}
@JsonFormat(pattern = "
{{
format
}}
", locale = "zh", timezone = "GMT+8")
@DateTimeFormat(pattern = "
{{
format
}}
")
{{/
timeType
}}
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}
)
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
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
浏览文件 @
f321288d
...
...
@@ -23,6 +23,7 @@ import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import cn.ibizlab.util.domain.*;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
/**
...
...
@@ -39,12 +40,15 @@ public class {{pascalCase ctrl.codeName}}UpdateDto extends {{pascalCase ctrl.cod
/**
*
{{
logicName
}}
*/
@JsonProperty("
{{
camelCase
code
Name
}}
")
@JsonProperty("
{{
json
Name
}}
")
{{#
timeType
}}
@JsonFormat(pattern = "
{{
format
}}
", locale = "zh", timezone = "GMT+8")
@DateTimeFormat(pattern = "
{{
format
}}
")
{{/
timeType
}}
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}
)
{{#if
dict
}}
@JsonFormat(shape = JsonFormat.Shape.
{{#if
singleSelect
}}{{#
eq
type
.
java
"String"
}}
STRING
{{/
eq
}}{{#
eq
type
.
java
"Integer"
}}
NUMBER
{{/
eq
}}{{else}}
STRING
{{/if}}
)
{{/if}}
@JSONField(name = "
{{
jsonName
}}
"
{{#
timeType
}}
, format = "
{{
format
}}
"
{{/
timeType
}}{{#if
serializeUsing
}}
, serializeUsing =
{{
serializeUsing
}}{{/if}}
)
{{#
eq
javaType
"Long"
}}
@JsonSerialize(using = ToStringSerializer.class)
{{/
eq
}}
...
...
modules/ibizlab-template/ibizlab-template-apivo/src/main/resources/templ/{{projectName}}-rest/src/main/java/{{packageName}}/api/{{apps}}/rest/DictResource.java.hbs
0 → 100644
浏览文件 @
f321288d
{{#
eq
apps
"link"
}}
package
{{
packageName
}}
.api.
{{
apps
}}
.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import
{{
packageName
}}
.api.
{{
apps
}}
.dict.*;
@Slf4j
@Api(tags = {"数据字典" })
@RestController("
{{
lowerCase
app
.
codeName
}}
-DictResource")
@RequestMapping("/
{{
lowerCase
app
.
codeName
}}
/dict")
public class DictResource {
{{#
each
app
.
dicts
}}
@ApiOperation(value = "字典:
{{
name
}}
[
{{
pascalCase
codeName
}}
Dict]", tags = {"数据字典" }, notes = "字典:
{{
name
}}
[
{{
pascalCase
codeName
}}
Dict]")
@RequestMapping(method = RequestMethod.GET, value = "/
{{
pascalCase
codeName
}}
Dict")
public ResponseEntity
<
{{
pascalCase
codeName
}}
Dict>
get
{{
pascalCase
codeName
}}
Dict() {
return ResponseEntity.ok(new
{{
pascalCase
codeName
}}
Dict());
}
{{/
each
}}
}
{{/
eq
}}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录