Browse Source

初始

master
郑根木 2 years ago
parent
commit
dfb59f9f44
4 changed files with 9 additions and 231 deletions
  1. +5
    -5
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java
  2. +2
    -4
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/DefaultSaveHandler.java
  3. +1
    -111
      smtweb-framework/sw-framework-core/src/main/resources/config/demo.json
  4. +1
    -111
      smtweb-framework/sw-framework-core/target/classes/config/demo.json

+ 5
- 5
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java View File

@@ -16,11 +16,11 @@ public interface SwEnum {
public static FieldType instance = new FieldType(); public static FieldType instance = new FieldType();


public static IntEnumBean ID = instance.addEnum(0, "主键"); public static IntEnumBean ID = instance.addEnum(0, "主键");
public static IntEnumBean PARENT_ID = instance.addEnum(1, "父ID");
public static IntEnumBean LEVEL_CODE = instance.addEnum(2, "级次码");
public static IntEnumBean ORDER = instance.addEnum(3, "排序字段");
public static IntEnumBean CODE = instance.addEnum(4, "编码字段");
public static IntEnumBean NAME = instance.addEnum(5, "名称字段");
public static IntEnumBean CODE = instance.addEnum(1, "编码字段");
public static IntEnumBean NAME = instance.addEnum(2, "名称字段");
public static IntEnumBean PARENT_ID = instance.addEnum(3, "父ID");
public static IntEnumBean LEVEL_CODE = instance.addEnum(4, "级次码");
public static IntEnumBean ORDER = instance.addEnum(5, "排序字段");
public static IntEnumBean CREATE_TIME = instance.addEnum(6, "创建时间"); public static IntEnumBean CREATE_TIME = instance.addEnum(6, "创建时间");
public static IntEnumBean LAST_TIME = instance.addEnum(7, "更新时间"); public static IntEnumBean LAST_TIME = instance.addEnum(7, "更新时间");
} }


+ 2
- 4
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/DefaultSaveHandler.java View File

@@ -32,10 +32,8 @@ public class DefaultSaveHandler<T extends DefaultEntity> extends AbstractSaveHan


@Override @Override
protected T createComp() throws Exception { protected T createComp() throws Exception {
final EntityDao dao = DbEngine.getInstance().findDao(tableName);
T bean = (T) dao.createBean();
bean.setEntityId(dao.nextId());
return bean;
final EntityDao<T> dao = DbEngine.getInstance().findDao(tableName);
return dao.createBean();
} }


@Override @Override


+ 1
- 111
smtweb-framework/sw-framework-core/src/main/resources/config/demo.json View File

@@ -1,111 +1 @@
{
"fields": [
{
"name": "mc_id",
"fieldType": "ID",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "ID"
},
{
"name": "mc_parent_id",
"fieldType": "PARENT",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "ID",
"link": "2"
},
{
"name": "mc_prj_id",
"fieldType": "",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "ID",
"link": "1"
},
{
"name": "mc_code",
"fieldType": "CODE",
"dataType": "CODE",
"null": "0",
"default": "",
"title": "编码",
"link": "",
"editor": ""
},
{
"name": "mc_create_uid",
"fieldType": "",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "创建人",
"link": "",
"editor": ""
},
{
"name": "mc_update_uid",
"fieldType": "",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "最后更新人",
"link": "",
"editor": ""
},
{
"name": "mc_create_at",
"fieldType": "",
"dataType": "DATETIME",
"null": "1",
"default": "-1",
"title": "创建时间",
"link": "",
"editor": ""
},
{
"name": "mc_create_at",
"fieldType": "",
"dataType": "DATETIME",
"null": "1",
"default": "-1",
"title": "创建时间",
"link": "",
"editor": ""
},
{
"name": "mc_update_at",
"fieldType": "",
"dataType": "DATETIME",
"null": "1",
"default": "-1",
"title": "最后更新时间",
"link": "",
"editor": ""
}
],
"indexes": [
{
"name": "pk",
"fields": "mc_id",
"type": "P"
}
],
"caches": [
{
"name": "pr",
"title": "按树型",
"fields": "mc_parent_id",
"type": "L"
},
{
"name": "prj",
"title": "按目录",
"fields": "mc_prj_id",
"type": "L"
}
]
}
{"fields":[{"name":"tb_id","fieldType":"0","dataType":"ID","null":"1","default":"-1","title":"ID"},{"name":"tb_prj_id","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"ID","link":"1"},{"name":"tb_mc_id","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"ID","link":"2"},{"name":"tb_db_id","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"ID","link":"3"},{"name":"tb_extends","fieldType":"","dataType":"REMARK","null":"0","default":"","title":"继承关系","link":"4","editor":""},{"name":"tb_name","fieldType":"1","dataType":"CODE","null":"0","default":"","title":"表名","link":"","editor":""},{"name":"tb_title","fieldType":"2","dataType":"NAME","null":"0","default":"","title":"中文名","link":"","editor":""},{"name":"tb_abbr","fieldType":"","dataType":"CODE","null":"1","default":"","title":"缩写,用于字段和索引组成","link":"","editor":""},{"name":"tb_type","fieldType":"","dataType":"SMALLINT","null":"1","default":"0","title":"类别:0-普通表,1树型表2编码表9-虚拟抽象表11视图","link":"","editor":""},{"name":"tb_need_cache","fieldType":"","dataType":"BOOL","null":"1","default":"0","title":"需要缓存","link":"","editor":""},{"name":"tb_content","fieldType":"","dataType":"TEXT","null":"1","default":"0","title":"表详细信息","link":"","editor":""},{"name":"tb_create_uid","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"创建人","link":"","editor":""},{"name":"tb_update_uid","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"最后更新人","link":"","editor":""},{"name":"tb_create_at","fieldType":"","dataType":"DATETIME","null":"1","default":"-1","title":"创建时间","link":"","editor":""},{"name":"tb_update_at","fieldType":"","dataType":"DATETIME","null":"1","default":"-1","title":"最后更新时间","link":"","editor":""}],"indexes":[{"name":"pk","fields":"tb_id","type":"P"}],"caches":[{"name":"n","title":"按表名","fields":"tb_name","type":"L"},{"name":"db","title":"按库名","fields":"tb_db_id","type":"L"},{"name":"prj","title":"按项目","fields":"tb_prj_id","type":"L"},{"name":"mc","title":"按项目","fields":"tb_mc_id","type":"L"}]}

+ 1
- 111
smtweb-framework/sw-framework-core/target/classes/config/demo.json View File

@@ -1,111 +1 @@
{
"fields": [
{
"name": "mc_id",
"fieldType": "ID",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "ID"
},
{
"name": "mc_parent_id",
"fieldType": "PARENT",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "ID",
"link": "2"
},
{
"name": "mc_prj_id",
"fieldType": "",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "ID",
"link": "1"
},
{
"name": "mc_code",
"fieldType": "CODE",
"dataType": "CODE",
"null": "0",
"default": "",
"title": "编码",
"link": "",
"editor": ""
},
{
"name": "mc_create_uid",
"fieldType": "",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "创建人",
"link": "",
"editor": ""
},
{
"name": "mc_update_uid",
"fieldType": "",
"dataType": "ID",
"null": "1",
"default": "-1",
"title": "最后更新人",
"link": "",
"editor": ""
},
{
"name": "mc_create_at",
"fieldType": "",
"dataType": "DATETIME",
"null": "1",
"default": "-1",
"title": "创建时间",
"link": "",
"editor": ""
},
{
"name": "mc_create_at",
"fieldType": "",
"dataType": "DATETIME",
"null": "1",
"default": "-1",
"title": "创建时间",
"link": "",
"editor": ""
},
{
"name": "mc_update_at",
"fieldType": "",
"dataType": "DATETIME",
"null": "1",
"default": "-1",
"title": "最后更新时间",
"link": "",
"editor": ""
}
],
"indexes": [
{
"name": "pk",
"fields": "mc_id",
"type": "P"
}
],
"caches": [
{
"name": "pr",
"title": "按树型",
"fields": "mc_parent_id",
"type": "L"
},
{
"name": "prj",
"title": "按目录",
"fields": "mc_prj_id",
"type": "L"
}
]
}
{"fields":[{"name":"tb_id","fieldType":"0","dataType":"ID","null":"1","default":"-1","title":"ID"},{"name":"tb_prj_id","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"ID","link":"1"},{"name":"tb_mc_id","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"ID","link":"2"},{"name":"tb_db_id","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"ID","link":"3"},{"name":"tb_extends","fieldType":"","dataType":"REMARK","null":"0","default":"","title":"继承关系","link":"4","editor":""},{"name":"tb_name","fieldType":"1","dataType":"CODE","null":"0","default":"","title":"表名","link":"","editor":""},{"name":"tb_title","fieldType":"2","dataType":"NAME","null":"0","default":"","title":"中文名","link":"","editor":""},{"name":"tb_abbr","fieldType":"","dataType":"CODE","null":"1","default":"","title":"缩写,用于字段和索引组成","link":"","editor":""},{"name":"tb_type","fieldType":"","dataType":"SMALLINT","null":"1","default":"0","title":"类别:0-普通表,1树型表2编码表9-虚拟抽象表11视图","link":"","editor":""},{"name":"tb_need_cache","fieldType":"","dataType":"BOOL","null":"1","default":"0","title":"需要缓存","link":"","editor":""},{"name":"tb_content","fieldType":"","dataType":"TEXT","null":"1","default":"0","title":"表详细信息","link":"","editor":""},{"name":"tb_create_uid","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"创建人","link":"","editor":""},{"name":"tb_update_uid","fieldType":"","dataType":"ID","null":"1","default":"-1","title":"最后更新人","link":"","editor":""},{"name":"tb_create_at","fieldType":"","dataType":"DATETIME","null":"1","default":"-1","title":"创建时间","link":"","editor":""},{"name":"tb_update_at","fieldType":"","dataType":"DATETIME","null":"1","default":"-1","title":"最后更新时间","link":"","editor":""}],"indexes":[{"name":"pk","fields":"tb_id","type":"P"}],"caches":[{"name":"n","title":"按表名","fields":"tb_name","type":"L"},{"name":"db","title":"按库名","fields":"tb_db_id","type":"L"},{"name":"prj","title":"按项目","fields":"tb_prj_id","type":"L"},{"name":"mc","title":"按项目","fields":"tb_mc_id","type":"L"}]}

Loading…
Cancel
Save