设备类添加产品字段、添加物模型类,新增产品CRUD方法
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using Model;
|
||||
using Model.Dto.Config;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Service.Interface.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备指令下发 服务接口
|
||||
/// </summary>
|
||||
public interface IDeviceCommandService
|
||||
{
|
||||
/// <summary>
|
||||
/// 按物模型可写点向设备下发指令
|
||||
/// 每次调用都会写入设备日志;网关不可达时优雅降级(记录未连通)。
|
||||
/// </summary>
|
||||
Task<Result> SendCommandAsync(DeviceCommandDto dto);
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ namespace Service.Interface.Config
|
||||
public interface IDeviceService
|
||||
{
|
||||
/// <summary>
|
||||
/// 分页查询设备列表(支持关键字搜索编号/名称/类型)
|
||||
/// 分页查询设备列表(支持关键字搜索编号/名称/类型,可按所属产品筛选)
|
||||
/// </summary>
|
||||
Task<Result<List<IotDeviceDto>>> GetPagedAsync(int pageIndex, int pageSize, RefAsync<int> total, string? keyword);
|
||||
Task<Result<List<IotDeviceDto>>> GetPagedAsync(int pageIndex, int pageSize, RefAsync<int> total, string? keyword, long? productId = null);
|
||||
|
||||
/// <summary>
|
||||
/// 根据 Id 获取设备详情
|
||||
|
||||
@@ -1,10 +1,45 @@
|
||||
namespace Service.Interface
|
||||
using Model;
|
||||
using Model.Dto.Config;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Service.Interface.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 产品管理 服务接口
|
||||
/// 产品管理(含产品分类)服务接口
|
||||
/// </summary>
|
||||
public interface IProductService
|
||||
{
|
||||
// TODO: 定义 产品管理 相关方法
|
||||
// ===== 产品分类 =====
|
||||
/// <summary>产品分类列表</summary>
|
||||
Task<Result<List<ProductCategoryDto>>> GetCategoriesAsync();
|
||||
|
||||
/// <summary>新增产品分类</summary>
|
||||
Task<Result> AddCategoryAsync(ProductCategoryDto dto);
|
||||
|
||||
/// <summary>修改产品分类</summary>
|
||||
Task<Result> UpdateCategoryAsync(ProductCategoryDto dto);
|
||||
|
||||
/// <summary>删除产品分类(软删除)</summary>
|
||||
Task<Result> DeleteCategoryAsync(long id);
|
||||
|
||||
// ===== 产品 =====
|
||||
/// <summary>分页查询产品列表(关键字搜型号/名称;可按分类筛选)</summary>
|
||||
Task<Result<List<ProductDto>>> GetPagedAsync(int pageIndex, int pageSize, SqlSugar.RefAsync<int> total, string? keyword, long categoryId);
|
||||
|
||||
/// <summary>下拉选项(不分页,设备选择所属产品用)</summary>
|
||||
Task<Result<List<ProductOptionDto>>> GetOptionsAsync();
|
||||
|
||||
/// <summary>产品详情</summary>
|
||||
Task<Result<ProductDto>> GetByIdAsync(long id);
|
||||
|
||||
/// <summary>新增产品(型号唯一校验)</summary>
|
||||
Task<Result> AddAsync(ProductDto dto);
|
||||
|
||||
/// <summary>修改产品</summary>
|
||||
Task<Result> UpdateAsync(ProductDto dto);
|
||||
|
||||
/// <summary>删除产品(软删除)</summary>
|
||||
Task<Result> DeleteAsync(long id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
using Model;
|
||||
using Model.Dto.Config;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Service.Interface.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 物模型点 服务接口(产品/设备通用,按 OwnerType+OwnerId 归属)
|
||||
/// </summary>
|
||||
public interface IThingPointService
|
||||
{
|
||||
/// <summary>查询某归属下的点列表</summary>
|
||||
Task<Result<List<ThingModelPointDto>>> GetListAsync(int ownerType, long ownerId, string? keyword);
|
||||
|
||||
/// <summary>查询单点详情</summary>
|
||||
Task<Result<ThingModelPointDto>> GetByIdAsync(long id);
|
||||
|
||||
/// <summary>新增点(同一归属内 Code 唯一)</summary>
|
||||
Task<Result> AddAsync(ThingModelPointDto dto);
|
||||
|
||||
/// <summary>修改点</summary>
|
||||
Task<Result> UpdateAsync(ThingModelPointDto dto);
|
||||
|
||||
/// <summary>删除点(软删除)</summary>
|
||||
Task<Result> DeleteAsync(long id);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using Model;
|
||||
using Model.Dto.Inspection;
|
||||
using Model.Entity.Inspection;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -12,10 +11,15 @@ namespace Service.Interface
|
||||
public interface IAlertRuleService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取全部告警规则列表
|
||||
/// 获取全局告警规则列表(OwnerType=0,不含产品/设备归属规则)
|
||||
/// </summary>
|
||||
Task<Result<List<AlertRuleDto>>> GetListAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 获取某归属对象下的规则列表(OwnerType=产品/设备,可选按点过滤)
|
||||
/// </summary>
|
||||
Task<Result<List<AlertRuleDto>>> GetOwnerRulesAsync(int ownerType, long ownerId, string? pointCode);
|
||||
|
||||
/// <summary>
|
||||
/// 新增告警规则(前端传 DTO,Id 为 string)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user