mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-30 04:35:33 +08:00
feat(mcp): 新增 MCP 密钥/授权/日志三表 Scheme 与模型
This commit is contained in:
9
app/admin/model/SystemMcpKey.php
Normal file
9
app/admin/model/SystemMcpKey.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use base\admin\model\SystemMcpKeyBase;
|
||||
|
||||
class SystemMcpKey extends SystemMcpKeyBase
|
||||
{
|
||||
}
|
||||
9
app/admin/model/SystemMcpKeyNode.php
Normal file
9
app/admin/model/SystemMcpKeyNode.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use base\admin\model\SystemMcpKeyNodeBase;
|
||||
|
||||
class SystemMcpKeyNode extends SystemMcpKeyNodeBase
|
||||
{
|
||||
}
|
||||
9
app/admin/model/SystemMcpLog.php
Normal file
9
app/admin/model/SystemMcpLog.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use base\admin\model\SystemMcpLogBase;
|
||||
|
||||
class SystemMcpLog extends SystemMcpLogBase
|
||||
{
|
||||
}
|
||||
52
app/admin/scheme/SystemMcpKey.php
Normal file
52
app/admin/scheme/SystemMcpKey.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\scheme;
|
||||
|
||||
use app\common\scheme\BaseScheme;
|
||||
use app\common\scheme\attribute\Table;
|
||||
use app\common\scheme\attribute\Field;
|
||||
use app\common\scheme\attribute\Component;
|
||||
use app\common\scheme\attribute\Index;
|
||||
|
||||
#[Table(name: 'ul_system_mcp_key', comment: 'MCP密钥表')]
|
||||
#[Index(columns: ['key'], name: 'key', type: 'UNIQUE')]
|
||||
#[Index(columns: ['delete_time'], name: 'delete_time', type: 'NORMAL')]
|
||||
class SystemMcpKey extends BaseScheme
|
||||
{
|
||||
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, autoIncrement: true, primary: true)]
|
||||
public $id;
|
||||
|
||||
#[Field(type: 'char', length: 50, precision: 50, comment: '密钥名称')]
|
||||
public $title;
|
||||
|
||||
#[Field(type: 'char', length: 64, precision: 64, comment: '密钥SHA-256哈希')]
|
||||
public $key;
|
||||
|
||||
#[Field(type: 'char', length: 16, precision: 16, default: '', comment: '密钥前缀(展示用)')]
|
||||
public $key_prefix;
|
||||
|
||||
#[Field(type: 'bigint', length: 11, comment: '绑定创建者ID', unsigned: true)]
|
||||
public $bind_admin_id;
|
||||
|
||||
#[Field(type: 'int', length: 11, default: '1', comment: '状态')]
|
||||
#[Component(type: 'radio', options: ['禁用', '启用'])]
|
||||
public $status;
|
||||
|
||||
#[Field(type: 'char', length: 255, precision: 255, default: '')]
|
||||
public $remark;
|
||||
|
||||
#[Field(type: 'bigint', length: 11, default: '0', comment: '调用次数', unsigned: true)]
|
||||
public $use_num;
|
||||
|
||||
#[Field(type: 'int', length: 11, default: '0', unsigned: true)]
|
||||
public $last_use_time;
|
||||
|
||||
#[Field(type: 'int', length: 11, default: '0', comment: '创建时间', unsigned: true)]
|
||||
public $create_time;
|
||||
|
||||
#[Field(type: 'int', length: 11, default: '0', unsigned: true)]
|
||||
public $update_time;
|
||||
|
||||
#[Field(type: 'int', length: 11, default: '0', unsigned: true)]
|
||||
public $delete_time;
|
||||
}
|
||||
23
app/admin/scheme/SystemMcpKeyNode.php
Normal file
23
app/admin/scheme/SystemMcpKeyNode.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\scheme;
|
||||
|
||||
use app\common\scheme\BaseScheme;
|
||||
use app\common\scheme\attribute\Table;
|
||||
use app\common\scheme\attribute\Field;
|
||||
use app\common\scheme\attribute\Component;
|
||||
use app\common\scheme\attribute\Index;
|
||||
|
||||
#[Table(name: 'ul_system_mcp_key_node', comment: 'MCP密钥与节点关系表')]
|
||||
#[Index(columns: ['key_id'], name: 'key_id', type: 'NORMAL')]
|
||||
class SystemMcpKeyNode extends BaseScheme
|
||||
{
|
||||
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, autoIncrement: true, primary: true)]
|
||||
public $id;
|
||||
|
||||
#[Field(type: 'bigint', length: 11, comment: '密钥ID', unsigned: true)]
|
||||
public $key_id;
|
||||
|
||||
#[Field(type: 'char', length: 100, precision: 100, default: '')]
|
||||
public $node;
|
||||
}
|
||||
35
app/admin/scheme/SystemMcpLog.php
Normal file
35
app/admin/scheme/SystemMcpLog.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\scheme;
|
||||
|
||||
use app\common\scheme\BaseScheme;
|
||||
use app\common\scheme\attribute\Table;
|
||||
use app\common\scheme\attribute\Field;
|
||||
use app\common\scheme\attribute\Component;
|
||||
use app\common\scheme\attribute\Index;
|
||||
|
||||
#[Table(name: 'ul_system_mcp_log', comment: 'MCP调用日志表')]
|
||||
#[Index(columns: ['key_id'], name: 'key_id', type: 'NORMAL')]
|
||||
class SystemMcpLog extends BaseScheme
|
||||
{
|
||||
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, autoIncrement: true, primary: true)]
|
||||
public $id;
|
||||
|
||||
#[Field(type: 'bigint', length: 11, comment: '密钥ID', unsigned: true)]
|
||||
public $key_id;
|
||||
|
||||
#[Field(type: 'char', length: 100, precision: 100)]
|
||||
public $node;
|
||||
|
||||
#[Field(type: 'text', nullable: true, comment: '参数摘要JSON')]
|
||||
public $arguments;
|
||||
|
||||
#[Field(type: 'tinyint', length: 1, default: '1')]
|
||||
public $is_success;
|
||||
|
||||
#[Field(type: 'int', length: 11, default: '0')]
|
||||
public $cost_ms;
|
||||
|
||||
#[Field(type: 'int', length: 11, default: '0', comment: '创建时间', unsigned: true)]
|
||||
public $create_time;
|
||||
}
|
||||
10
extend/base/admin/model/SystemMcpKeyBase.php
Normal file
10
extend/base/admin/model/SystemMcpKeyBase.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace base\admin\model;
|
||||
|
||||
use app\common\model\TimeModel;
|
||||
|
||||
class SystemMcpKeyBase extends TimeModel
|
||||
{
|
||||
protected $deleteTime = 'delete_time';
|
||||
}
|
||||
12
extend/base/admin/model/SystemMcpKeyNodeBase.php
Normal file
12
extend/base/admin/model/SystemMcpKeyNodeBase.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace base\admin\model;
|
||||
|
||||
use app\common\model\TimeModel;
|
||||
|
||||
class SystemMcpKeyNodeBase extends TimeModel
|
||||
{
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
protected $deleteTime = false;
|
||||
}
|
||||
12
extend/base/admin/model/SystemMcpLogBase.php
Normal file
12
extend/base/admin/model/SystemMcpLogBase.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace base\admin\model;
|
||||
|
||||
use app\common\model\TimeModel;
|
||||
|
||||
class SystemMcpLogBase extends TimeModel
|
||||
{
|
||||
protected $updateTime = false;
|
||||
|
||||
protected $deleteTime = false;
|
||||
}
|
||||
Reference in New Issue
Block a user