models

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropDB

func DropDB() error

func InitDB

func InitDB() error

func UpgradeDB

func UpgradeDB(fromVersion string, toVersion string) error

Types

type MCPServerConfig

type MCPServerConfig struct {
	ID        uint      `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
	URL       string    `gorm:"not null" json:"url,omitempty"`
	Name      string    `gorm:"uniqueIndex;not null;type:varchar(255)" json:"name,omitempty"`
	Enabled   bool      `gorm:"default:false" json:"enabled,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty" gorm:"<-:create"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

func (*MCPServerConfig) Delete

func (c *MCPServerConfig) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error

func (*MCPServerConfig) GetOne

func (c *MCPServerConfig) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPServerConfig, error)

func (*MCPServerConfig) List

func (c *MCPServerConfig) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*MCPServerConfig, int64, error)

func (*MCPServerConfig) Save

func (c *MCPServerConfig) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error

type MCPTool

type MCPTool struct {
	ID          uint      `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
	ServerName  string    `json:"server_name,omitempty"`
	Name        string    `gorm:"uniqueIndex;not null;type:varchar(255)" json:"name,omitempty"`
	Description string    `gorm:"type:text" json:"description,omitempty"`
	InputSchema string    `gorm:"type:text" json:"input_schema,omitempty"`
	Enabled     bool      `gorm:"default:true" json:"enabled,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty" gorm:"<-:create"`
	UpdatedAt   time.Time `json:"updated_at,omitempty"`
}

func (*MCPTool) BatchSave

func (c *MCPTool) BatchSave(params *dao.Params, tools []*MCPTool, queryFuncs ...func(*gorm.DB) *gorm.DB) error

func (*MCPTool) Delete

func (c *MCPTool) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error

func (*MCPTool) GetOne

func (c *MCPTool) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPTool, error)

func (*MCPTool) List

func (c *MCPTool) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*MCPTool, int64, error)

func (*MCPTool) Save

func (c *MCPTool) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error

type MCPToolCallResult

type MCPToolCallResult struct {
	ToolName   string `json:"tool_name"`
	Parameters any    `json:"parameters"`
	Result     string `json:"result"`
	Error      string `json:"error,omitempty"`
}

MCPToolCallResult 存储工具调用的结果

type MCPToolLog

type MCPToolLog struct {
	ID          uint      `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
	ToolName    string    `gorm:"index" json:"tool_name,omitempty"`
	ServerName  string    `gorm:"index" json:"server_name,omitempty"`
	Parameters  string    `gorm:"type:text" json:"parameters,omitempty"`
	Prompt      string    `gorm:"type:text" json:"prompt,omitempty"`
	Result      string    `gorm:"type:text" json:"result,omitempty"`
	Error       string    `gorm:"type:text" json:"error,omitempty"`
	ExecuteTime int64     `json:"execute_time,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty" gorm:"<-:create"`
	CreatedBy   string    `gorm:"index" json:"created_by,omitempty"`
}

func (*MCPToolLog) Delete

func (c *MCPToolLog) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error

func (*MCPToolLog) GetOne

func (c *MCPToolLog) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPToolLog, error)

func (*MCPToolLog) List

func (c *MCPToolLog) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*MCPToolLog, int64, error)

func (*MCPToolLog) Save

func (c *MCPToolLog) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error

type McpKey

type McpKey struct {
	ID          uint      `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
	Username    string    `gorm:"index;not null" json:"username,omitempty"`
	McpKey      string    `gorm:"type:text" json:"mcp_key,omitempty"`
	Description string    `json:"description,omitempty"`
	Enabled     bool      `gorm:"default:true" json:"enabled,omitempty"`
	Jwt         string    `gorm:"type:text" json:"jwt"`
	LastUsedAt  time.Time `json:"last_used_at,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty" gorm:"<-:create"`
	UpdatedAt   time.Time `json:"updated_at,omitempty"`
	CreatedBy   string    `json:"created_by,omitempty"`
}

func (*McpKey) Delete

func (c *McpKey) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error

func (*McpKey) GetOne

func (c *McpKey) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*McpKey, error)

func (*McpKey) List

func (c *McpKey) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*McpKey, int64, error)

func (*McpKey) Save

func (c *McpKey) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error

Jump to

Keyboard shortcuts

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