67 lines
1.9 KiB
C#
67 lines
1.9 KiB
C#
using Furion.DynamicApiController;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Nirvana.Common;
|
|
using Nirvana.Common.ApiBase;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace YBDevice.NApi.Application.BusinessClient.DeviceInfo
|
|
{
|
|
/// <summary>
|
|
/// 设备管理接口
|
|
/// </summary>
|
|
[ApiDescriptionSettings("BusinessClient")]
|
|
[AppAuthorize]
|
|
public class DeviceAppService : IDynamicApiController
|
|
{
|
|
private readonly IDeviceService _deviceService;
|
|
public DeviceAppService(IDeviceService deviceService)
|
|
{
|
|
_deviceService = deviceService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设备激活
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[QueryParameters]
|
|
public async Task<ResultInfo> ActiveAsync(string sn, string code)
|
|
{
|
|
return await _deviceService.ActiveAsync(sn, code);
|
|
}
|
|
/// <summary>
|
|
/// 名下设备列表
|
|
/// </summary>
|
|
/// <param name="queryParams"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<ResultInfo> GetList(QueryParams queryParams)
|
|
{
|
|
return await _deviceService.GetListAsync(queryParams);
|
|
}
|
|
/// <summary>
|
|
/// 设备详情
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[QueryParameters]
|
|
public async Task<ResultInfo> DetailAsync(int id)
|
|
{
|
|
return await _deviceService.DetailAsync(id);
|
|
}
|
|
/// <summary>
|
|
/// 获取设备类型列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public async Task<ResultInfo> GetDevTypeListAsync()
|
|
{
|
|
return await _deviceService.GetDevTypeListAsync();
|
|
}
|
|
}
|
|
}
|