删除不需要的底层工具包

pull/2621/head
zhangdaiscott 2021-06-02 15:21:16 +08:00
parent 63c3dd26f5
commit af3afc7263
12 changed files with 0 additions and 1106 deletions

View File

@ -1,28 +0,0 @@
package org.jeecg.common.util.jsonschema;
import lombok.Data;
/**
*
*/
@Data
public class BaseColumn {
/**
* -
*/
private String title;
/**
* -
*/
private String field;
public BaseColumn(){}
public BaseColumn(String title,String field){
this.title = title;
this.field = field;
}
}

View File

@ -1,195 +0,0 @@
package org.jeecg.common.util.jsonschema;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.system.vo.DictModel;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
*
*/
public abstract class CommonProperty implements Serializable{
private static final long serialVersionUID = -426159949502493187L;
protected String key;
/**
* <p>
* <p>nullbooleanobjectarraynumberstringinteger
* <p>
*
*/
protected String type;
/**
* JsonSchemaenum
* <p>
* null
*
* {
* "type": "string",
* "enum": ["1", "2", "3"] include
* }
*/
protected List<DictModel> include;
/**
* JsonSchemaconst
* <p>null
*
*/
protected Object constant;
//三个自定义 属性
protected String view;// 展示类型
protected String title;//数据库字段备注
protected Integer order;//字段显示排序
protected boolean disabled;//是否禁用
protected String defVal; // 字段默认值
protected String fieldExtendJson;//扩展参数
protected Integer dbPointLength;//小数点
public String getDefVal() {
return defVal;
}
public void setDefVal(String defVal) {
this.defVal = defVal;
}
public boolean isDisabled() {
return disabled;
}
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}
public String getView() {
return view;
}
public void setView(String view) {
this.view = view;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public List<DictModel> getInclude() {
return include;
}
public void setInclude(List<DictModel> include) {
this.include = include;
}
public Object getConstant() {
return constant;
}
public void setConstant(Object constant) {
this.constant = constant;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
public String getFieldExtendJson() {
return fieldExtendJson;
}
public void setFieldExtendJson(String fieldExtendJson) {
this.fieldExtendJson = fieldExtendJson;
}
public Integer getDbPointLength() {
return dbPointLength;
}
public void setDbPointLength(Integer dbPointLength) {
this.dbPointLength = dbPointLength;
}
/**
* mapkey
* <P>key ---> Property JSONkey
* <P>prop --> JSON object
* @return
*/
public abstract Map<String,Object> getPropertyJson();
public JSONObject getCommonJson() {
JSONObject json = new JSONObject();
json.put("type", type);
if(include!=null && include.size()>0) {
json.put("enum", include);
}
if(constant!=null) {
json.put("const", constant);
}
if(title!=null) {
json.put("title", title);
}
if(order!=null) {
json.put("order", order);
}
if(view==null) {
json.put("view", "input");
}else {
json.put("view", view);
}
if(disabled) {
String str = "{\"widgetattrs\":{\"disabled\":true}}";
JSONObject ui = JSONObject.parseObject(str);
json.put("ui", ui);
}
if (defVal!=null && defVal.length()>0) {
json.put("defVal", defVal);
}
if(fieldExtendJson != null){
json.put("fieldExtendJson", fieldExtendJson);
}
if(dbPointLength !=null ) {
json.put("dbPointLength", dbPointLength);
}
return json;
}
}

View File

@ -1,87 +0,0 @@
package org.jeecg.common.util.jsonschema;
import java.io.Serializable;
import java.util.List;
/**
* JsonSchema
* < http://json-schema.org/draft-07/schema# >
*/
public class JsonSchemaDescrip implements Serializable{
/**
*
*/
private static final long serialVersionUID = 7682073117441544718L;
private String $schema = "http://json-schema.org/draft-07/schema#";
/**
*
*/
private String title;
/**
*
*/
private String description;
/**
*type JSON JSON object
*/
private String type;
private List<String> required;
public List<String> getRequired() {
return required;
}
public void setRequired(List<String> required) {
this.required = required;
}
public String get$schema() {
return $schema;
}
public void set$schema(String $schema) {
this.$schema = $schema;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public JsonSchemaDescrip() {}
public JsonSchemaDescrip(List<String> required) {
this.description="我是一个jsonschema description";
this.title="我是一个jsonschema title";
this.type="object";
this.required = required;
}
}

View File

@ -1,70 +0,0 @@
package org.jeecg.common.util.jsonschema;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class JsonschemaUtil {
/**
* JsonSchema
*
* @param descrip
* @param propertyList
* @return
*/
public static JSONObject getJsonSchema(JsonSchemaDescrip descrip, List<CommonProperty> propertyList) {
JSONObject obj = new JSONObject();
obj.put("$schema", descrip.get$schema());
obj.put("type", descrip.getType());
obj.put("title", descrip.getTitle());
List<String> requiredArr = descrip.getRequired();
obj.put("required", requiredArr);
JSONObject properties = new JSONObject();
for (CommonProperty commonProperty : propertyList) {
Map<String, Object> map = commonProperty.getPropertyJson();
properties.put(map.get("key").toString(), map.get("prop"));
}
obj.put("properties", properties);
//鬼知道这里为什么报错 org.jeecg.modules.system.model.DictModel cannot be cast to org.jeecg.modules.system.model.DictModel
//log.info("---JSONSchema--->"+obj.toJSONString());
return obj;
}
/**
* JsonSchema
* @param title
* @param requiredArr
* @param propertyList
* @return
*/
public static JSONObject getSubJsonSchema(String title,List<String> requiredArr,List<CommonProperty> propertyList) {
JSONObject obj = new JSONObject();
obj.put("type", "object");
obj.put("view", "tab");
obj.put("title", title);
if(requiredArr==null) {
requiredArr = new ArrayList<String>();
}
obj.put("required", requiredArr);
JSONObject properties = new JSONObject();
for (CommonProperty commonProperty : propertyList) {
Map<String, Object> map = commonProperty.getPropertyJson();
properties.put(map.get("key").toString(), map.get("prop"));
}
obj.put("properties", properties);
//log.info("---JSONSchema--->"+obj.toString());
return obj;
}
}

View File

@ -1,82 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import java.util.HashMap;
import java.util.Map;
import org.jeecg.common.util.jsonschema.CommonProperty;
import com.alibaba.fastjson.JSONObject;
/**
*
* @author 86729
*
*/
public class DictProperty extends CommonProperty {
private static final long serialVersionUID = 3786503639885610767L;
//字典三属性
private String dictCode;
private String dictTable;
private String dictText;
public String getDictCode() {
return dictCode;
}
public void setDictCode(String dictCode) {
this.dictCode = dictCode;
}
public String getDictTable() {
return dictTable;
}
public void setDictTable(String dictTable) {
this.dictTable = dictTable;
}
public String getDictText() {
return dictText;
}
public void setDictText(String dictText) {
this.dictText = dictText;
}
public DictProperty() {}
/**
*
*/
public DictProperty(String key,String title,String dictTable,String dictCode,String dictText) {
this.type = "string";
this.view = "sel_search";
this.key = key;
this.title = title;
this.dictCode = dictCode;
this.dictTable= dictTable;
this.dictText= dictText;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
if(dictCode!=null) {
prop.put("dictCode",dictCode);
}
if(dictTable!=null) {
prop.put("dictTable",dictTable);
}
if(dictText!=null) {
prop.put("dictText",dictText);
}
map.put("prop",prop);
return map;
}
//TODO 重构问题:数据字典 只是字符串类的还是有存储的数值类型?只有字符串请跳过这个 只改前端
}

View File

@ -1,38 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import java.util.HashMap;
import java.util.Map;
import org.jeecg.common.util.jsonschema.CommonProperty;
import com.alibaba.fastjson.JSONObject;
/**
*
* @author 86729
*
*/
public class HiddenProperty extends CommonProperty {
private static final long serialVersionUID = -8939298551502162479L;
public HiddenProperty() {}
public HiddenProperty(String key,String title) {
this.type = "string";
this.view = "hidden";
this.key = key;
this.title = title;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
prop.put("hidden",true);
map.put("prop",prop);
return map;
}
}

View File

@ -1,66 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.util.jsonschema.BaseColumn;
import org.jeecg.common.util.jsonschema.CommonProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class LinkDownProperty extends CommonProperty {
/**
*
*/
String dictTable;
/**
*
*/
List<BaseColumn> otherColumns;
public String getDictTable(){
return this.dictTable;
}
public void setDictTable(String dictTable){
this.dictTable = dictTable;
}
public List<BaseColumn> getOtherColumns(){
return this.otherColumns;
}
public void setOtherColumns(List<BaseColumn> otherColumns){
this.otherColumns = otherColumns;
}
public LinkDownProperty() {}
/**
*
*/
public LinkDownProperty(String key,String title,String dictTable) {
this.type = "string";
this.view = "link_down";
this.key = key;
this.title = title;
this.dictTable= dictTable;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String, Object> map = new HashMap<>();
map.put("key", getKey());
JSONObject prop = getCommonJson();
JSONObject temp = JSONObject.parseObject(this.dictTable);
prop.put("config", temp);
prop.put("others", otherColumns);
map.put("prop", prop);
return map;
}
}

View File

@ -1,153 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.util.jsonschema.CommonProperty;
import com.alibaba.fastjson.JSONObject;
public class NumberProperty extends CommonProperty {
private static final long serialVersionUID = -558615331436437200L;
/**
*
*
* multipleOf0
*/
private Integer multipleOf;
/**
*
* maximum
*
*/
private Integer maxinum;
/**
*
* exclusiveMaximum
* exclusiveMaximum
*/
private Integer exclusiveMaximum;
/**
*
*/
private Integer minimum;
/**
*
*/
private Integer exclusiveMinimum;
private String pattern;
public Integer getMultipleOf() {
return multipleOf;
}
public void setMultipleOf(Integer multipleOf) {
this.multipleOf = multipleOf;
}
public Integer getMaxinum() {
return maxinum;
}
public void setMaxinum(Integer maxinum) {
this.maxinum = maxinum;
}
public Integer getExclusiveMaximum() {
return exclusiveMaximum;
}
public void setExclusiveMaximum(Integer exclusiveMaximum) {
this.exclusiveMaximum = exclusiveMaximum;
}
public Integer getMinimum() {
return minimum;
}
public void setMinimum(Integer minimum) {
this.minimum = minimum;
}
public Integer getExclusiveMinimum() {
return exclusiveMinimum;
}
public void setExclusiveMinimum(Integer exclusiveMinimum) {
this.exclusiveMinimum = exclusiveMinimum;
}
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public NumberProperty() {}
/**
*
* @param key
* @param title
* @param type numberinteger
*/
public NumberProperty(String key,String title,String type) {
this.key = key;
this.type = type;
this.title = title;
this.view = "number";
}
/**
*
* @param key
* @param type
* @param view list-checkbox-radio
* @param include
*/
public NumberProperty(String key,String title,String view,List<DictModel> include) {
this.type = "integer";
this.key = key;
this.view = view;
this.title = title;
this.include = include;
}
@Override
public Map<String,Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
if(multipleOf!=null) {
prop.put("multipleOf",multipleOf);
}
if(maxinum!=null) {
prop.put("maxinum",maxinum);
}
if(exclusiveMaximum!=null) {
prop.put("exclusiveMaximum",exclusiveMaximum);
}
if(minimum!=null) {
prop.put("minimum",minimum);
}
if(exclusiveMinimum!=null) {
prop.put("exclusiveMinimum",exclusiveMinimum);
}
if(pattern!=null) {
prop.put("pattern",pattern);
}
map.put("prop",prop);
return map;
}
}

View File

@ -1,76 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jeecg.common.util.jsonschema.CommonProperty;
import com.alibaba.fastjson.JSONObject;
public class PopupProperty extends CommonProperty {
private static final long serialVersionUID = -3200493311633999539L;
private String code;
private String destFields;
private String orgFields;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDestFields() {
return destFields;
}
public void setDestFields(String destFields) {
this.destFields = destFields;
}
public String getOrgFields() {
return orgFields;
}
public void setOrgFields(String orgFields) {
this.orgFields = orgFields;
}
public PopupProperty() {}
public PopupProperty(String key,String title,String code,String destFields,String orgFields) {
this.view = "popup";
this.type = "string";
this.key = key;
this.title = title;
this.code = code;
this.destFields=destFields;
this.orgFields=orgFields;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
if(code!=null) {
prop.put("code",code);
}
if(destFields!=null) {
prop.put("destFields",destFields);
}
if(orgFields!=null) {
prop.put("orgFields",orgFields);
}
map.put("prop",prop);
return map;
}
}

View File

@ -1,119 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.util.jsonschema.CommonProperty;
import com.alibaba.fastjson.JSONObject;
public class StringProperty extends CommonProperty {
private static final long serialVersionUID = -3200493311633999539L;
private Integer maxLength;
private Integer minLength;
/**
* ECMA 262
*/
private String pattern;
/**
*
*/
private String errorInfo;
public Integer getMaxLength() {
return maxLength;
}
public void setMaxLength(Integer maxLength) {
this.maxLength = maxLength;
}
public Integer getMinLength() {
return minLength;
}
public void setMinLength(Integer minLength) {
this.minLength = minLength;
}
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public String getErrorInfo() {
return errorInfo;
}
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public StringProperty() {}
/**
*
* @param key
* @param title
* @param view
* @param maxLength
*/
public StringProperty(String key,String title,String view,Integer maxLength) {
this.maxLength = maxLength;
this.key = key;
this.view = view;
this.title = title;
this.type = "string";
}
/**
*
* @param key
* @param title
* @param view list-checkbox-radio
* @param maxLength
* @param include
*/
public StringProperty(String key,String title,String view,Integer maxLength,List<DictModel> include) {
this.maxLength = maxLength;
this.key = key;
this.view = view;
this.title = title;
this.type = "string";
this.include = include;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
if(maxLength!=null) {
prop.put("maxLength",maxLength);
}
if(minLength!=null) {
prop.put("minLength",minLength);
}
if(pattern!=null) {
prop.put("pattern",pattern);
}
if(errorInfo!=null) {
prop.put("errorInfo",errorInfo);
}
map.put("prop",prop);
return map;
}
}

View File

@ -1,46 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.util.jsonschema.CommonProperty;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class SwitchProperty extends CommonProperty {
//扩展参数配置信息
private String extendStr;
public SwitchProperty() {}
/**
*
*/
public SwitchProperty(String key, String title, String extendStr) {
this.type = "string";
this.view = "switch";
this.key = key;
this.title = title;
this.extendStr = extendStr;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
JSONArray array = new JSONArray();
if(extendStr!=null) {
array = JSONArray.parseArray(extendStr);
prop.put("extendOption",array);
}
map.put("prop",prop);
return map;
}
//TODO 重构问题:数据字典 只是字符串类的还是有存储的数值类型?只有字符串请跳过这个 只改前端
}

View File

@ -1,146 +0,0 @@
package org.jeecg.common.util.jsonschema.validate;
import java.util.HashMap;
import java.util.Map;
import org.jeecg.common.util.jsonschema.CommonProperty;
import com.alibaba.fastjson.JSONObject;
/**
*
* @author 86729
*
*/
public class TreeSelectProperty extends CommonProperty {
private static final long serialVersionUID = 3786503639885610767L;
private String dict;//表名,文本,id
private String pidField;//父级字段 默认pid
private String pidValue;//父级节点的值 暂时没用到 默认为0
private String hasChildField;
private String textField;//树形下拉保存text值的字段名
/**
* pid 1 0
*/
private Integer pidComponent = 0;
public String getDict() {
return dict;
}
public void setDict(String dict) {
this.dict = dict;
}
public String getPidField() {
return pidField;
}
public void setPidField(String pidField) {
this.pidField = pidField;
}
public String getPidValue() {
return pidValue;
}
public void setPidValue(String pidValue) {
this.pidValue = pidValue;
}
public String getHasChildField() {
return hasChildField;
}
public void setHasChildField(String hasChildField) {
this.hasChildField = hasChildField;
}
public TreeSelectProperty() {}
public String getTextField() {
return textField;
}
public void setTextField(String textField) {
this.textField = textField;
}
public Integer getPidComponent() {
return pidComponent;
}
public void setPidComponent(Integer pidComponent) {
this.pidComponent = pidComponent;
}
/**
*
*/
public TreeSelectProperty(String key,String title,String dict,String pidField,String pidValue) {
this.type = "string";
this.view = "sel_tree";
this.key = key;
this.title = title;
this.dict = dict;
this.pidField= pidField;
this.pidValue= pidValue;
}
/**
*
* @param key
* @param title
* @param pidValue
*/
public TreeSelectProperty(String key,String title,String pidValue) {
this.type = "string";
this.view = "cat_tree";
this.key = key;
this.title = title;
this.pidValue = pidValue;
}
/**
* text
* @param key
* @param title
* @param pidValue
* @param textField
*/
public TreeSelectProperty(String key,String title,String pidValue,String textField) {
this(key,title,pidValue);
this.textField = textField;
}
@Override
public Map<String, Object> getPropertyJson() {
Map<String,Object> map = new HashMap<>();
map.put("key",getKey());
JSONObject prop = getCommonJson();
if(dict!=null) {
prop.put("dict",dict);
}
if(pidField!=null) {
prop.put("pidField",pidField);
}
if(pidValue!=null) {
prop.put("pidValue",pidValue);
}
if(textField!=null) {
prop.put("textField",textField);
}
if(hasChildField!=null) {
prop.put("hasChildField",hasChildField);
}
if(pidComponent!=null) {
prop.put("pidComponent",pidComponent);
}
map.put("prop",prop);
return map;
}
}