Преглед изворни кода

新增通过设备Id获取授权码20240816

ingredientmanage
gwbvipvip пре 4 месеци
родитељ
комит
42cc6020ea
3 измењених фајлова са 29 додато и 0 уклоњено
  1. +10
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/CheckServices.cs
  2. +12
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/CheckServices.cs
  3. +7
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/ICheckServices.cs

+ 10
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/CheckServices.cs Прегледај датотеку

@@ -42,5 +42,15 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService
{
return await _checkServices.GetUserId(key);
}

/// <summary>
/// 通过设备Id获取授权码
/// </summary>
/// <param name="deviceId"></param>
/// <returns></returns>
public async Task<string> GetAuthKey(int deviceId)
{
return await _checkServices.GetAuthKey(deviceId);
}
}
}

+ 12
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/CheckServices.cs Прегледај датотеку

@@ -13,6 +13,7 @@ using System.Threading.Tasks;
using BPA.SAAS.KitChenManage.Core;
using BPA.KitChen.GroupMeal.SqlSugar;
using BPA.SAAS.Manage.Core.System;
using BPA.SAAS.Manage.Core.Device;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services
{
@@ -94,5 +95,16 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Ser
return null;
return data.CreateBy;
}

public async Task<string> GetAuthKey(int deviceId)
{
var deviceInfo = await SqlSugarDb.Db.Queryable<BPA_DeviceInfo>().ClearFilter().FirstAsync(t => t.AutoKey == deviceId);
if (deviceInfo == null)
throw Oops.Oh("设备不存在");
var auth = await SqlSugarDb.Db.Queryable<BPA_PlatformAuthorization>().ClearFilter().FirstAsync(t => t.GroupId == deviceInfo.GroupId);
if (auth == null)
throw Oops.Oh("不存在授权码");
return auth.Key;
}
}
}

+ 7
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/ICheckServices.cs Прегледај датотеку

@@ -25,5 +25,12 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Ser
/// <param name="key"></param>
/// <returns></returns>
Task<string> GetUserId(string key);

/// <summary>
/// 通过设备Id获取授权码
/// </summary>
/// <param name="deviceId"></param>
/// <returns></returns>
Task<string> GetAuthKey(int deviceId);
}
}

Loading…
Откажи
Сачувај