| | |
| | | } |
| | | |
| | | @PostMapping("/getList") |
| | | public Result getList(@JsonBody(value = "botId", required = true) String botId){ |
| | | // QueryWrapper queryWrapper = QueryWrapper.create().select("plugin_id").where("bot_id = ?", botId); |
| | | // List<AiBotPlugins> list = service.list(queryWrapper); |
| | | return aiPluginService.getList(botId); |
| | | public Result getList(){ |
| | | return aiPluginService.getList(); |
| | | } |
| | | } |
| | |
| | | |
| | | Result updatePlugin(AiPlugin aiPlugin); |
| | | |
| | | Result getList(String botId); |
| | | Result getList(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result getList(String botId) { |
| | | QueryWrapper queryWrapper = QueryWrapper.create().select("*") |
| | | public Result getList() { |
| | | QueryWrapper queryWrapper = QueryWrapper.create().select("id, name, description, icon") |
| | | .from("tb_ai_plugin"); |
| | | List<AiPlugin> aiPlugins = aiPluginMapper.selectListByQueryAs(queryWrapper, AiPlugin.class); |
| | | return Result.success(aiPlugins); |
| | |
| | | .from("tb_ai_bot_plugins") |
| | | .where("bot_id = ? ", botId); |
| | | List<BigInteger> pluginToolIds = aiBotPluginsMapper.selectListByQueryAs(queryAiPluginToolWrapper, BigInteger.class); |
| | | if (pluginToolIds.size() <= 0){ |
| | | if (pluginToolIds.isEmpty()){ |
| | | return Result.success(); |
| | | } |
| | | // 查询当前bots对应的有哪些pluginTool |
| | | List<AiPluginTool> aiPluginTools = aiPluginToolMapper.selectListByIds(pluginToolIds); |
| | | return Result.success(aiPluginTools); |
| | | } |
| | |
| | | pluginToolId: item.id, |
| | | } |
| | | }).then(r => { |
| | | console.log('selectedPlugin') |
| | | console.log(selectedPlugin) |
| | | console.log(r) |
| | | if (r?.data?.errorCode === 0){ |
| | | message.success("添加成功") |
| | | onToolExecute?.(selectedPlugin.id, item.id, toolParams); |
| | | } else { |
| | | message.error("添加失败") |
| | | } |
| | | doPostGetToolsList({data: {pluginId: selectedPlugin.id}}).then(res => { |
| | | setPluginTools(res?.data?.data) |
| | | console.log(';sssss') |
| | | console.log(res) |
| | | }) |
| | | }) |
| | | }}>添加</Button> |