40 lines
1.9 KiB
Go
40 lines
1.9 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
type BackendMcpServer struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
|
UserID uint64 `orm:"column(user_id);default(0)" json:"user_id"`
|
|
Name string `orm:"column(name);size(100)" json:"name"`
|
|
Transport string `orm:"column(transport);size(20)" json:"transport"`
|
|
Command string `orm:"column(command);size(255)" json:"command"`
|
|
Args string `orm:"column(args);type(text)" json:"args"`
|
|
Env string `orm:"column(env);type(text)" json:"env"`
|
|
URL string `orm:"column(url);size(512)" json:"url"`
|
|
Headers string `orm:"column(headers);type(text)" json:"headers"`
|
|
Description string `orm:"column(description);size(255)" json:"description"`
|
|
Provider string `orm:"column(provider);size(50)" json:"provider"`
|
|
FromMarket string `orm:"column(from_market);size(50)" json:"from_market"`
|
|
Enabled int8 `orm:"column(enabled);default(0)" json:"enabled"`
|
|
Status int8 `orm:"column(status);default(0)" json:"status"`
|
|
LastError string `orm:"column(last_error);size(500)" json:"last_error"`
|
|
ToolCount int `orm:"column(tool_count);default(0)" json:"tool_count"`
|
|
Remark string `orm:"column(remark);size(255)" json:"remark"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
|
|
Tools []McpToolInfo `orm:"-" json:"tools,omitempty"`
|
|
}
|
|
|
|
type McpToolInfo struct {
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
InputSchema interface{} `json:"input_schema"`
|
|
}
|
|
|
|
func (m *BackendMcpServer) TableName() string {
|
|
return "yz_backend_mcp_server"
|
|
}
|