push
This commit is contained in:
parent
730229b74a
commit
556623d255
33
YD_AllHeartRates.Api/Controllers/DataPushController.cs
Normal file
33
YD_AllHeartRates.Api/Controllers/DataPushController.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using YD_AllHeartRates.Api.Services.Impl;
|
||||
using YD_AllHeartRates.Api.Services.Interface;
|
||||
using YD_AllHeartRates.Commons.Dto;
|
||||
using YD_AllHeartRates.Commons.Dto.Device;
|
||||
|
||||
namespace YD_AllHeartRates.Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据上报
|
||||
/// </summary>
|
||||
[ApiVersion("1.0")]
|
||||
[AllowAnonymous]
|
||||
[Route("api/[controller]")]
|
||||
public class DataPushController : ControllerBase
|
||||
{
|
||||
private readonly IDataPushService _dataPushService;
|
||||
|
||||
public DataPushController(IDataPushService dataPushService)
|
||||
{
|
||||
_dataPushService = dataPushService;
|
||||
}
|
||||
|
||||
[HttpGet(nameof(GetToken))]
|
||||
public async Task<string> GetToken()
|
||||
{
|
||||
var res = await _dataPushService.GetToken();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.Dto.ResponseMsg 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.MemoryCaches.MemoryCacheSetup 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.Middlewares.SystemExceptionApplicationBuilderExtensions 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.Utils.Util 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 正在跳过 method System.Int32 YD_AllHeartRates.Commons.Utils.Util.GetRank(!!0 score),method System.Int32 YD_AllHeartRates.Commons.Utils.Util.GetRank(!!0 score) unstubbable: 无法同时指定类约束和 "class" 或 "struct" 约束
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 正在跳过 method System.String YD_AllHeartRates.Commons.Utils.Util.GetRankStr(!!0 score),method System.String YD_AllHeartRates.Commons.Utils.Util.GetRankStr(!!0 score) unstubbable: 无法同时指定类约束和 "class" 或 "struct" 约束
|
||||
100
YD_AllHeartRates.Api/Services/Impl/DataPushService.cs
Normal file
100
YD_AllHeartRates.Api/Services/Impl/DataPushService.cs
Normal file
@ -0,0 +1,100 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using YD_AllHeartRates.Api.Services.Interface;
|
||||
using YD_AllHeartRates.Api.Utilities;
|
||||
|
||||
namespace YD_AllHeartRates.Api.Services.Impl
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据上报服务类
|
||||
/// </summary>
|
||||
public class DataPushService : IDataPushService
|
||||
{
|
||||
public async Task<string> GetToken()
|
||||
{
|
||||
long timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
||||
Console.WriteLine($"[GetToken] Timestamp: {timestamp}");
|
||||
|
||||
// 1. 构造字典参数
|
||||
var dict = new SortedDictionary<string, string>
|
||||
{
|
||||
{ "APPID", AppSettings.DataPush.Appid },
|
||||
{ "CLIENT_ID", AppSettings.DataPush.ClientId },
|
||||
{ "TIMESTAMP", timestamp.ToString() }
|
||||
};
|
||||
Console.WriteLine($"[GetToken] Params dict: {string.Join(", ", dict.Select(kv => kv.Key + "=" + kv.Value))}");
|
||||
|
||||
// 2. 按字典序拼接值
|
||||
string bodyPlain = string.Join(",", dict.Values);
|
||||
Console.WriteLine($"[GetToken] Plain BODY string: {bodyPlain}");
|
||||
|
||||
// 3. 使用 SM2 加密
|
||||
string bodyEncrypted;
|
||||
try
|
||||
{
|
||||
bodyEncrypted = DataEncryptHelper.EncryptSm2(bodyPlain, AppSettings.DataPush.PublicKey);
|
||||
Console.WriteLine($"[GetToken] Encrypted BODY (hex): {bodyEncrypted}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[GetToken] SM2 encryption failed: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
string bodyEncoded = Uri.EscapeDataString(bodyEncrypted);
|
||||
Console.WriteLine($"[GetToken] URL-encoded BODY: {bodyEncoded}");
|
||||
|
||||
// 4. 构造 GET 请求 URL
|
||||
string url = $"{AppSettings.DataPush.Hous}oauth2/getToken?CLIENT_ID={AppSettings.DataPush.ClientId}&TIMESTAMP={timestamp}&BODY={bodyEncoded}";
|
||||
Console.WriteLine($"[GetToken] Request URL: {url}");
|
||||
|
||||
// 5. 调用接口
|
||||
string response;
|
||||
try
|
||||
{
|
||||
response = await HttpManager.HttpGetAsync(url);
|
||||
Console.WriteLine($"[GetToken] Response: {response}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[GetToken] HTTP GET failed: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
// 6. 解析 token
|
||||
if (!string.IsNullOrWhiteSpace(response) && response.StartsWith("{"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var json = JsonConvert.DeserializeObject<Dictionary<string, object>>(response);
|
||||
if (json != null && json.ContainsKey("code") && json["code"].ToString() == "200")
|
||||
{
|
||||
if (json.TryGetValue("data", out var dataObj))
|
||||
{
|
||||
var dataJson = dataObj.ToString();
|
||||
var dataDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(dataJson);
|
||||
if (dataDict != null && dataDict.ContainsKey("token"))
|
||||
{
|
||||
string token = dataDict["token"].ToString();
|
||||
Console.WriteLine($"[GetToken] Token: {token}");
|
||||
return token;
|
||||
}
|
||||
}
|
||||
}
|
||||
Console.WriteLine($"[GetToken] No token found in response or code != 200");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[GetToken] JSON parse failed: {ex}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("[GetToken] Response is empty or not JSON");
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
10
YD_AllHeartRates.Api/Services/Interface/IDataPushService.cs
Normal file
10
YD_AllHeartRates.Api/Services/Interface/IDataPushService.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace YD_AllHeartRates.Api.Services.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据上报服务类
|
||||
/// </summary>
|
||||
public interface IDataPushService
|
||||
{
|
||||
Task<string> GetToken();
|
||||
}
|
||||
}
|
||||
@ -89,6 +89,7 @@ namespace YD_AllHeartRates.Api
|
||||
services.AddScoped<IHeartRateReportService, HeartRateReportService>();
|
||||
services.AddScoped<IDeviceService, DeviceService>();
|
||||
services.AddScoped<IUserService, UserService>();
|
||||
services.AddScoped<IDataPushService, DataPushService>();
|
||||
services.AddScoped<LoginContext>();
|
||||
services.AddSession();
|
||||
services.AddMemoryCache();
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
public static string RedisConnectionString { get; set; }
|
||||
public static string[] CorsUrls { get; set; }
|
||||
public static MqttConfig Mqtt { get; set; }
|
||||
public static DataPush DataPush { get; set; }
|
||||
|
||||
public static string StudentListCacheKey = $"student_list";
|
||||
|
||||
@ -32,43 +33,53 @@
|
||||
RedisConnectionString = configuration["RedisConnectionString"];
|
||||
CorsUrls = configuration["CorsUrls"].Split(',');
|
||||
Mqtt = configuration.GetSection("Mqtt").Get<MqttConfig>();
|
||||
}
|
||||
|
||||
public class LoggingConfig
|
||||
{
|
||||
public LogLevelConfig LogLevel { get; set; }
|
||||
}
|
||||
|
||||
public class LogLevelConfig
|
||||
{
|
||||
public string Default { get; set; }
|
||||
public string Microsoft { get; set; }
|
||||
public string MicrosoftHostingLifetime { get; set; }
|
||||
}
|
||||
|
||||
public class VirtualPathConfig
|
||||
{
|
||||
public string StaticFile { get; set; }
|
||||
public string FolderName { get; set; }
|
||||
}
|
||||
|
||||
public class SecretConfig
|
||||
{
|
||||
public string JWT { get; set; }
|
||||
public string Audience { get; set; }
|
||||
public string Issuer { get; set; }
|
||||
public string User { get; set; }
|
||||
public string DB { get; set; }
|
||||
public string Redis { get; set; }
|
||||
}
|
||||
|
||||
public class MqttConfig
|
||||
{
|
||||
public string Host { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string Topic { get; set; }
|
||||
public int BatchSize { get; set; }
|
||||
DataPush = configuration.GetSection("DataPush").Get<DataPush>();
|
||||
}
|
||||
}
|
||||
public class LoggingConfig
|
||||
{
|
||||
public LogLevelConfig LogLevel { get; set; }
|
||||
}
|
||||
|
||||
public class LogLevelConfig
|
||||
{
|
||||
public string Default { get; set; }
|
||||
public string Microsoft { get; set; }
|
||||
public string MicrosoftHostingLifetime { get; set; }
|
||||
}
|
||||
|
||||
public class VirtualPathConfig
|
||||
{
|
||||
public string StaticFile { get; set; }
|
||||
public string FolderName { get; set; }
|
||||
}
|
||||
|
||||
public class SecretConfig
|
||||
{
|
||||
public string JWT { get; set; }
|
||||
public string Audience { get; set; }
|
||||
public string Issuer { get; set; }
|
||||
public string User { get; set; }
|
||||
public string DB { get; set; }
|
||||
public string Redis { get; set; }
|
||||
}
|
||||
|
||||
public class MqttConfig
|
||||
{
|
||||
public string Host { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string Topic { get; set; }
|
||||
public int BatchSize { get; set; }
|
||||
}
|
||||
public class DataPush
|
||||
{
|
||||
public string Hous { get; set; }
|
||||
public string Appid { get; set; }
|
||||
public string ClientId { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public string SecretKey { get; set; }
|
||||
public string Sm4key { get; set; }
|
||||
public string Sm4iv { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
91
YD_AllHeartRates.Api/Utilities/DataEncryptHelper.cs
Normal file
91
YD_AllHeartRates.Api/Utilities/DataEncryptHelper.cs
Normal file
@ -0,0 +1,91 @@
|
||||
using Newtonsoft.Json;
|
||||
using Org.BouncyCastle.Asn1.GM;
|
||||
using Org.BouncyCastle.Asn1.Sec;
|
||||
using Org.BouncyCastle.Asn1.X9;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using Org.BouncyCastle.Crypto.Engines;
|
||||
using Org.BouncyCastle.Crypto.Modes;
|
||||
using Org.BouncyCastle.Crypto.Paddings;
|
||||
using Org.BouncyCastle.Crypto.Parameters;
|
||||
using Org.BouncyCastle.Security;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace YD_AllHeartRates.Api.Utilities
|
||||
{
|
||||
public static class DataEncryptHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// SM2 公钥加密(C1C3C2 顺序,输出十六进制)
|
||||
/// </summary>
|
||||
/// <param name="plainText">明文字符串</param>
|
||||
/// <param name="pubKeyHex">公钥十六进制(压缩或非压缩)</param>
|
||||
/// <returns>加密后的十六进制密文</returns>
|
||||
public static string EncryptSm2(string plainText, string pubKeyHex)
|
||||
{
|
||||
if (string.IsNullOrEmpty(plainText))
|
||||
throw new ArgumentException("plainText 不能为空");
|
||||
if (string.IsNullOrEmpty(pubKeyHex))
|
||||
throw new ArgumentException("pubKeyHex 不能为空");
|
||||
|
||||
byte[] plainBytes = Encoding.UTF8.GetBytes(plainText);
|
||||
|
||||
// 获取 SM2 曲线参数
|
||||
var sm2Curve = GMNamedCurves.GetByName("sm2p256v1");
|
||||
var curve = sm2Curve.Curve;
|
||||
var ecParams = new ECDomainParameters(curve, sm2Curve.G, sm2Curve.N);
|
||||
|
||||
// 解析公钥
|
||||
byte[] pubKeyBytes = HexStringToBytes(pubKeyHex);
|
||||
if (pubKeyBytes.Length != 33 && pubKeyBytes.Length != 65)
|
||||
throw new ArgumentException("公钥长度错误,应为 33(压缩)或 65(非压缩)字节");
|
||||
|
||||
Org.BouncyCastle.Math.EC.ECPoint q;
|
||||
try
|
||||
{
|
||||
q = curve.DecodePoint(pubKeyBytes);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException("公钥解析失败,请确认是有效 SM2 公钥(压缩或非压缩)", ex);
|
||||
}
|
||||
|
||||
var pubKey = new ECPublicKeyParameters(q, ecParams);
|
||||
|
||||
// SM2 加密(C1C3C2)
|
||||
var engine = new SM2Engine(SM2Engine.Mode.C1C3C2);
|
||||
engine.Init(true, new ParametersWithRandom(pubKey, new SecureRandom()));
|
||||
|
||||
byte[] cipherBytes = engine.ProcessBlock(plainBytes, 0, plainBytes.Length);
|
||||
|
||||
return BytesToHex(cipherBytes);
|
||||
}
|
||||
|
||||
#region 辅助方法
|
||||
/// <summary>
|
||||
/// 十六进制字符串转字节数组
|
||||
/// </summary>
|
||||
private static byte[] HexStringToBytes(string hex)
|
||||
{
|
||||
if (hex.Length % 2 != 0)
|
||||
throw new ArgumentException("Hex string 必须为偶数长度");
|
||||
|
||||
byte[] bytes = new byte[hex.Length / 2];
|
||||
for (int i = 0; i < hex.Length; i += 2)
|
||||
bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 字节数组转十六进制字符串
|
||||
/// </summary>
|
||||
private static string BytesToHex(byte[] bytes)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(bytes.Length * 2);
|
||||
foreach (var b in bytes)
|
||||
sb.AppendFormat("{0:x2}", b);
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
66
YD_AllHeartRates.Api/Utilities/HttpManager.cs
Normal file
66
YD_AllHeartRates.Api/Utilities/HttpManager.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using System.Text;
|
||||
|
||||
namespace YD_AllHeartRates.Api.Utilities
|
||||
{
|
||||
public class HttpManager
|
||||
{
|
||||
public static async Task<string> HttpPostAsync(string url, string postData = null, string contentType = "application/json", int timeOut = 30, Dictionary<string, string> headers = null)
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.Timeout = TimeSpan.FromSeconds(timeOut);
|
||||
|
||||
if (headers != null)
|
||||
{
|
||||
foreach (var header in headers)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add(header.Key, header.Value);
|
||||
}
|
||||
}
|
||||
|
||||
HttpContent content = null;
|
||||
if (!string.IsNullOrEmpty(postData))
|
||||
{
|
||||
content = new StringContent(postData, Encoding.UTF8, contentType);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var response = await client.PostAsync(url, content);
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ex.Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static async Task<string> HttpGetAsync(string url, Dictionary<string, string> headers = null)
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
if (headers != null)
|
||||
{
|
||||
foreach (var header in headers)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add(header.Key, header.Value);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var response = await client.GetAsync(url);
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ex.Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -34,6 +34,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
|
||||
<PackageReference Include="AutoMapper.Collection" Version="10.0.0" />
|
||||
<PackageReference Include="BouncyCastle.NetCore" Version="2.2.1" />
|
||||
<PackageReference Include="EPPlus.Core" Version="1.5.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
|
||||
|
||||
@ -46,5 +46,14 @@
|
||||
"Port": 1883,
|
||||
"Topic": "heartrates/topic",
|
||||
"BatchSize": 1
|
||||
},
|
||||
"DataPush": {
|
||||
"Hous": "https://zxx.shedusoft.com/tzjk-watch/",
|
||||
"Appid": "e96cde5c1908bc3cf09ebce13735765b7a2a617726ae122722bbbfb46f1d737c2df72c9773a75f4b7d5f89dfd4052cd47e22688fcf3ca829712f9f41d5b6d4558fffa081ac7d2f746744e5bc40451e04",
|
||||
"ClientId": "a93d62bc-6517-40b5-849b-91beed8cf59e",
|
||||
"PublicKey": "038412fc7ae2ed37c1335622257138fb730c7f7bf6e4c08795b2f011005faf7a7e",
|
||||
"SecretKey": "87d00391b2807a32696abf8e3d639ac6ae8a9c2a476e45180f919966d71105af",
|
||||
"Sm4key": "qU3pK6JOKXCFtNFK",
|
||||
"Sm4iv": "hxXbu1vW8ObPhUJl"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,24 @@
|
||||
[
|
||||
{
|
||||
"ContainingType": "YD_AllHeartRates.Api.Controllers.DataPushController",
|
||||
"Method": "GetToken",
|
||||
"RelativePath": "api/DataPush/GetToken",
|
||||
"HttpMethod": "GET",
|
||||
"IsController": true,
|
||||
"Order": 0,
|
||||
"Parameters": [],
|
||||
"ReturnTypes": [
|
||||
{
|
||||
"Type": "System.String",
|
||||
"MediaTypes": [
|
||||
"text/plain",
|
||||
"application/json",
|
||||
"text/json"
|
||||
],
|
||||
"StatusCode": 200
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"ContainingType": "YD_AllHeartRates.Api.Controllers.DeviceController",
|
||||
"Method": "AddDevice",
|
||||
|
||||
@ -6,6 +6,35 @@
|
||||
"version": "v1"
|
||||
},
|
||||
"paths": {
|
||||
"/api/DataPush/GetToken": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"DataPush"
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"text/plain": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"text/json": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/Device/DevicePageList": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@ -1274,6 +1303,10 @@
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"name": "DataPush",
|
||||
"description": "数据上报"
|
||||
},
|
||||
{
|
||||
"name": "Device",
|
||||
"description": "设备"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
G2sClDPPmDFS/EOaSoqbkBa/7z2yT7cv0qpHXVTKNvM=WWmIfOUbyYPYdKFHlVpzo+vbEnfIsJNTTcG8+oWdtSc=
|
||||
GP25Qx28NgShle3DoTgAmB1JVJdDmR8EBb22S5PIjgk=WWmIfOUbyYPYdKFHlVpzo+vbEnfIsJNTTcG8+oWdtSc=
|
||||
Binary file not shown.
@ -9,7 +9,7 @@
|
||||
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>$(NoWarn);1587;1591;</NoWarn>
|
||||
<NoWarn>$(NoWarn);1587;1591;SYSLIB0050;</NoWarn>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetFrameworkIdentifier = .NETCoreApp
|
||||
build_property.TargetFrameworkVersion = v6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -45,7 +45,7 @@
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.200"
|
||||
"SdkAnalysisLevel": "10.0.100"
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
@ -66,7 +66,7 @@
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.201\\RuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.100-rc.2.25502.107\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\tangl\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.2</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\tangl\.nuget\packages\" />
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.200"
|
||||
"SdkAnalysisLevel": "10.0.100"
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
@ -73,7 +73,7 @@
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.201\\RuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.100-rc.2.25502.107\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "mks6pYvu6jM=",
|
||||
"dgSpecHash": "/ZH8+E29T+U=",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\tangl\\Desktop\\Git\\YD_AllHeartRates.Api\\YD_AllHeartRates.Api\\obj\\Debug\\net6.0\\Fakes\\ydahrc\\f.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
|
||||
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_AllHeartRates.Api")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+42bf593b1ae65e7186d60b546c18343fe32359ce")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+730229b74a66f5ecb8bb885e934d6d7c1a2f8873")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Api")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Api")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
eb1ec2bd9ec7c97d715e7c99e1670f111d912952d1fec5a1c7f81163850698ea
|
||||
55a9d30174cf5cafd72eae0d92049b866215901403ae9201201eb8436d2b1d2d
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
846a3516aaec3b5432224ae8f87673da5c58fe1b47815620f1884994153056f4
|
||||
fd82c0d96bccd6e9b8950b9d22f9038cb2097b06878d6d322381fa17206e2814
|
||||
|
||||
@ -1553,3 +1553,4 @@ C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\obj\Debug\n
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\obj\Debug\net6.0\rjsmcshtml.dswa.cache.json
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\obj\Debug\net6.0\staticwebassets.build.json.cache
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\obj\Debug\net6.0\swae.build.ex.cache
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\bin\Debug\net6.0\BouncyCastle.Crypto.dll
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,6 +14,11 @@
|
||||
用户服务上下文
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_AllHeartRates.Api.Controllers.DataPushController">
|
||||
<summary>
|
||||
数据上报
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_AllHeartRates.Api.Controllers.DeviceController">
|
||||
<summary>
|
||||
设备
|
||||
@ -446,6 +451,11 @@
|
||||
接受写入数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_AllHeartRates.Api.Services.Impl.DataPushService">
|
||||
<summary>
|
||||
数据上报服务类
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_AllHeartRates.Api.Services.Impl.DeviceService">
|
||||
<summary>
|
||||
服务实现
|
||||
@ -592,6 +602,11 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:YD_AllHeartRates.Api.Services.Interface.IDataPushService">
|
||||
<summary>
|
||||
数据上报服务类
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_AllHeartRates.Api.Services.Interface.IDeviceService">
|
||||
<summary>
|
||||
服务接口
|
||||
@ -1302,6 +1317,24 @@
|
||||
<param name="swaggerDoc"></param>
|
||||
<param name="context"></param>
|
||||
</member>
|
||||
<member name="M:YD_AllHeartRates.Api.Utilities.DataEncryptHelper.EncryptSm2(System.String,System.String)">
|
||||
<summary>
|
||||
SM2 公钥加密(C1C3C2 顺序,输出十六进制)
|
||||
</summary>
|
||||
<param name="plainText">明文字符串</param>
|
||||
<param name="pubKeyHex">公钥十六进制(压缩或非压缩)</param>
|
||||
<returns>加密后的十六进制密文</returns>
|
||||
</member>
|
||||
<member name="M:YD_AllHeartRates.Api.Utilities.DataEncryptHelper.HexStringToBytes(System.String)">
|
||||
<summary>
|
||||
十六进制字符串转字节数组
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:YD_AllHeartRates.Api.Utilities.DataEncryptHelper.BytesToHex(System.Byte[])">
|
||||
<summary>
|
||||
字节数组转十六进制字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:YD_AllHeartRates.Api.Utilities.JwtHelper.IssueJwt(YD_AllHeartRates.Commons.UserInfoDto)">
|
||||
<summary>
|
||||
生成JWT
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -63,6 +63,10 @@
|
||||
"target": "Package",
|
||||
"version": "[10.0.0, )"
|
||||
},
|
||||
"BouncyCastle.NetCore": {
|
||||
"target": "Package",
|
||||
"version": "[2.2.1, )"
|
||||
},
|
||||
"EPPlus.Core": {
|
||||
"target": "Package",
|
||||
"version": "[1.5.4, )"
|
||||
|
||||
@ -77,6 +77,19 @@
|
||||
"lib/net6.0/AutoMapper.Collection.dll": {}
|
||||
}
|
||||
},
|
||||
"BouncyCastle.NetCore/2.2.1": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/netstandard2.0/BouncyCastle.Crypto.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/BouncyCastle.Crypto.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"CSRedisCore/3.8.804": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
@ -2462,6 +2475,21 @@
|
||||
"lib/net6.0/AutoMapper.Collection.dll"
|
||||
]
|
||||
},
|
||||
"BouncyCastle.NetCore/2.2.1": {
|
||||
"sha512": "yfWn8JYPc4rkeM2kcsCqFVFOvwCuuQvIieGtQWcjoWxOioeznXQB3M/GmHgbCWbJjc8ycrwGhZaZPiasifYi4A==",
|
||||
"type": "package",
|
||||
"path": "bouncycastle.netcore/2.2.1",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"bouncycastle.netcore.2.2.1.nupkg.sha512",
|
||||
"bouncycastle.netcore.nuspec",
|
||||
"lib/net45/BouncyCastle.Crypto.dll",
|
||||
"lib/net45/BouncyCastle.Crypto.xml",
|
||||
"lib/netstandard2.0/BouncyCastle.Crypto.dll",
|
||||
"lib/netstandard2.0/BouncyCastle.Crypto.xml"
|
||||
]
|
||||
},
|
||||
"CSRedisCore/3.8.804": {
|
||||
"sha512": "ZhxYDbEoRs5hD06UpxCWRBt3mYIYjEDCGVBz3Fjg0y01kAY7R6RtoYS8+S/NjkMaqfWApFHZVU7uVu62ZF8O4w==",
|
||||
"type": "package",
|
||||
@ -7152,6 +7180,7 @@
|
||||
"net6.0": [
|
||||
"AutoMapper.Collection >= 10.0.0",
|
||||
"Autofac.Extensions.DependencyInjection >= 10.0.0",
|
||||
"BouncyCastle.NetCore >= 2.2.1",
|
||||
"EPPlus.Core >= 1.5.4",
|
||||
"MQTTnet >= 4.1.4.563",
|
||||
"Microsoft.AspNetCore.Authentication.JwtBearer >= 6.0.0",
|
||||
@ -7231,6 +7260,10 @@
|
||||
"target": "Package",
|
||||
"version": "[10.0.0, )"
|
||||
},
|
||||
"BouncyCastle.NetCore": {
|
||||
"target": "Package",
|
||||
"version": "[2.2.1, )"
|
||||
},
|
||||
"EPPlus.Core": {
|
||||
"target": "Package",
|
||||
"version": "[1.5.4, )"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "yrRs/HTlGY8=",
|
||||
"dgSpecHash": "1kkuZSSkfMw=",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\tangl\\Desktop\\Git\\YD_AllHeartRates.Api\\YD_AllHeartRates.Api\\YD_AllHeartRates.Api.csproj",
|
||||
"expectedPackageFiles": [
|
||||
@ -9,6 +9,7 @@
|
||||
"C:\\Users\\tangl\\.nuget\\packages\\autofac.extensions.dependencyinjection\\10.0.0\\autofac.extensions.dependencyinjection.10.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tangl\\.nuget\\packages\\automapper\\13.0.0\\automapper.13.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tangl\\.nuget\\packages\\automapper.collection\\10.0.0\\automapper.collection.10.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tangl\\.nuget\\packages\\bouncycastle.netcore\\2.2.1\\bouncycastle.netcore.2.2.1.nupkg.sha512",
|
||||
"C:\\Users\\tangl\\.nuget\\packages\\csrediscore\\3.8.804\\csrediscore.3.8.804.nupkg.sha512",
|
||||
"C:\\Users\\tangl\\.nuget\\packages\\epplus.core\\1.5.4\\epplus.core.1.5.4.nupkg.sha512",
|
||||
"C:\\Users\\tangl\\.nuget\\packages\\humanizer.core\\2.8.26\\humanizer.core.2.8.26.nupkg.sha512",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_AllHeartRates.Commons")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+42bf593b1ae65e7186d60b546c18343fe32359ce")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+730229b74a66f5ecb8bb885e934d6d7c1a2f8873")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Commons")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Commons")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
d76e1874ee90c75e3dfb9be6d23862a5fe692dba765d1594bf4e0d8520c9c7d9
|
||||
b3283428dd39ff483981fba7fd4efc92e9010220bdd6783e1838aaf65ac09a6e
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user