using Microsoft.AspNetCore.Mvc;
using Nirvana.Common.ApiBase;
using System.Threading.Tasks;
using YBDevice.Entity;
namespace YBDevice.NApi.Controllers.Api
{
[Route("api/[controller]/[action]")]
[ApiController]
public class DeviceController : ControllerBase
{
private readonly IDeviceService _deviceService;
public DeviceController(IDeviceService deviceService)
{
_deviceService = deviceService;
}
///
/// 设备注册
///
///
///
[HttpPost]
public async Task GetInfoAsync(YB_Device yB_Device)
{
return await _deviceService.RegAsync(yB_Device);
}
///
/// 获取设备类型列表
///
/// 小程序appid
///
[HttpGet]
public async Task GetTypeListAsync(string appid)
{
return await _deviceService.GetTypeListAsync(appid);
}
///
/// 根据扫码的设备列表导出EXCEL
///
///
///
[HttpPost]
public async Task ExportExcelByScanListAsync(ScanListC2SDto data)
{
return await _deviceService.ExportExcelByScanListAsync(data);
}
}
}