IRobotRepository.cs
3.78 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
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Rcs.Domain.Entities;
namespace Rcs.Domain.Repositories
{
/// <summary>
/// 机器人仓储接口
/// </summary>
public interface IRobotRepository : IRepository<Robot>
{
/// <summary>
/// 根据机器人编码获取机器人
/// </summary>
Task<Robot?> GetByRobotCodeAsync(
string robotCode,
CancellationToken cancellationToken = default);
/// <summary>
/// 根据机器人编码获取机器人
/// </summary>
Task<Robot?> GetByIdFullDataAsync(
Guid robotId,
CancellationToken cancellationToken = default);
/// <summary>
/// 根据序列号获取机器人
/// </summary>
Task<Robot?> GetBySerialNumberAsync(
string serialNumber,
CancellationToken cancellationToken = default);
/// <summary>
/// 根据制造商和序列号获取机器人
/// @author zzy
/// </summary>
Task<Robot?> GetByManufacturerAndSerialNumberAsync(
string manufacturer,
string serialNumber,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取所有在线机器人
/// </summary>
Task<IEnumerable<Robot>> GetOnlineRobotsAsync(
CancellationToken cancellationToken = default);
/// <summary>
/// 获取所有激活的机器人
/// </summary>
Task<IEnumerable<Robot>> GetActiveRobotsAsync(
CancellationToken cancellationToken = default);
/// <summary>
/// 根据状态获取机器人列表
/// </summary>
Task<IEnumerable<Robot>> GetByStatusAsync(
RobotStatus status,
CancellationToken cancellationToken = default);
/// <summary>
/// 根据机器人类型获取机器人列表
/// </summary>
Task<IEnumerable<Robot>> GetByRobotTypeAsync(
RobotType robotType,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取所有空闲机器人
/// </summary>
Task<IEnumerable<Robot>> GetIdleRobotsAsync(
CancellationToken cancellationToken = default);
/// <summary>
/// 根据制造商获取机器人列表
/// </summary>
Task<IEnumerable<Robot>> GetByManufacturerAsync(
string manufacturer,
CancellationToken cancellationToken = default);
/// <summary>
/// 根据当前节点获取机器人列表
/// </summary>
Task<IEnumerable<Robot>> GetByCurrentNodeAsync(
Guid nodeCodeId,
CancellationToken cancellationToken = default);
/// <summary>
/// 根据条件筛选机器人列表
/// </summary>
/// <param name="robotCode">机器人编码</param>
/// <param name="robotName">机器人名称</param>
/// <param name="robotManufacturer">制造商</param>
/// <param name="robotSerialNumber">序列号</param>
/// <param name="robotType">机器人类型</param>
/// <param name="active">是否启用</param>
/// <param name="cancellationToken">取消令牌</param>
/// <returns>筛选后的机器人列表</returns>
Task<(IEnumerable<Robot> Robots, int TotalCount)> GetByFilterAsync(
string? robotCode = null,
string? robotName = null,
string? robotManufacturer = null,
string? robotSerialNumber = null,
string? robotType = null,
bool? active = null,
int pageNumber = 1,
int pageSize = 10,
CancellationToken cancellationToken = default);
}
}