admin

package
v0.26.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMCPKeysRoutes

func RegisterMCPKeysRoutes(mgm chi.Router)

Types

type KeyController

type KeyController struct{}

func (*KeyController) Create

func (mc *KeyController) Create(c *response.Context)

Create 处理创建新的MCP密钥的HTTP请求。 从请求中解析描述信息,获取当前用户,生成有效期为10年的JWT令牌,并创建包含该信息的MCP密钥记录保存到数据库。 失败时返回JSON格式的错误响应,成功时返回操作成功的JSON响应。 @Summary 创建MCP密钥 @Description 为当前用户创建一个新的MCP密钥(10年有效期) @Security BearerAuth @Param description body string false "密钥描述" @Success 200 {object} string "操作成功" @Router /mgm/user/profile/mcp_keys/create [post]

func (*KeyController) Delete

func (mc *KeyController) Delete(c *response.Context)

@Summary 删除MCP密钥 @Description 删除指定ID的MCP密钥 @Security BearerAuth @Param id path string true "MCP密钥ID" @Success 200 {object} string "操作成功" @Router /mgm/user/profile/mcp_keys/delete/{id} [post]

func (*KeyController) List

func (mc *KeyController) List(c *response.Context)

List 获取MCP密钥列表 @Summary 获取MCP密钥列表 @Description 获取当前用户的所有MCP密钥 @Security BearerAuth @Success 200 {object} string @Router /mgm/user/profile/mcp_keys/list [get]

type ServerController

type ServerController struct {
}

func (*ServerController) Connect

func (m *ServerController) Connect(c *response.Context)

@Summary 连接指定MCP服务器 @Security BearerAuth @Param name path string true "MCP服务器名称" @Success 200 {object} string @Router /admin/mcp/connect/{name} [post]

func (*ServerController) Delete

func (m *ServerController) Delete(c *response.Context)

@Summary 删除MCP服务器 @Security BearerAuth @Param request body object true "删除请求体包含IDs数组" @Success 200 {object} string @Router /admin/mcp/delete [post]

func (*ServerController) List

func (m *ServerController) List(c *response.Context)

@Summary 获取MCP服务器列表 @Security BearerAuth @Success 200 {object} string @Router /admin/mcp/list [get]

func (*ServerController) MCPLogList

func (m *ServerController) MCPLogList(c *response.Context)

@Summary 获取MCP服务器日志列表 @Security BearerAuth @Success 200 {object} string @Router /admin/mcp/log/list [get]

func (*ServerController) QuickSave

func (m *ServerController) QuickSave(c *response.Context)

@Summary 快速更新MCP服务器状态 @Security BearerAuth @Param id path int true "MCP服务器ID" @Param status path string true "服务器状态(true/false)" @Success 200 {object} string @Router /admin/mcp/save/id/{id}/status/{status} [post]

func (*ServerController) Save

func (m *ServerController) Save(c *response.Context)

@Summary 创建或更新MCP服务器 @Security BearerAuth @Param request body models.MCPServerConfig true "MCP服务器配置信息" @Success 200 {object} string @Router /admin/mcp/save [post]

type ToolController

type ToolController struct {
}

func (*ToolController) List

func (m *ToolController) List(c *response.Context)

@Summary 获取指定MCP服务器的工具列表 @Security BearerAuth @Param name path string true "MCP服务器名称" @Success 200 {object} string @Router /admin/mcp/server/{name}/tools/list [get]

func (*ToolController) QuickSave

func (m *ToolController) QuickSave(c *response.Context)

@Summary 快速更新MCP工具状态 @Security BearerAuth @Param id path int true "工具ID" @Param status path string true "状态,例如:true、false" @Success 200 {object} string @Router /admin/mcp/tool/save/id/{id}/status/{status} [post]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL