Skip to content

Commit f65e5aa

Browse files
author
尘绝
committed
id string->long ,INCREMENT
add mysql 。conf
1 parent 75e6fb5 commit f65e5aa

File tree

12 files changed

+162
-19
lines changed

12 files changed

+162
-19
lines changed

examples/mysql/init/init.sql

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

runtime/bootstrap/src/main/resources/config/application.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ spring.datasource.password=root
99
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
1010

1111
mybatis-plus.mapper-locations=classpath:mapper/*.xml
12-
mybatis-plus.type-aliases-package=com.alipay.muagent.model
12+
mybatis-plus.type-aliases-package=com.alipay.muagent.model
13+
14+
#配置读取tool的方式:local|mysql
15+
runtime.tool.datatype=mysql

runtime/bootstrap/src/main/resources/tools/system.select_tool.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "system.select_tool",
2+
"id": 2,
33
"gmtCreate": "2024-07-17T07:20:35.000+00:00",
44
"gmtModified": "2024-07-17T07:20:35.000+00:00",
55
"toolKey": "system.select_tool",

runtime/bootstrap/src/main/resources/tools/undercover.dispatch_keyword.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "undercover.dispatch_keyword",
2+
"id": 2,
33
"gmtCreate": "2024-07-17T07:20:35.000+00:00",
44
"gmtModified": "2024-07-17T07:20:35.000+00:00",
55
"toolKey": "undercover.dispatch_keyword",

runtime/bootstrap/src/main/resources/tools/undercover.dispatch_position.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "undercover.dispatch_position",
2+
"id": 2,
33
"gmtCreate": "2024-07-17T07:20:35.000+00:00",
44
"gmtModified": "2024-07-17T07:20:35.000+00:00",
55
"toolKey": "undercover.dispatch_position",

runtime/bootstrap/src/main/resources/tools/undercover.judge.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "undercover.judge",
2+
"id": 2,
33
"gmtCreate": "2024-07-17T07:20:35.000+00:00",
44
"gmtModified": "2024-07-17T07:20:35.000+00:00",
55
"toolKey": "undercover.judge",
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* Alipay.com Inc.
3+
* Copyright (c) 2004-2024 All Rights Reserved.
4+
*/
5+
package com.alipay.muagent.model.enums.tool;
6+
7+
/**
8+
* @author chenjue.wwp
9+
* @version : ToolDataTypeEnum.java, v 0.1 2024年12月03日 下午17:01 renmao.rm Exp $
10+
*/
11+
public enum ToolDataTypeEnum {
12+
LOCAL("local", "本地数据"), MYSQL("mysql", "MYSQL数据");
13+
14+
private String name;
15+
private String desc;
16+
17+
ToolDataTypeEnum(String name, String desc) {
18+
this.name = name;
19+
this.desc = desc;
20+
}
21+
22+
/**
23+
* Gets get by name.
24+
*
25+
* @param name the name
26+
* @return the get by name
27+
*/
28+
public static ToolDataTypeEnum getByName(String name) {
29+
for (ToolDataTypeEnum toolDataTypeEnum : ToolDataTypeEnum.values()) {
30+
if (toolDataTypeEnum.name.equals(name)) {
31+
return toolDataTypeEnum;
32+
}
33+
}
34+
throw new RuntimeException("ToolDataTypeEnum not found");
35+
}
36+
37+
/**
38+
* Getter method for property <tt>name</tt>.
39+
*
40+
* @return property value of name
41+
*/
42+
public String getName() {
43+
return name;
44+
}
45+
46+
/**
47+
* Setter method for property <tt>name</tt>.
48+
*
49+
* @param name value to be assigned to property name
50+
*/
51+
public void setName(String name) {
52+
this.name = name;
53+
}
54+
55+
/**
56+
* Getter method for property <tt>desc</tt>.
57+
*
58+
* @return property value of desc
59+
*/
60+
public String getDesc() {
61+
return desc;
62+
}
63+
64+
/**
65+
* Setter method for property <tt>desc</tt>.
66+
*
67+
* @param desc value to be assigned to property desc
68+
*/
69+
public void setDesc(String desc) {
70+
this.desc = desc;
71+
}
72+
}

runtime/model/src/main/java/com/alipay/muagent/model/tool/meta/Tool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@Data
1717
public class Tool {
1818

19-
private String id;
19+
private Long id;
2020

2121
/**
2222
* 创建时间

runtime/service/src/main/java/com/alipay/muagent/service/mybatisplus/dto/ToolDO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@Data
1616
@TableName(value = "tool")
1717
public class ToolDO {
18-
private String id;
18+
private Long id;
1919

2020
/**
2121
* 创建时间

runtime/service/src/main/java/com/alipay/muagent/service/tool/loader/ToolLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
*/
1515
public interface ToolLoader {
1616

17-
Tool queryToolById(String id);
17+
Tool queryToolById(Long id);
1818

19-
List<Tool> queryToolsByIdList(List<String> id);
19+
List<Tool> queryToolsByIdList(List<Long> id);
2020

2121
Tool queryToolByKey(String toolKey);
2222

0 commit comments

Comments
 (0)