Files
ulthon_admin/app/admin/scheme/SystemTimerConfig.php
augushong 236a343fa9 feat(timer): 新增并发数/触发节点/触发时间三字段及幂等分发
Scheme 定义 concurrency(nullable)/trigger_node_id/last_trigger_time 三字段,Model 声明属性,v2.3.0 分发代码幂等 ALTER 保证升级自动同步。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 21:57:14 +08:00

63 lines
2.6 KiB
PHP

<?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_timer_config', comment: '定时任务协调配置表')]
#[Index(columns: ['task_name'], name: 'task_name', type: 'UNIQUE')]
class SystemTimerConfig extends BaseScheme
{
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, autoIncrement: true, primary: true)]
public $id;
#[Field(type: 'varchar', length: 100, nullable: false, comment: '任务名称')]
#[Component(type: 'text', options: [])]
public $task_name;
#[Field(type: 'varchar', length: 20, default: 'auto', comment: '运行类型:main/auto/all/manual')]
#[Component(type: 'select', options: ['main' => 'main', 'auto' => 'auto', 'all' => 'all', 'manual' => 'manual'])]
public $run_type;
#[Field(type: 'tinyint', length: 4, default: '1', comment: '状态:0=停用,1=启用')]
#[Component(type: 'switch', options: ['停用', '启用'])]
public $status;
#[Field(type: 'tinyint', length: 4, default: '0', comment: '是否已同步:0=未同步,1=已同步')]
#[Component(type: 'switch', options: ['未同步', '已同步'])]
public $is_synced;
#[Field(type: 'varchar', length: 100, nullable: true, comment: '最后执行节点ID')]
#[Component(type: 'text', options: [])]
public $last_execute_node;
#[Field(type: 'int', length: 11, default: '0', comment: '最后执行时间戳', unsigned: true)]
#[Component(type: 'date', options: [])]
public $last_execute_time;
#[Field(type: 'tinyint', length: 4, default: '0', comment: '手动触发标记:0=未触发,1=已触发')]
#[Component(type: 'switch', options: ['未触发', '已触发'])]
public $manual_trigger;
#[Field(type: 'int', length: 11, nullable: true, unsigned: true, comment: '并发数:NULL=继承代码默认')]
public $concurrency;
#[Field(type: 'varchar', length: 100, nullable: true, comment: '手动触发目标节点ID')]
public $trigger_node_id;
#[Field(type: 'int', length: 11, nullable: true, unsigned: true, comment: '手动触发设置时间戳,用于TTL自动复位')]
public $last_trigger_time;
#[Field(type: 'int', length: 11, comment: '创建时间', unsigned: true)]
#[Component(type: 'date', options: [])]
public $create_time;
#[Field(type: 'int', length: 11, comment: '更新时间', unsigned: true)]
#[Component(type: 'date', options: [])]
public $update_time;
}