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

提交

上级 b894a61d
...@@ -8,6 +8,8 @@ import java.math.BigInteger; ...@@ -8,6 +8,8 @@ import java.math.BigInteger;
import java.util.HashMap; import java.util.HashMap;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import cn.ibizlab.core.data.model.PojoSchema;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
...@@ -94,7 +96,7 @@ public class DOModel extends EntityBase implements Serializable { ...@@ -94,7 +96,7 @@ public class DOModel extends EntityBase implements Serializable {
@JSONField(name = "schema") @JSONField(name = "schema")
@JsonProperty("schema") @JsonProperty("schema")
@ApiModelProperty("定义") @ApiModelProperty("定义")
private String schema; private PojoSchema schema;
/** /**
* 模型 * 模型
......
package cn.ibizlab.core.data.domain;
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 java.math.BigDecimal;
import java.text.SimpleDateFormat;
import cn.ibizlab.core.data.model.PojoModel;
import cn.ibizlab.core.data.model.PojoSchema;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* [业务实体] 对象
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("业务实体")
public class DOSchema extends EntityBase implements Serializable {
/**
* 标识
*/
@DEField(isKeyField = true)
@JSONField(name = "id")
@JsonProperty("id")
@ApiModelProperty("标识")
private String id;
/**
* 名称
*/
@JSONField(name = "name")
@JsonProperty("name")
@ApiModelProperty("名称")
private String name;
/**
* 名称
*/
@JSONField(name = "title")
@JsonProperty("title")
@ApiModelProperty("名称")
private String title;
/**
* 系统
*/
@JSONField(name = "systemId")
@JsonProperty("systemId")
@ApiModelProperty("系统")
private String systemId;
/**
* 包名
*/
@JSONField(name = "packageName")
@JsonProperty("packageName")
@ApiModelProperty("包名")
private String packageName;
/**
* 描述
*/
@JSONField(name = "description")
@JsonProperty("description")
@ApiModelProperty("描述")
private String description;
/**
* 定义
*/
@JSONField(name = "schema")
@JsonProperty("schema")
@ApiModelProperty("定义")
private PojoSchema schema;
/**
* 模型
*/
@JSONField(name = "model")
@JsonProperty("model")
@ApiModelProperty("模型")
private String model;
/**
* 存储
*/
@JSONField(name = "poModels")
@JsonProperty("poModels")
@ApiModelProperty("存储")
private String poModels;
}
...@@ -8,6 +8,8 @@ import java.math.BigInteger; ...@@ -8,6 +8,8 @@ import java.math.BigInteger;
import java.util.HashMap; import java.util.HashMap;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import cn.ibizlab.core.data.model.PojoSchema;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
...@@ -94,7 +96,7 @@ public class DTOModel extends EntityBase implements Serializable { ...@@ -94,7 +96,7 @@ public class DTOModel extends EntityBase implements Serializable {
@JSONField(name = "schema") @JSONField(name = "schema")
@JsonProperty("schema") @JsonProperty("schema")
@ApiModelProperty("定义") @ApiModelProperty("定义")
private String schema; private PojoSchema schema;
/** /**
* 模型 * 模型
......
package cn.ibizlab.core.data.domain;
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 java.math.BigDecimal;
import java.text.SimpleDateFormat;
import cn.ibizlab.core.data.model.PojoModel;
import cn.ibizlab.core.data.model.PojoSchema;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* [数据传输对象] 对象
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("数据传输对象")
public class DTOSchema extends EntityBase implements Serializable {
/**
* 标识
*/
@DEField(isKeyField = true)
@JSONField(name = "id")
@JsonProperty("id")
@ApiModelProperty("标识")
private String id;
/**
* 名称
*/
@JSONField(name = "name")
@JsonProperty("name")
@ApiModelProperty("名称")
private String name;
/**
* 名称
*/
@JSONField(name = "title")
@JsonProperty("title")
@ApiModelProperty("名称")
private String title;
/**
* 系统
*/
@JSONField(name = "systemId")
@JsonProperty("systemId")
@ApiModelProperty("系统")
private String systemId;
/**
* 包名
*/
@JSONField(name = "packageName")
@JsonProperty("packageName")
@ApiModelProperty("包名")
private String packageName;
/**
* 描述
*/
@JSONField(name = "description")
@JsonProperty("description")
@ApiModelProperty("描述")
private String description;
/**
* 定义
*/
@JSONField(name = "schema")
@JsonProperty("schema")
@ApiModelProperty("定义")
private PojoSchema schema;
/**
* 模型
*/
@JSONField(name = "model")
@JsonProperty("model")
@ApiModelProperty("模型")
private String model;
/**
* 映射
*/
@JSONField(name = "mapping")
@JsonProperty("mapping")
@ApiModelProperty("映射")
private String mapping;
}
...@@ -19,6 +19,8 @@ import java.util.*; ...@@ -19,6 +19,8 @@ import java.util.*;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class PojoModel public class PojoModel
{ {
@JSONField(ordinal = 0)
private String ref;
@JSONField(ordinal = 1) @JSONField(ordinal = 1)
private String id; private String id;
@JSONField(ordinal = 2) @JSONField(ordinal = 2)
...@@ -30,7 +32,7 @@ public class PojoModel ...@@ -30,7 +32,7 @@ public class PojoModel
@JSONField(ordinal = 5) @JSONField(ordinal = 5)
private List<PojoProperty> propertyList; private List<PojoProperty> propertyList;
@JSONField(ordinal = 6) @JSONField(ordinal = 6)
private Map<String, Object> extensions=new HashMap<>(); private Map<String, Object> extensions;
public PojoModel setPropertyList(List<PojoProperty> propertyList) { public PojoModel setPropertyList(List<PojoProperty> propertyList) {
if (propertyList != null) if (propertyList != null)
......
...@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; ...@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class PojoOption extends DataObj{ public class PojoOption extends DataObj{
...@@ -17,21 +19,23 @@ public class PojoOption extends DataObj{ ...@@ -17,21 +19,23 @@ public class PojoOption extends DataObj{
return this; return this;
} }
public PojoOption setAll(Map map)
{
if(map!=null)
this.putAll(map);
else if(this.size()==0)
return null;
return this;
}
public String getName() { public String getName() {
return this.getStringValue("name"); return this.getStringValue("name",this.getStringValue("code_name"));
} }
public PojoOption setName(String name) { public PojoOption setName(String name) {
return this.set("name",name); return this.set("name",name);
} }
public String getCode() {
return this.getStringValue("code");
}
public PojoOption setCode(String code) {
return this.set("code",code);
}
public Boolean isLogicValid() { public Boolean isLogicValid() {
return this.getBooleanValue("logicValid"); return this.getBooleanValue("logicValid");
...@@ -59,6 +63,15 @@ public class PojoOption extends DataObj{ ...@@ -59,6 +63,15 @@ public class PojoOption extends DataObj{
return this.set("logicdelval",logicdelval); return this.set("logicdelval",logicdelval);
} }
public String getFieldName() {
return this.getStringValue("field_name");
}
public PojoOption setFieldName(String code) {
return this.set("field_name",code);
}
public String getRelationName() { public String getRelationName() {
return this.getStringValue("relation_name"); return this.getStringValue("relation_name");
} }
......
...@@ -15,6 +15,7 @@ import org.springframework.util.ObjectUtils; ...@@ -15,6 +15,7 @@ import org.springframework.util.ObjectUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
@Getter @Getter
@Setter @Setter
...@@ -56,6 +57,9 @@ public class PojoProperty ...@@ -56,6 +57,9 @@ public class PojoProperty
@JSONField(ordinal = 8) @JSONField(ordinal = 8)
private PojoModel model; private PojoModel model;
@JSONField(ordinal = 9)
private Map<String, Object> extensions;
public PojoModel getModel() public PojoModel getModel()
{ {
if (propertyType != null && propertyType.equals(PojoModel.PropertyType.recursion) && ownerModel != null) { if (propertyType != null && propertyType.equals(PojoModel.PropertyType.recursion) && ownerModel != null) {
......
...@@ -31,18 +31,6 @@ public class PojoSchema { ...@@ -31,18 +31,6 @@ public class PojoSchema {
@JSONField(ordinal = 2) @JSONField(ordinal = 2)
private String type; private String type;
@JSONField(serialize = false)
@JsonIgnore
private String code;
@JSONField(serialize = false)
@JsonIgnore
public String getCode()
{
if(code==null)
code=this.getOptions()==null?this.getName():this.getOptions().getCode();
return code;
}
@JSONField(serialize = false) @JSONField(serialize = false)
@JsonIgnore @JsonIgnore
...@@ -70,6 +58,7 @@ public class PojoSchema { ...@@ -70,6 +58,7 @@ public class PojoSchema {
} }
@JSONField(ordinal = 3) @JSONField(ordinal = 3)
private String title; private String title;
...@@ -82,6 +71,16 @@ public class PojoSchema { ...@@ -82,6 +71,16 @@ public class PojoSchema {
@JSONField(ordinal = 6) @JSONField(ordinal = 6)
private PojoOption options; private PojoOption options;
public PojoSchema setOptions(PojoOption options)
{
if(options==null)
return this;
if(this.options!=null)
options.putAll(this.options);
this.options=options;
return this;
}
@JSONField(ordinal = 7) @JSONField(ordinal = 7)
private String ref; private String ref;
......
...@@ -8,6 +8,8 @@ import java.util.Map; ...@@ -8,6 +8,8 @@ import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import cn.ibizlab.core.data.model.PojoSchema;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -100,7 +102,7 @@ public class DOModelDTO extends DTOBase implements Serializable { ...@@ -100,7 +102,7 @@ public class DOModelDTO extends DTOBase implements Serializable {
@JsonProperty("schema") @JsonProperty("schema")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]") @Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
@ApiModelProperty("定义") @ApiModelProperty("定义")
private String schema; private PojoSchema schema;
/** /**
* 属性 [MODEL] * 属性 [MODEL]
...@@ -166,7 +168,7 @@ public class DOModelDTO extends DTOBase implements Serializable { ...@@ -166,7 +168,7 @@ public class DOModelDTO extends DTOBase implements Serializable {
/** /**
* 设置 [SCHEMA] * 设置 [SCHEMA]
*/ */
public void setSchema(String schema){ public void setSchema(PojoSchema schema){
this.schema = schema ; this.schema = schema ;
this.modify("schema",schema); this.modify("schema",schema);
} }
......
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import cn.ibizlab.core.data.model.PojoModel;
import cn.ibizlab.core.data.model.PojoSchema;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 服务DTO对象[DOSchemaDTO]
*/
@Data
@ApiModel("业务实体")
public class DOSchemaDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("标识")
private String id;
/**
* 属性 [NAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("名称")
private String name;
/**
* 属性 [TITLE]
*
*/
@JSONField(name = "title")
@JsonProperty("title")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("名称")
private String title;
/**
* 属性 [SYSTEMID]
*
*/
@JSONField(name = "systemid")
@JsonProperty("systemid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("系统")
private String systemId;
/**
* 属性 [PACKAGENAME]
*
*/
@JSONField(name = "packagename")
@JsonProperty("packagename")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("包名")
private String packageName;
/**
* 属性 [DESCRIPTION]
*
*/
@JSONField(name = "description")
@JsonProperty("description")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("描述")
private String description;
/**
* 属性 [SCHEMA]
*
*/
@JSONField(name = "schema")
@JsonProperty("schema")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
@ApiModelProperty("定义")
private PojoSchema schema;
/**
* 属性 [MODEL]
*
*/
@JSONField(name = "model")
@JsonProperty("model")
@Size(min = 0, max = 1048576, message = "内容长度必须小于等于[1048576]")
@ApiModelProperty("模型")
private String model;
/**
* 属性 [POMODELS]
*
*/
@JSONField(name = "pomodels")
@JsonProperty("pomodels")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("存储")
private String poModels;
/**
* 设置 [NAME]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
/**
* 设置 [TITLE]
*/
public void setTitle(String title){
this.title = title ;
this.modify("title",title);
}
/**
* 设置 [SYSTEMID]
*/
public void setSystemId(String systemId){
this.systemId = systemId ;
this.modify("systemid",systemId);
}
/**
* 设置 [PACKAGENAME]
*/
public void setPackageName(String packageName){
this.packageName = packageName ;
this.modify("packagename",packageName);
}
/**
* 设置 [DESCRIPTION]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
/**
* 设置 [SCHEMA]
*/
public void setSchema(PojoSchema schema){
this.schema = schema ;
this.modify("schema",schema);
}
/**
* 设置 [MODEL]
*/
public void setModel(String model){
this.model = model ;
this.modify("model",model);
}
/**
* 设置 [POMODELS]
*/
public void setPoModels(String poModels){
this.poModels = poModels ;
this.modify("pomodels",poModels);
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册