Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
konke-ai-alibaba-mcp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何金镒
konke-ai-alibaba-mcp
Commits
4b389a96
Commit
4b389a96
authored
Oct 20, 2025
by
何金镒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化一下
parent
919d2382
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
9 deletions
+22
-9
src/main/java/com/ikonke/konkeaialibabamcp/aitools/CDCVisitorTools.java
...com/ikonke/konkeaialibabamcp/aitools/CDCVisitorTools.java
+2
-2
src/main/java/com/ikonke/konkeaialibabamcp/service/cdc/CdcHttpUtils.java
...om/ikonke/konkeaialibabamcp/service/cdc/CdcHttpUtils.java
+2
-0
src/main/java/com/ikonke/konkeaialibabamcp/service/cdc/robot/CommunityRobot.java
...e/konkeaialibabamcp/service/cdc/robot/CommunityRobot.java
+2
-2
src/main/java/com/ikonke/konkeaialibabamcp/utils/WebSocketUtil.java
...ava/com/ikonke/konkeaialibabamcp/utils/WebSocketUtil.java
+8
-4
src/main/resources/application-prod.yml
src/main/resources/application-prod.yml
+4
-1
src/main/resources/application-test.yml
src/main/resources/application-test.yml
+4
-0
No files found.
src/main/java/com/ikonke/konkeaialibabamcp/aitools/CDCVisitorTools.java
View file @
4b389a96
...
...
@@ -14,8 +14,8 @@ public class CDCVisitorTools {
@Tool
(
description
=
"社区访客相关:访客预约"
)
public
String
visitorAppointments
(
@ToolParam
(
description
=
"设备的sn号,如:00226DA86A12"
)
String
sn
,
@ToolParam
(
description
=
"访客姓名,如:张三"
)
String
name
,
@ToolParam
(
description
=
"访客的车牌号
,如:沪BDF1234"
)
String
cartNumber
,
@ToolParam
(
description
=
"访客姓名,如:张三"
,
required
=
true
)
String
name
,
@ToolParam
(
description
=
"访客的车牌号
(可不填),如:沪BDF1234"
,
required
=
false
)
String
cartNumber
,
@ToolParam
(
description
=
"访客上门的时间,如:2025-08-12"
)
String
date
){
log
.
info
(
"【{}】mcp调用--->访客相关:访客预约,cartNumber:{},时间:{}"
,
sn
,
cartNumber
,
date
);
return
"已为访客 "
+
name
+
" 的车牌号 "
+
cartNumber
+
" 在 "
+
date
+
" 预约成功"
;
...
...
src/main/java/com/ikonke/konkeaialibabamcp/service/cdc/CdcHttpUtils.java
View file @
4b389a96
...
...
@@ -51,6 +51,8 @@ public class CdcHttpUtils {
if
(
jsonObject
.
getInt
(
"code"
)
==
200
){
JSONObject
jsonObject_data
=
jsonObject
.
getJSONObject
(
"data"
);
return
jsonObject_data
.
getStr
(
"access_token"
);
}
else
{
log
.
error
(
"【{}】登录业主获取token失败:{}"
,
ccuId
,
body1
);
}
return
null
;
}
...
...
src/main/java/com/ikonke/konkeaialibabamcp/service/cdc/robot/CommunityRobot.java
View file @
4b389a96
...
...
@@ -27,7 +27,7 @@ public class CommunityRobot {
public
String
bookingLitterRobot
(
String
sn
,
String
data
){
return
"已成功预约
垃圾回收
机器人,预计在"
+
data
+
"上门,请业主做好准备,开机密码是:"
+
RandomUtil
.
randomString
(
5
);
return
"已成功预约机器人,预计在"
+
data
+
"上门,请业主做好准备,开机密码是:"
+
RandomUtil
.
randomString
(
5
);
// UserEntity userEntity = cdcHttpUtils.getOwner(sn);
//
...
...
@@ -47,7 +47,7 @@ public class CommunityRobot {
public
String
bookingDeliveryRobot
(
String
sn
,
String
data
){
return
"已成功预约
配送
机器人,预计在"
+
data
+
"上门,请业主做好准备,开机密码是:"
+
RandomUtil
.
randomString
(
5
);
return
"已成功预约机器人,预计在"
+
data
+
"上门,请业主做好准备,开机密码是:"
+
RandomUtil
.
randomString
(
5
);
// UserEntity userEntity = cdcHttpUtils.getOwner(sn);
//
...
...
src/main/java/com/ikonke/konkeaialibabamcp/utils/WebSocketUtil.java
View file @
4b389a96
...
...
@@ -3,17 +3,21 @@ package com.ikonke.konkeaialibabamcp.utils;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.json.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Slf4j
@Component
public
class
WebSocketUtil
{
private
final
static
String
getWebSocketUrl
=
"http://127.0.0.1:9997/ws/getWebSocket?sn="
;
private
final
static
String
sendToSingleUrl
=
"http://127.0.0.1:9997/ws/sendToSingle"
;
@Value
(
"${webSocket.url}"
)
private
String
webSocketUrl
;
private
final
static
String
getWebSocketUrl
=
"ws/getWebSocket?sn="
;
private
final
static
String
sendToSingleUrl
=
"ws/sendToSingle"
;
public
boolean
getWebSocket
(
String
sn
){
String
url
=
getWebSocketUrl
+
sn
;
String
url
=
webSocketUrl
+
getWebSocketUrl
+
sn
;
String
body
=
HttpRequest
.
get
(
url
)
.
execute
().
body
();
return
"true"
.
equals
(
body
);
...
...
@@ -25,7 +29,7 @@ public class WebSocketUtil {
param
.
set
(
"sn"
,
sn
);
param
.
set
(
"message"
,
message
);
HttpRequest
.
post
(
sendToSingleUrl
)
HttpRequest
.
post
(
webSocketUrl
+
sendToSingleUrl
)
.
body
(
param
.
toString
())
.
execute
().
body
();
}
...
...
src/main/resources/application-prod.yml
View file @
4b389a96
...
...
@@ -52,10 +52,13 @@ konke:
appId
:
10001319
appKey
:
216531bf-6394-455d-98c0-87d74ad2fcc5
baseUrl
:
http://172.24.10.11:16000
# 合4
dify
:
key
:
app-Lev1PRD3VBWH9P0AhfnywKJT
webSocket
:
url
:
http://127.0.0.1:9997/
cdc
:
mcpAuthorization
:
Bearer mcp_client_konke_RTbMcnztTce6lxP6blB24zlK26H0XJHx
timeout
:
20000
...
...
src/main/resources/application-test.yml
View file @
4b389a96
...
...
@@ -48,9 +48,13 @@ konke:
appKey
:
0c350d82-aa95-46e1-91b8-b8d508b5226a
baseUrl
:
http://172.17.12.6:10000
# 对接兆慧mcp
dify
:
key
:
app-Lev1PRD3VBWH9P0AhfnywKJT
webSocket
:
url
:
http://172.17.12.12:9997/
cdc
:
mcpAuthorization
:
Bearer mcp_client_konke_RTbMcnztTce6lxP6blB24zlK26H0XJHx
timeout
:
20000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment