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
1c0c274e
Commit
1c0c274e
authored
Aug 18, 2025
by
何金镒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场景相关 2
parent
d7dcfb2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
src/main/java/com/ikonke/konkeaialibabamcp/aitools/DeviceTools.java
...ava/com/ikonke/konkeaialibabamcp/aitools/DeviceTools.java
+1
-1
src/main/java/com/ikonke/konkeaialibabamcp/controller/DeviceController.java
...ikonke/konkeaialibabamcp/controller/DeviceController.java
+1
-1
src/main/java/com/ikonke/konkeaialibabamcp/service/SycDeviceService.java
...om/ikonke/konkeaialibabamcp/service/SycDeviceService.java
+4
-1
No files found.
src/main/java/com/ikonke/konkeaialibabamcp/aitools/DeviceTools.java
View file @
1c0c274e
...
@@ -57,7 +57,7 @@ public class DeviceTools {
...
@@ -57,7 +57,7 @@ public class DeviceTools {
public
String
triggerScene
(
@ToolParam
(
description
=
"主机号"
)
String
ccuName
,
public
String
triggerScene
(
@ToolParam
(
description
=
"主机号"
)
String
ccuName
,
@ToolParam
(
description
=
"场景ID"
)
String
devId
,
@ToolParam
(
description
=
"场景ID"
)
String
devId
,
@ToolParam
(
description
=
"场景类型,type等于scene"
)
String
type
){
@ToolParam
(
description
=
"场景类型,type等于scene"
)
String
type
){
log
.
info
(
"mcp调用--->根据主机号和场景ID
控制关闭设备
....ccuName:{},devId:{},type:{}"
,
ccuName
,
devId
,
type
);
log
.
info
(
"mcp调用--->根据主机号和场景ID
触发场景
....ccuName:{},devId:{},type:{}"
,
ccuName
,
devId
,
type
);
return
konkeIotServer
.
optScene
(
CcuUtils
.
getCcuName
(
ccuName
),
devId
);
return
konkeIotServer
.
optScene
(
CcuUtils
.
getCcuName
(
ccuName
),
devId
);
}
}
...
...
src/main/java/com/ikonke/konkeaialibabamcp/controller/DeviceController.java
View file @
1c0c274e
...
@@ -22,7 +22,7 @@ public class DeviceController {
...
@@ -22,7 +22,7 @@ public class DeviceController {
@GetMapping
(
"/findSycDeviceByCcu"
)
@GetMapping
(
"/findSycDeviceByCcu"
)
public
JSONArray
findSycDeviceByCcu
(
@RequestParam
(
name
=
"ccuName"
)
String
ccuName
){
public
JSONArray
findSycDeviceByCcu
(
@RequestParam
(
name
=
"ccuName"
)
String
ccuName
){
log
.
info
(
"findSycDeviceByCcu..根据主机号查询设备..ccuName:{}"
,
ccuName
);
log
.
info
(
"findSycDeviceByCcu..根据主机号查询设备..ccuName:{}"
,
ccuName
);
return
sycDeviceService
.
findByCcu
(
ccuName
);
return
sycDeviceService
.
findByCcu
(
ccuName
,
null
);
}
}
@GetMapping
(
"/synchronousDevice"
)
@GetMapping
(
"/synchronousDevice"
)
...
...
src/main/java/com/ikonke/konkeaialibabamcp/service/SycDeviceService.java
View file @
1c0c274e
...
@@ -31,10 +31,13 @@ public class SycDeviceService {
...
@@ -31,10 +31,13 @@ public class SycDeviceService {
@Autowired
@Autowired
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
public
JSONArray
findByCcu
(
String
ccuName
){
public
JSONArray
findByCcu
(
String
ccuName
,
Integer
type
){
log
.
info
(
"findByCcu..根据主机号查询设备..ccuName:{}"
,
ccuName
);
log
.
info
(
"findByCcu..根据主机号查询设备..ccuName:{}"
,
ccuName
);
QueryWrapper
<
SynDevice
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SynDevice
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"ccuId"
,
ccuName
);
wrapper
.
eq
(
"ccuId"
,
ccuName
);
if
(
type
!=
null
){
wrapper
.
eq
(
"type"
,
type
);
}
List
<
SynDevice
>
list
=
synDeviceService
.
list
(
wrapper
);
List
<
SynDevice
>
list
=
synDeviceService
.
list
(
wrapper
);
JSONArray
jsonArray
=
null
;
JSONArray
jsonArray
=
null
;
...
...
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