SportsRoutineReport

This commit is contained in:
tanglong 2025-10-30 19:04:53 +08:00
parent fbcac61823
commit 94971e02db

View File

@ -213,7 +213,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
} }
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Console.WriteLine($"[GetStudentEduId] Timestamp: {timestamp}"); Console.WriteLine($"[SportsRoutineReport] Timestamp: {timestamp}");
var headers = new Dictionary<string, string> var headers = new Dictionary<string, string>
{ {
@ -236,11 +236,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
try try
{ {
jsonPlain = JsonConvert.SerializeObject(package, Formatting.None); jsonPlain = JsonConvert.SerializeObject(package, Formatting.None);
Console.WriteLine($"[GetStudentEduId] Package JSON: {jsonPlain}"); Console.WriteLine($"[SportsRoutineReport] Package JSON: {jsonPlain}");
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"[GetStudentEduId] Package序列化失败: {ex}"); Console.WriteLine($"[SportsRoutineReport] Package序列化失败: {ex}");
throw; throw;
} }
@ -249,11 +249,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
try try
{ {
bodyEncrypted = DataEncryptHelper.EncryptSm2Zip(jsonPlain, AppSettings.DataPush.PublicKey); bodyEncrypted = DataEncryptHelper.EncryptSm2Zip(jsonPlain, AppSettings.DataPush.PublicKey);
Console.WriteLine($"[GetStudentEduId] Encrypted BODY (Hex): {bodyEncrypted}"); Console.WriteLine($"[SportsRoutineReport] Encrypted BODY (Hex): {bodyEncrypted}");
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"[GetStudentEduId] SM2加密失败: {ex}"); Console.WriteLine($"[SportsRoutineReport] SM2加密失败: {ex}");
throw; throw;
} }
@ -270,11 +270,11 @@ namespace YD_AllHeartRates.Api.Services.Impl
contentType: "application/json", contentType: "application/json",
headers: headers headers: headers
); );
Console.WriteLine($"[GetStudentEduId] Response: {responseText}"); Console.WriteLine($"[SportsRoutineReport] Response: {responseText}");
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"[GetStudentEduId] HTTP请求失败: {ex}"); Console.WriteLine($"[SportsRoutineReport] HTTP请求失败: {ex}");
throw; throw;
} }
@ -295,7 +295,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
// 成功返回固定响应 // 成功返回固定响应
resp.code = 200; resp.code = 200;
resp.msg = "数据上报成功"; resp.msg = "数据上报成功";
Console.WriteLine("[GetStudentEduId] 数据上报成功"); Console.WriteLine("[SportsRoutineReport] 数据上报成功");
return resp; return resp;
} }
else else
@ -303,7 +303,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
// 接口返回错误 // 接口返回错误
resp.code = 500; resp.code = 500;
resp.msg = $"接口返回错误: {msgStr}"; resp.msg = $"接口返回错误: {msgStr}";
Console.WriteLine($"[GetStudentEduId] 接口返回错误: code={codeStr}, msg={msgStr}"); Console.WriteLine($"[SportsRoutineReport] 接口返回错误: code={codeStr}, msg={msgStr}");
return resp; return resp;
} }
} }
@ -312,7 +312,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
{ {
resp.code = 500; resp.code = 500;
resp.msg = "JSON解析异常"; resp.msg = "JSON解析异常";
Console.WriteLine($"[GetStudentEduId] JSON解析失败: {ex}"); Console.WriteLine($"[SportsRoutineReport] JSON解析失败: {ex}");
return resp; return resp;
} }
} }