2021-05-27 16:58:40 +08:00
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using Nirvana.Common;
|
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Waste.Domain;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Waste.Application
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设备接口
|
|
|
|
|
|
/// </summary>
|
2022-05-14 18:02:50 +08:00
|
|
|
|
public class DeviceAppService : IDynamicApiController
|
2021-05-27 16:58:40 +08:00
|
|
|
|
{
|
|
|
|
|
|
private readonly IDeviceService _deviceService;
|
|
|
|
|
|
public DeviceAppService(IDeviceService deviceService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_deviceService = deviceService;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设备列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="param"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<PageParms<DeviceList>> GetListAsync(QueryParams param)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _deviceService.GetListAsync(param);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 信息提交
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="role"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public async Task<ResultInfo> SubmitFormAsync(DeviceSubmit role)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _deviceService.SubmitFormAsync(role);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 批量操作
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="deviceBatchModel"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public async Task<ResultInfo> BatchSetAsync(DeviceBatchModel deviceBatchModel)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _deviceService.BatchSetAsync(deviceBatchModel);
|
|
|
|
|
|
}
|
2021-10-12 15:26:06 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设备状态修改
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id">设备ID</param>
|
|
|
|
|
|
/// <param name="status">设备状态,0-停用,1-正常,2-激活</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[QueryParameters]
|
|
|
|
|
|
public async Task<ResultInfo> SetStatusAsync(Guid id, int status)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _deviceService.SetStatusAsync(id, status);
|
|
|
|
|
|
}
|
2022-05-14 18:02:50 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 配置设备推送信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public async Task<ResultInfo> SetConfigAsync(DeviceConfigC2SDto input)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _deviceService.SetConfigAsync(input);
|
|
|
|
|
|
}
|
2021-05-27 16:58:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|