提交 34a81fb9 编写于 作者: sq3536's avatar sq3536

便捷操作

上级 30e5a6a7
......@@ -59,6 +59,16 @@ public enum PropType {
return java;
}
public boolean isString()
{
return "String".equalsIgnoreCase(java);
}
public boolean isNumber()
{
return "BigDecimal".equalsIgnoreCase(java)||"Long".equalsIgnoreCase(java)||"Integer".equalsIgnoreCase(java);
}
public static PropType findType(Integer type) {
for (PropType userTypeEnum : values()) {
if (userTypeEnum.getCode()==type) {
......
......@@ -111,11 +111,11 @@ public class StringAdvUtils {
public static String pascalcase(String word) {
return camelize(word, true);
return camelize(word, false);
}
public static String camelcase(String word) {
return camelize(word, false);
return camelize(word, true);
}
public static String spinalcase(String word) {
......
......@@ -34,13 +34,31 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(value = "handler")
@TableName(value = "{{entity.tableName}}", resultMap = "{{entity.codeName}}ResultMap")
@ApiModel("{{entity.logicName}}")
public class {{entity.codeName}} extends EntityMP implements Serializable
{
{{#entity.fields}}
private {{type.java}} {{codeName.camelCase}};
{{#entity.fields}}
{{#keyDEField}}
@TableId(value = "{{name.lowerCase}}"{{#type.number}} , type = IdType.ASSIGN_ID{{/type.number}}{{#type.string}} , type = IdType.ASSIGN_UUID{{/type.string}})
{{/keyDEField}}
{{^keyDEField}}
@TableField(value = "{{name.lowerCase}}"{{^phisicalDEField}} , exist = false{{/phisicalDEField}})
{{/keyDEField}}
@JsonProperty("{{codeName.lowerCase}}")
@JSONField(name = "{{codeName.lowerCase}}")
@ApiModelProperty("{{logicName}}")
private {{type.java}} {{codeName.camelCase}};
{{/entity.fields}}
{{/entity.fields}}
{{#entity.fields}}
public {{entity.codeName}} set{{codeName.pascalCase}}({{type.java}} {{codeName.camelCase}}) {
this.{{codeName.camelCase}} = {{codeName.camelCase}};
this.modify("{{name.lowerCase}}", {{codeName.camelCase}});
return this;
}
{{/entity.fields}}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册