msgStr
This commit is contained in:
parent
e3e828ae9b
commit
951d17301b
@ -294,7 +294,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
{
|
||||
// 成功返回固定响应
|
||||
resp.code = 200;
|
||||
resp.msg = "数据上报成功";
|
||||
resp.msg = msgStr;
|
||||
Console.WriteLine("[SportsRoutineReport] 数据上报成功");
|
||||
return resp;
|
||||
}
|
||||
@ -336,7 +336,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
}
|
||||
|
||||
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
Console.WriteLine($"[SportsRoutineReport] Timestamp: {timestamp}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] Timestamp: {timestamp}");
|
||||
|
||||
var headers = new Dictionary<string, string>
|
||||
{
|
||||
@ -359,11 +359,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
try
|
||||
{
|
||||
jsonPlain = JsonConvert.SerializeObject(package, Formatting.None);
|
||||
Console.WriteLine($"[SportsRoutineReport] Package JSON: {jsonPlain}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] Package JSON: {jsonPlain}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[SportsRoutineReport] Package序列化失败: {ex}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] Package序列化失败: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
@ -372,11 +372,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
try
|
||||
{
|
||||
bodyEncrypted = DataEncryptHelper.EncryptSm2Zip(jsonPlain, AppSettings.DataPush.PublicKey);
|
||||
Console.WriteLine($"[SportsRoutineReport] Encrypted BODY (Hex): {bodyEncrypted}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] Encrypted BODY (Hex): {bodyEncrypted}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[SportsRoutineReport] SM2加密失败: {ex}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] SM2加密失败: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
@ -393,11 +393,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
contentType: "application/json",
|
||||
headers: headers
|
||||
);
|
||||
Console.WriteLine($"[SportsRoutineReport] Response: {responseText}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] Response: {responseText}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[SportsRoutineReport] HTTP请求失败: {ex}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] HTTP请求失败: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
@ -417,8 +417,8 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
{
|
||||
// 成功返回固定响应
|
||||
resp.code = 200;
|
||||
resp.msg = "数据上报成功";
|
||||
Console.WriteLine("[SportsRoutineReport] 数据上报成功");
|
||||
resp.msg = msgStr;
|
||||
Console.WriteLine("[SportsAbnormalReport] 数据上报成功");
|
||||
return resp;
|
||||
}
|
||||
else
|
||||
@ -426,7 +426,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
// 接口返回错误
|
||||
resp.code = 500;
|
||||
resp.msg = $"接口返回错误: {msgStr}";
|
||||
Console.WriteLine($"[SportsRoutineReport] 接口返回错误: code={codeStr}, msg={msgStr}");
|
||||
Console.WriteLine($"[SportsAbnormalReport] 接口返回错误: code={codeStr}, msg={msgStr}");
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
@ -459,7 +459,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
}
|
||||
|
||||
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
Console.WriteLine($"[SportsRoutineReport] Timestamp: {timestamp}");
|
||||
Console.WriteLine($"[SportsDataReplay] Timestamp: {timestamp}");
|
||||
|
||||
var headers = new Dictionary<string, string>
|
||||
{
|
||||
@ -482,11 +482,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
try
|
||||
{
|
||||
jsonPlain = JsonConvert.SerializeObject(package, Formatting.None);
|
||||
Console.WriteLine($"[SportsRoutineReport] Package JSON: {jsonPlain}");
|
||||
Console.WriteLine($"[SportsDataReplay] Package JSON: {jsonPlain}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[SportsRoutineReport] Package序列化失败: {ex}");
|
||||
Console.WriteLine($"[SportsDataReplay] Package序列化失败: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
@ -495,11 +495,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
try
|
||||
{
|
||||
bodyEncrypted = DataEncryptHelper.EncryptSm2Zip(jsonPlain, AppSettings.DataPush.PublicKey);
|
||||
Console.WriteLine($"[SportsRoutineReport] Encrypted BODY (Hex): {bodyEncrypted}");
|
||||
Console.WriteLine($"[SportsDataReplay] Encrypted BODY (Hex): {bodyEncrypted}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[SportsRoutineReport] SM2加密失败: {ex}");
|
||||
Console.WriteLine($"[SportsDataReplay] SM2加密失败: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
@ -516,11 +516,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
contentType: "application/json",
|
||||
headers: headers
|
||||
);
|
||||
Console.WriteLine($"[SportsRoutineReport] Response: {responseText}");
|
||||
Console.WriteLine($"[SportsDataReplay] Response: {responseText}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[SportsRoutineReport] HTTP请求失败: {ex}");
|
||||
Console.WriteLine($"[SportsDataReplay] HTTP请求失败: {ex}");
|
||||
throw;
|
||||
}
|
||||
|
||||
@ -540,8 +540,8 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
{
|
||||
// 成功返回固定响应
|
||||
resp.code = 200;
|
||||
resp.msg = "数据上报成功";
|
||||
Console.WriteLine("[SportsRoutineReport] 数据上报成功");
|
||||
resp.msg = msgStr;
|
||||
Console.WriteLine("[SportsDataReplay] 数据上报成功");
|
||||
return resp;
|
||||
}
|
||||
else
|
||||
@ -549,7 +549,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
// 接口返回错误
|
||||
resp.code = 500;
|
||||
resp.msg = $"接口返回错误: {msgStr}";
|
||||
Console.WriteLine($"[SportsRoutineReport] 接口返回错误: code={codeStr}, msg={msgStr}");
|
||||
Console.WriteLine($"[SportsDataReplay] 接口返回错误: code={codeStr}, msg={msgStr}");
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
@ -558,7 +558,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
||||
{
|
||||
resp.code = 500;
|
||||
resp.msg = "JSON解析异常";
|
||||
Console.WriteLine($"[SportsRoutineReport] JSON解析失败: {ex}");
|
||||
Console.WriteLine($"[SportsDataReplay] JSON解析失败: {ex}");
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user