2021-07-29 19:10:19 +08:00
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using Nirvana.Common;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Waste.Application.ThirdApiInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 开放数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ApiDescriptionSettings("DevApi")]
|
2021-07-30 18:15:58 +08:00
|
|
|
|
[NonUnify]
|
2021-07-29 19:10:19 +08:00
|
|
|
|
public class OpenAppService : IDynamicApiController
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly IOpenService _openService;
|
|
|
|
|
|
public OpenAppService(IOpenService openService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_openService = openService;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取设备上报相关信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="data"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _openService.GetDevInfoAsync(data);
|
|
|
|
|
|
}
|
2021-07-30 18:15:58 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 心跳数据上报
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="data"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<ResultInfo> PostHeartAsync(DevHeartRequestDto data)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _openService.PostHeartAsync(data);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取设备注册信息,第一次开机使用
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="ecode"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[QueryParameters]
|
|
|
|
|
|
public async Task<ResultInfo> RegInfoAsync(string ecode)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _openService.RegInfoAsync(ecode);
|
|
|
|
|
|
}
|
2021-07-29 19:10:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|