ActionParameterDefinition.cs
3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using Rcs.Domain.Enums;
namespace Rcs.Domain.Entities
{
/// <summary>
/// 动作参数定义实体 - 定义动作所需的参数
/// </summary>
[Table("action_parameter_definitions")]
public partial class ActionParameterDefinition : Entity
{
/// <summary>
/// 系统ID
/// </summary>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("param_id")]
public Guid ParamId { get; set; }
/// <summary>
/// 动作配置ID(外键)
/// </summary>
[Required]
[Column("action_config_id")]
public Guid ActionConfigId { get; set; }
/// <summary>
/// 参数名称(如:stationType、loadType、height等)
/// </summary>
[Required]
[Column("parameter_name")]
[MaxLength(100)]
public string ParameterName { get; set; } = string.Empty;
/// <summary>
/// 参数值类型(string、int、float、bool)
/// </summary>
[Required]
[Column("parameter_value_type")]
public ParameterValueType ParameterValueType { get; set; }
/// <summary>
/// 参数描述
/// </summary>
[Column("parameter_description")]
[MaxLength(500)]
public string? ParameterDescription { get; set; }
/// <summary>
/// 是否必填
/// </summary>
[Column("is_mandatory")]
public bool IsMandatory { get; set; } = false;
/// <summary>
/// 默认值(JSON格式存储)
/// </summary>
[Column("default_value")]
[MaxLength(500)]
public string? DefaultValue { get; set; }
/// <summary>
/// 参数值来源类型(常量、任务属性、机器人属性等)
/// </summary>
[Column("parameter_source_type")]
public ParameterSourceType? ParameterSourceType { get; set; }
/// <summary>
/// 参数值来源路径(如:Task.LoadType、Robot.IPAddress、或常量值)
/// 支持点号分隔的属性路径,如:Task.LoadType、Robot.CurrentNode.Code
/// </summary>
[Column("parameter_source_path")]
[MaxLength(500)]
public string? ParameterSourcePath { get; set; }
/// <summary>
/// 参数值范围或选项(JSON格式,如:["floor", "rack"] 或 {"min": 0, "max": 100})
/// </summary>
[Column("value_constraints")]
[MaxLength(1000)]
public string? ValueConstraints { get; set; }
/// <summary>
/// 备注
/// </summary>
[Column("remarks")]
[MaxLength(1000)]
public string? Remarks { get; set; }
/// <summary>
/// 排序顺序
/// </summary>
[Column("sort_order")]
public int SortOrder { get; set; } = 0;
/// <summary>
/// 创建时间
/// </summary>
[Column("created_at", TypeName = "timestamp")]
public DateTime? CreatedAt { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column("updated_at", TypeName = "timestamp")]
public DateTime? UpdatedAt { get; set; }
#region 导航属性
/// <summary>
/// 动作配置导航属性
/// </summary>
[ForeignKey(nameof(ActionConfigId))]
[JsonIgnore]
public virtual ActionConfiguration? ActionConfiguration { get; set; }
#endregion
}
}