Skip to content

Commit 2b76b64

Browse files
authored
Add code generation and notice SQL scripts (#966)
1 parent dd3165a commit 2b76b64

File tree

8 files changed

+173
-0
lines changed

8 files changed

+173
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
insert into gen_business (id, app_name, table_name, doc_comment, table_comment, class_name, schema_name, filename, default_datetime_column, api_version, gen_path, remark, created_time, updated_time)
2+
values (1, 'test', 'sys_opera_log', '操作日志表', '操作日志表', 'SysOperaLog', 'SysOperaLog', 'sys_opera_log', true, 'v1', null, null, '2025-12-15 15:30:33', null);
3+
4+
insert into gen_column (id, name, comment, type, pd_type, `default`, sort, `length`, is_pk, is_nullable, gen_business_id)
5+
values
6+
(1, 'trace_id', '请求跟踪 ID', 'String', 'str', null, 2, 32, false, false, 1),
7+
(2, 'username', '用户名', 'String', 'str', null, 3, 64, false, true, 1),
8+
(3, 'method', '请求类型', 'String', 'str', null, 4, 32, false, false, 1),
9+
(4, 'title', '操作模块', 'String', 'str', null, 5, 256, false, false, 1),
10+
(5, 'path', '请求路径', 'String', 'str', null, 6, 512, false, false, 1),
11+
(6, 'ip', 'IP地址', 'String', 'str', null, 7, 64, false, false, 1),
12+
(7, 'country', '国家', 'String', 'str', null, 8, 64, false, true, 1),
13+
(8, 'region', '地区', 'String', 'str', null, 9, 64, false, true, 1),
14+
(9, 'city', '城市', 'String', 'str', null, 10, 64, false, true, 1),
15+
(10, 'user_agent', '请求头', 'String', 'str', null, 11, 512, false, false, 1),
16+
(11, 'os', '操作系统', 'String', 'str', null, 12, 64, false, true, 1),
17+
(12, 'browser', '浏览器', 'String', 'str', null, 13, 64, false, true, 1),
18+
(13, 'device', '设备', 'String', 'str', null, 14, 64, false, true, 1),
19+
(14, 'args', '请求参数', 'JSON', 'dict', null, 15, 0, false, true, 1),
20+
(15, 'status', '操作状态(0异常 1正常)', 'INTEGER', 'int', null, 16, 0, false, false, 1),
21+
(16, 'code', '操作状态码', 'String', 'str', null, 17, 32, false, false, 1),
22+
(17, 'msg', '提示消息', 'TEXT', 'str', null, 18, 0, false, true, 1),
23+
(18, 'cost_time', '请求耗时(ms)', 'String', 'str', null, 19, 0, false, false, 1),
24+
(19, 'opera_time', '操作时间', 'String', 'str', null, 20, 0, false, false, 1);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
insert into gen_business (id, app_name, table_name, doc_comment, table_comment, class_name, schema_name, filename, default_datetime_column, api_version, gen_path, remark, created_time, updated_time)
2+
values (2112248797819043840, 'test', 'sys_opera_log', '操作日志表', '操作日志表', 'SysOperaLog', 'SysOperaLog', 'sys_opera_log', true, 'v1', null, null, '2025-12-15 15:30:33', null);
3+
4+
insert into gen_column (id, name, comment, type, pd_type, `default`, sort, `length`, is_pk, is_nullable, gen_business_id)
5+
values
6+
(2112248797881958400, 'trace_id', '请求跟踪 ID', 'String', 'str', null, 2, 32, false, false, 2112248797819043840),
7+
(2112248797944872960, 'username', '用户名', 'String', 'str', null, 3, 64, false, true, 2112248797819043840),
8+
(2112248798007787520, 'method', '请求类型', 'String', 'str', null, 4, 32, false, false, 2112248797819043840),
9+
(2112248798070702080, 'title', '操作模块', 'String', 'str', null, 5, 256, false, false, 2112248797819043840),
10+
(2112248798133616640, 'path', '请求路径', 'String', 'str', null, 6, 512, false, false, 2112248797819043840),
11+
(2112248798196531200, 'ip', 'IP地址', 'String', 'str', null, 7, 64, false, false, 2112248797819043840),
12+
(2112248798259445760, 'country', '国家', 'String', 'str', null, 8, 64, false, true, 2112248797819043840),
13+
(2112248798322360320, 'region', '地区', 'String', 'str', null, 9, 64, false, true, 2112248797819043840),
14+
(2112248798385274880, 'city', '城市', 'String', 'str', null, 10, 64, false, true, 2112248797819043840),
15+
(2112248798448189440, 'user_agent', '请求头', 'String', 'str', null, 11, 512, false, false, 2112248797819043840),
16+
(2112248798511104000, 'os', '操作系统', 'String', 'str', null, 12, 64, false, true, 2112248797819043840),
17+
(2112248798574018560, 'browser', '浏览器', 'String', 'str', null, 13, 64, false, true, 2112248797819043840),
18+
(2112248798636933120, 'device', '设备', 'String', 'str', null, 14, 64, false, true, 2112248797819043840),
19+
(2112248798699847680, 'args', '请求参数', 'JSON', 'dict', null, 15, 0, false, true, 2112248797819043840),
20+
(2112248798762762240, 'status', '操作状态(0异常 1正常)', 'INTEGER', 'int', null, 16, 0, false, false, 2112248797819043840),
21+
(2112248798825676800, 'code', '操作状态码', 'String', 'str', null, 17, 32, false, false, 2112248797819043840),
22+
(2112248798888591360, 'msg', '提示消息', 'TEXT', 'str', null, 18, 0, false, true, 2112248797819043840),
23+
(2112248798951505920, 'cost_time', '请求耗时(ms)', 'String', 'str', null, 19, 0, false, false, 2112248797819043840),
24+
(2112248799014420480, 'opera_time', '操作时间', 'String', 'str', null, 20, 0, false, false, 2112248797819043840);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
insert into gen_business (id, app_name, table_name, doc_comment, table_comment, class_name, schema_name, filename, default_datetime_column, api_version, gen_path, remark, created_time, updated_time)
2+
values (1, 'test', 'sys_opera_log', '操作日志表', '操作日志表', 'SysOperaLog', 'SysOperaLog', 'sys_opera_log', true, 'v1', null, null, '2025-12-15 15:30:33', null);
3+
4+
insert into gen_column (id, name, comment, type, pd_type, "default", sort, "length", is_pk, is_nullable, gen_business_id)
5+
values
6+
(1, 'trace_id', '请求跟踪 ID', 'String', 'str', null, 2, 32, false, false, 1),
7+
(2, 'username', '用户名', 'String', 'str', null, 3, 64, false, true, 1),
8+
(3, 'method', '请求类型', 'String', 'str', null, 4, 32, false, false, 1),
9+
(4, 'title', '操作模块', 'String', 'str', null, 5, 256, false, false, 1),
10+
(5, 'path', '请求路径', 'String', 'str', null, 6, 512, false, false, 1),
11+
(6, 'ip', 'IP地址', 'String', 'str', null, 7, 64, false, false, 1),
12+
(7, 'country', '国家', 'String', 'str', null, 8, 64, false, true, 1),
13+
(8, 'region', '地区', 'String', 'str', null, 9, 64, false, true, 1),
14+
(9, 'city', '城市', 'String', 'str', null, 10, 64, false, true, 1),
15+
(10, 'user_agent', '请求头', 'String', 'str', null, 11, 512, false, false, 1),
16+
(11, 'os', '操作系统', 'String', 'str', null, 12, 64, false, true, 1),
17+
(12, 'browser', '浏览器', 'String', 'str', null, 13, 64, false, true, 1),
18+
(13, 'device', '设备', 'String', 'str', null, 14, 64, false, true, 1),
19+
(14, 'args', '请求参数', 'JSON', 'dict', null, 15, 0, false, true, 1),
20+
(15, 'status', '操作状态(0异常 1正常)', 'INTEGER', 'int', null, 16, 0, false, false, 1),
21+
(16, 'code', '操作状态码', 'String', 'str', null, 17, 32, false, false, 1),
22+
(17, 'msg', '提示消息', 'TEXT', 'str', null, 18, 0, false, true, 1),
23+
(18, 'cost_time', '请求耗时(ms)', 'String', 'str', null, 19, 0, false, false, 1),
24+
(19, 'opera_time', '操作时间', 'String', 'str', null, 20, 0, false, false, 1);
25+
26+
select setval(pg_get_serial_sequence('gen_business', 'id'),coalesce(max(id), 0) + 1, true) from gen_business;
27+
select setval(pg_get_serial_sequence('gen_column', 'id'),coalesce(max(id), 0) + 1, true) from gen_column;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
insert into gen_business (id, app_name, table_name, doc_comment, table_comment, class_name, schema_name, filename, default_datetime_column, api_version, gen_path, remark, created_time, updated_time)
2+
values (2112248797819043840, 'test', 'sys_opera_log', '操作日志表', '操作日志表', 'SysOperaLog', 'SysOperaLog', 'sys_opera_log', true, 'v1', null, null, '2025-12-15 15:30:33', null);
3+
4+
insert into gen_column (id, name, comment, type, pd_type, "default", sort, "length", is_pk, is_nullable, gen_business_id)
5+
values
6+
(2112248797881958400, 'trace_id', '请求跟踪 ID', 'String', 'str', null, 2, 32, false, false, 2112248797819043840),
7+
(2112248797944872960, 'username', '用户名', 'String', 'str', null, 3, 64, false, true, 2112248797819043840),
8+
(2112248798007787520, 'method', '请求类型', 'String', 'str', null, 4, 32, false, false, 2112248797819043840),
9+
(2112248798070702080, 'title', '操作模块', 'String', 'str', null, 5, 256, false, false, 2112248797819043840),
10+
(2112248798133616640, 'path', '请求路径', 'String', 'str', null, 6, 512, false, false, 2112248797819043840),
11+
(2112248798196531200, 'ip', 'IP地址', 'String', 'str', null, 7, 64, false, false, 2112248797819043840),
12+
(2112248798259445760, 'country', '国家', 'String', 'str', null, 8, 64, false, true, 2112248797819043840),
13+
(2112248798322360320, 'region', '地区', 'String', 'str', null, 9, 64, false, true, 2112248797819043840),
14+
(2112248798385274880, 'city', '城市', 'String', 'str', null, 10, 64, false, true, 2112248797819043840),
15+
(2112248798448189440, 'user_agent', '请求头', 'String', 'str', null, 11, 512, false, false, 2112248797819043840),
16+
(2112248798511104000, 'os', '操作系统', 'String', 'str', null, 12, 64, false, true, 2112248797819043840),
17+
(2112248798574018560, 'browser', '浏览器', 'String', 'str', null, 13, 64, false, true, 2112248797819043840),
18+
(2112248798636933120, 'device', '设备', 'String', 'str', null, 14, 64, false, true, 2112248797819043840),
19+
(2112248798699847680, 'args', '请求参数', 'JSON', 'dict', null, 15, 0, false, true, 2112248797819043840),
20+
(2112248798762762240, 'status', '操作状态(0异常 1正常)', 'INTEGER', 'int', null, 16, 0, false, false, 2112248797819043840),
21+
(2112248798825676800, 'code', '操作状态码', 'String', 'str', null, 17, 32, false, false, 2112248797819043840),
22+
(2112248798888591360, 'msg', '提示消息', 'TEXT', 'str', null, 18, 0, false, true, 2112248797819043840),
23+
(2112248798951505920, 'cost_time', '请求耗时(ms)', 'String', 'str', null, 19, 0, false, false, 2112248797819043840),
24+
(2112248799014420480, 'opera_time', '操作时间', 'String', 'str', null, 20, 0, false, false, 2112248797819043840);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
insert into sys_notice (id, title, type, status, content, created_time, updated_time)
2+
values (1, 'hahahahahaahahaha', 0, 1, '你好😄
3+
4+
```
5+
print(''fba yyds'')
6+
```
7+
8+
⚡⚡⚡
9+
10+
| col1 | col2 | col3 |
11+
| ---- | ---- | ---- |
12+
| | | |
13+
| | | |
14+
15+
* 1
16+
* 2
17+
* 3
18+
', '2025-12-15 15:33:16', null);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
insert into sys_notice (id, title, type, status, content, created_time, updated_time)
2+
values (2112248797756129280, 'hahahahahaahahaha', 0, 1, '你好😄
3+
4+
```
5+
print(''fba yyds'')
6+
```
7+
8+
⚡⚡⚡
9+
10+
| col1 | col2 | col3 |
11+
| ---- | ---- | ---- |
12+
| | | |
13+
| | | |
14+
15+
* 1
16+
* 2
17+
* 3
18+
', '2025-12-15 15:33:16', null);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
insert into sys_notice (id, title, type, status, content, created_time, updated_time)
2+
values (1, 'hahahahahaahahaha', 0, 1, '你好😄
3+
4+
```
5+
print(''fba yyds'')
6+
```
7+
8+
⚡⚡⚡
9+
10+
| col1 | col2 | col3 |
11+
| ---- | ---- | ---- |
12+
| | | |
13+
| | | |
14+
15+
* 1
16+
* 2
17+
* 3
18+
', '2025-12-15 15:33:16', null);
19+
20+
select setval(pg_get_serial_sequence('sys_notice', 'id'),coalesce(max(id), 0) + 1, true) from sys_notice;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
insert into sys_notice (id, title, type, status, content, created_time, updated_time)
2+
values (2112248797756129280, 'hahahahahaahahaha', 0, 1, '你好😄
3+
4+
```
5+
print(''fba yyds'')
6+
```
7+
8+
⚡⚡⚡
9+
10+
| col1 | col2 | col3 |
11+
| ---- | ---- | ---- |
12+
| | | |
13+
| | | |
14+
15+
* 1
16+
* 2
17+
* 3
18+
', '2025-12-15 15:33:16', null);

0 commit comments

Comments
 (0)