Skip to content

Commit b218d51

Browse files
authored
feat: Add model API (opentiny#249)
1 parent 2929ea3 commit b218d51

File tree

16 files changed

+1286
-4
lines changed

16 files changed

+1286
-4
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
drop table if exists `t_model`;
2+
3+
create table `t_model`
4+
(
5+
`id` int not null auto_increment comment '主键id',
6+
`name_cn` varchar(255) not null comment '中文名称',
7+
`name_en` varchar(255) not null comment '英文名称',
8+
`version` varchar(255) comment '版本',
9+
`model_url` varchar(255) comment '模型url',
10+
`parameters` varchar(2000) not null comment '字段参数',
11+
`method` longtext comment '方法',
12+
`description` varchar(2000) comment '描述',
13+
`created_by` varchar(60) not null comment '创建人',
14+
`created_time` timestamp not null default current_timestamp comment '创建时间',
15+
`last_updated_by` varchar(60) not null comment '最后修改人',
16+
`last_updated_time` timestamp not null default current_timestamp comment '更新时间',
17+
`tenant_id` varchar(60) comment '租户id',
18+
`renter_id` varchar(60) comment '业务租户id',
19+
`site_id` varchar(60) comment '站点id,设计预留字段',
20+
primary key (`id`) using btree,
21+
unique index `u_idx_model` (`name_en`,`version`) using btree
22+
) engine = innodb comment = '模型表';

app/src/main/resources/sql/h2/update_all_tables_ddl.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ ALTER TABLE t_platform MODIFY tenant_id varchar(60) NULL;
2727
ALTER TABLE t_platform_history MODIFY tenant_id varchar(60) NULL;
2828
ALTER TABLE t_task_record MODIFY tenant_id varchar(60) NULL;
2929
ALTER TABLE t_user MODIFY tenant_id varchar(60) NULL;
30-
31-
ALTER TABLE t_component_library ADD app_id int NULL;
32-
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
drop table if exists `t_model`;
2+
3+
create table `t_model`
4+
(
5+
`id` int not null auto_increment comment '主键id',
6+
`name_cn` varchar(255) not null comment '中文名称',
7+
`name_en` varchar(255) not null comment '英文名称',
8+
`version` varchar(255) comment '版本',
9+
`model_url` varchar(255) comment '模型url',
10+
`parameters` varchar(2000) not null comment '字段参数',
11+
`method` longtext comment '方法',
12+
`description` varchar(2000) comment '描述',
13+
`created_by` varchar(60) not null comment '创建人',
14+
`created_time` timestamp not null default current_timestamp comment '创建时间',
15+
`last_updated_by` varchar(60) not null comment '最后修改人',
16+
`last_updated_time` timestamp not null default current_timestamp comment '更新时间',
17+
`tenant_id` varchar(60) comment '租户id',
18+
`renter_id` varchar(60) comment '业务租户id',
19+
`site_id` varchar(60) comment '站点id,设计预留字段',
20+
primary key (`id`) using btree,
21+
unique index `u_idx_model` (`name_en`,`version`) using btree
22+
) engine = innodb comment = '模型表';

base/src/main/java/com/tinyengine/it/common/enums/Enums.java

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,4 +1003,168 @@ public String getValue() {
10031003
return value;
10041004
}
10051005
}
1006+
1007+
public enum methodName {
1008+
1009+
/**
1010+
* CREATED name.
1011+
*/
1012+
CREATED("新增方法"),
1013+
1014+
/**
1015+
* UPDATE name.
1016+
*/
1017+
UPDATE("修改方法"),
1018+
1019+
/**
1020+
* DELETE name.
1021+
*/
1022+
DELETE("删除方法"),
1023+
1024+
/**
1025+
* QUERY name.
1026+
*/
1027+
QUERY("查询方法"),
1028+
1029+
/**
1030+
* INSERTAPI name.
1031+
*/
1032+
INSERTAPI("insertApi"),
1033+
1034+
/**
1035+
* UPDATEAPI name.
1036+
*/
1037+
UPDATEAPI("updateApi"),
1038+
1039+
/**
1040+
* QUERYAPI name.
1041+
*/
1042+
QUERYAPI("queryApi"),
1043+
1044+
/**
1045+
* INSERTAPI name.
1046+
*/
1047+
DELETEAPI("deleteApi");
1048+
1049+
private final String value;
1050+
1051+
methodName(String value) {
1052+
this.value = value;
1053+
}
1054+
1055+
/**
1056+
* Gets value.
1057+
*
1058+
* @return the value
1059+
*/
1060+
public String getValue() {
1061+
return value;
1062+
}
1063+
}
1064+
1065+
public enum paramType {
1066+
1067+
/**
1068+
* TYPE name.
1069+
*/
1070+
OBJECT("Object"),
1071+
1072+
/**
1073+
* TYPE name.
1074+
*/
1075+
NUMBER("Number"),
1076+
1077+
/**
1078+
* TYPE name.
1079+
*/
1080+
STRING("String"),
1081+
1082+
/**
1083+
* TYPE name.
1084+
*/
1085+
ENUM("Enum");
1086+
1087+
private final String value;
1088+
1089+
paramType(String value) {
1090+
this.value = value;
1091+
}
1092+
1093+
/**
1094+
* Gets value.
1095+
*
1096+
* @return the value
1097+
*/
1098+
public String getValue() {
1099+
return value;
1100+
}
1101+
}
1102+
1103+
public enum methodParam {
1104+
1105+
/**
1106+
* ID
1107+
*/
1108+
ID("id"),
1109+
/**
1110+
* CURRENTPAGE
1111+
*/
1112+
CURRENTPAGE("currentPage"),
1113+
1114+
/**
1115+
* PAGESIZE
1116+
*/
1117+
PAGESIZE("pageSize"),
1118+
1119+
/**
1120+
* NAMECN
1121+
*/
1122+
NAMECN("nameCn"),
1123+
1124+
/**
1125+
* NAMEEN
1126+
*/
1127+
NAMEEN("nameEn"),
1128+
1129+
/**
1130+
* PARAMS
1131+
*/
1132+
PARAMS("params"),
1133+
1134+
/**
1135+
* CODE
1136+
*/
1137+
CODE("code"),
1138+
1139+
/**
1140+
* MESSAGE
1141+
*/
1142+
MESSAGE("message"),
1143+
1144+
/**
1145+
* DATA
1146+
*/
1147+
DATA("data"),
1148+
1149+
/**
1150+
* TOTAL
1151+
*/
1152+
TOTAL("total");
1153+
1154+
1155+
private final String value;
1156+
1157+
methodParam(String value) {
1158+
this.value = value;
1159+
}
1160+
1161+
/**
1162+
* Gets value.
1163+
*
1164+
* @return the value
1165+
*/
1166+
public String getValue() {
1167+
return value;
1168+
}
1169+
}
10061170
}

0 commit comments

Comments
 (0)