58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using YD_YiLu.Api.Services.Interface;
|
|
using YD_YiLu.Commons.Dto.DeviceSync;
|
|
|
|
namespace YD_YiLu.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 设置接口
|
|
/// </summary>
|
|
[AllowAnonymous]
|
|
public class SettingController : ControllerBase
|
|
{
|
|
private readonly IDeviceSyncService _deviceSyncService;
|
|
|
|
public SettingController(IDeviceSyncService deviceSyncService)
|
|
{
|
|
_deviceSyncService = deviceSyncService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 拉取安装包新版本
|
|
/// </summary>
|
|
[HttpPost]
|
|
[Route("/setting/verify/app")]
|
|
public async Task<object> AppVerify([FromBody] AppVerifyRequestDto dto)
|
|
{
|
|
return await _deviceSyncService.AppVerifyAsync(dto);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 信息下发失败回调
|
|
/// </summary>
|
|
[HttpPost]
|
|
[Route("/setting/callback/error_user")]
|
|
public object ErrorUserCallback([FromBody] ErrorUserCallbackRequestDto dto)
|
|
{
|
|
return new
|
|
{
|
|
code = 0,
|
|
msg = "OK",
|
|
data = 1
|
|
};
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增app版本
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("app/version/add")]
|
|
public async Task<long> AddAppVersion([FromBody] AppVersionAddRequestDto dto)
|
|
{
|
|
return await _deviceSyncService.AppVersionAddAsync(dto);
|
|
}
|
|
}
|
|
}
|