ChargingPile.cs
2.33 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
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Rcs.Domain.Entities;
/// <summary>
/// 充电桩实体。
/// </summary>
[Table("charging_piles")]
public class ChargingPile : Entity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("pile_id")]
public Guid PileId { get; set; }
[Required]
[Column("pile_code")]
[MaxLength(50)]
public string PileCode { get; set; } = string.Empty;
[Required]
[Column("pile_name")]
[MaxLength(100)]
public string PileName { get; set; } = string.Empty;
[Column("ip_address")]
[MaxLength(45)]
public string IpAddress { get; set; } = string.Empty;
[Column("port")]
public int Port { get; set; } = 0;
[Column("min_charging_minutes")]
public int MinChargingMinutes { get; set; } = 10;
[Column("full_charge_threshold")]
public decimal FullChargeThreshold { get; set; } = 90m;
[Column("supported_robot_models")]
[MaxLength(200)]
public List<string> SupportedRobotModels { get; set; } = new();
[Column("bound_robot_ids")]
[MaxLength(500)]
public List<Guid> BoundRobotIds { get; set; } = new();
[Column("current_charging_robot_id")]
public Guid? CurrentChargingRobotId { get; set; }
[Column("map_node_id")]
public Guid? MapNodeId { get; set; }
[Column("auto_start_threshold")]
public decimal AutoStartThreshold { get; set; } = 30m;
[Column("resume_threshold")]
public decimal ResumeThreshold { get; set; } = 60m;
[Column("max_charging_minutes")]
public int MaxChargingMinutes { get; set; } = 120;
[Column("queue_timeout_minutes")]
public int QueueTimeoutMinutes { get; set; } = 30;
[Column("priority")]
public int Priority { get; set; } = 100;
[Column("allow_task_interrupt")]
public bool AllowTaskInterrupt { get; set; } = true;
[Column("is_active")]
public bool IsActive { get; set; } = true;
[Column("created_at", TypeName = "timestamp")]
public DateTime CreatedAt { get; set; }
[Column("updated_at", TypeName = "timestamp")]
public DateTime? UpdatedAt { get; set; }
[ForeignKey(nameof(MapNodeId))]
public virtual MapNode? MapNode { get; set; }
[ForeignKey(nameof(CurrentChargingRobotId))]
public virtual Robot? CurrentChargingRobot { get; set; }
}