diff --git a/YD_AllHeartRates.Api/FakesAssemblies/YD_AllHeartRates.Commons.1.0.0.0.Fakes.dll b/YD_AllHeartRates.Api/FakesAssemblies/YD_AllHeartRates.Commons.1.0.0.0.Fakes.dll index d8338a1..629a0f5 100644 Binary files a/YD_AllHeartRates.Api/FakesAssemblies/YD_AllHeartRates.Commons.1.0.0.0.Fakes.dll and b/YD_AllHeartRates.Api/FakesAssemblies/YD_AllHeartRates.Commons.1.0.0.0.Fakes.dll differ diff --git a/YD_AllHeartRates.Api/FakesAssemblies/YD_AllHeartRates.Commons.1.0.0.0.Fakes.messages b/YD_AllHeartRates.Api/FakesAssemblies/YD_AllHeartRates.Commons.1.0.0.0.Fakes.messages new file mode 100644 index 0000000..5a2f267 --- /dev/null +++ b/YD_AllHeartRates.Api/FakesAssemblies/YD_AllHeartRates.Commons.1.0.0.0.Fakes.messages @@ -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" 约束 diff --git a/YD_AllHeartRates.Api/Middlewares/SportsRoutineReportJob.cs b/YD_AllHeartRates.Api/Middlewares/SportsRoutineReportJob.cs index 5e07419..d9407f2 100644 --- a/YD_AllHeartRates.Api/Middlewares/SportsRoutineReportJob.cs +++ b/YD_AllHeartRates.Api/Middlewares/SportsRoutineReportJob.cs @@ -105,6 +105,15 @@ namespace YD_AllHeartRates.Api.Middlewares private static readonly List SchoolCodeList = new List { "202504080013", "202603220088" }; + private static readonly StudentCacheInfo TestStudent = new StudentCacheInfo + { + EduId = "test-edu-00204915", + Name = "测试学生204915", + School = "上海市实验学校东滩高级中学", + Grade = "高三", + ClassName = "高三2班" + }; + public SportsRoutineReportJob(IDataPushService dataPushService, UserContext userContext, SmartSportsContext sportsContext, ICaching caching) { _dataPushService = dataPushService; @@ -119,6 +128,7 @@ namespace YD_AllHeartRates.Api.Middlewares var cachedList = _caching.Get>(redisKey); if (cachedList != null && cachedList.Count > 0) { + AddTestStudent(cachedList); _students = cachedList; Console.WriteLine("从 Redis 加载学生信息完成。"); return; @@ -184,6 +194,8 @@ namespace YD_AllHeartRates.Api.Middlewares } } + AddTestStudent(result); + // 写入 Redis(直接存对象,不再存 json 字符串) _caching.AddObject(redisKey, result); _students = result; @@ -191,6 +203,14 @@ namespace YD_AllHeartRates.Api.Middlewares Console.WriteLine("学生信息已缓存到 Redis。"); } + private static void AddTestStudent(List students) + { + if (students.Any(x => x.EduId == TestStudent.EduId)) + return; + + students.Add(TestStudent); + } + public Task StartAsync(CancellationToken cancellationToken) { // 每分钟检查一次时间,看是否在8-18点并35分执行 @@ -203,7 +223,7 @@ namespace YD_AllHeartRates.Api.Middlewares var now = DateTime.Now; // 每天 8:30 ~ 18:30 每小时35分执行 - if (now.Hour < 8 || now.Hour > 18 || now.Minute != 15) + if (now.Hour < 8 || now.Hour > 18 || now.Minute != 30) return; var startTime = now.AddHours(-1); diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfo.cs b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfo.cs index e7aef0e..dc319a4 100644 --- a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfo.cs +++ b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfo.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 +// This code was generated by a tool. // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -14,7 +13,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+9a604b4f150745ad91a9b343a7759979767c9791")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+62f4a05ce34f3bc35f2fad628026cd4d78c2fbb1")] [assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Api")] [assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Api")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfoInputs.cache b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfoInputs.cache index 1c4356e..973a773 100644 --- a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfoInputs.cache +++ b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.AssemblyInfoInputs.cache @@ -1 +1 @@ -e3c7751633165ec338a31b3731933fa824c45918a5a547644156bab8c2c9649c +5af16d6e6609085a88a8b3c38d2cf2d7fe8b774b69544c02bea0a5ecc654aff5 diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.MvcApplicationPartsAssemblyInfo.cs b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.MvcApplicationPartsAssemblyInfo.cs index 0d700cd..9fb742b 100644 --- a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.MvcApplicationPartsAssemblyInfo.cs +++ b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.MvcApplicationPartsAssemblyInfo.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 +// This code was generated by a tool. // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -14,7 +13,6 @@ using System.Reflection; [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Microsoft.AspNetCore.Mvc.Versioning")] [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.SwaggerGen")] [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("YD_AllHeartRates.Commons")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("YD_AllHeartRates.Commons.1.0.0.0.Fakes")] // Generated by the MSBuild WriteCodeFragment class. diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csproj.AssemblyReference.cache b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csproj.AssemblyReference.cache index 5db44fd..6ad7041 100644 Binary files a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csproj.AssemblyReference.cache and b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csproj.AssemblyReference.cache differ diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csprojFakesResolveAssemblyReference.cache b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csprojFakesResolveAssemblyReference.cache index 046456f..b7ab019 100644 Binary files a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csprojFakesResolveAssemblyReference.cache and b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.csprojFakesResolveAssemblyReference.cache differ diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.dll b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.dll index 99db8ba..23515b9 100644 Binary files a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.dll and b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.dll differ diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.pdb b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.pdb index a291b87..3f6ac29 100644 Binary files a/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.pdb and b/YD_AllHeartRates.Api/obj/Debug/net6.0/YD_AllHeartRates.Api.pdb differ diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/apphost.exe b/YD_AllHeartRates.Api/obj/Debug/net6.0/apphost.exe index 911e4b0..dc53e46 100644 Binary files a/YD_AllHeartRates.Api/obj/Debug/net6.0/apphost.exe and b/YD_AllHeartRates.Api/obj/Debug/net6.0/apphost.exe differ diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/ref/YD_AllHeartRates.Api.dll b/YD_AllHeartRates.Api/obj/Debug/net6.0/ref/YD_AllHeartRates.Api.dll index 46d184d..32c2fa2 100644 Binary files a/YD_AllHeartRates.Api/obj/Debug/net6.0/ref/YD_AllHeartRates.Api.dll and b/YD_AllHeartRates.Api/obj/Debug/net6.0/ref/YD_AllHeartRates.Api.dll differ diff --git a/YD_AllHeartRates.Api/obj/Debug/net6.0/refint/YD_AllHeartRates.Api.dll b/YD_AllHeartRates.Api/obj/Debug/net6.0/refint/YD_AllHeartRates.Api.dll index 46d184d..32c2fa2 100644 Binary files a/YD_AllHeartRates.Api/obj/Debug/net6.0/refint/YD_AllHeartRates.Api.dll and b/YD_AllHeartRates.Api/obj/Debug/net6.0/refint/YD_AllHeartRates.Api.dll differ diff --git a/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.dll b/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.dll index ca36ce6..fb05a99 100644 Binary files a/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.dll and b/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.dll differ diff --git a/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.pdb b/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.pdb index 1b67101..8cd5699 100644 Binary files a/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.pdb and b/YD_AllHeartRates.Commons/bin/Debug/net6.0/YD_AllHeartRates.Commons.pdb differ diff --git a/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfo.cs b/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfo.cs index 2591bd6..33d26f4 100644 --- a/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfo.cs +++ b/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfo.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 +// This code was generated by a tool. // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -14,7 +13,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+9a604b4f150745ad91a9b343a7759979767c9791")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+62f4a05ce34f3bc35f2fad628026cd4d78c2fbb1")] [assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Commons")] [assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Commons")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfoInputs.cache b/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfoInputs.cache index 071febf..89e8b20 100644 --- a/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfoInputs.cache +++ b/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.AssemblyInfoInputs.cache @@ -1 +1 @@ -883a5887de4afba2d4b6161ca46d51365b0294665d147c610e4c5a288afdb427 +21e4e28f923f1db74934b62b386bc124886d28c4608e70deb1443898726850b0 diff --git a/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.dll b/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.dll index ca36ce6..fb05a99 100644 Binary files a/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.dll and b/YD_AllHeartRates.Commons/obj/Debug/net6.0/YD_AllHeartRates.Commons.dll differ diff --git a/YD_AllHeartRates.Commons/obj/Debug/net6.0/ref/YD_AllHeartRates.Commons.dll b/YD_AllHeartRates.Commons/obj/Debug/net6.0/ref/YD_AllHeartRates.Commons.dll index 1bcb19d..1f0f8ca 100644 Binary files a/YD_AllHeartRates.Commons/obj/Debug/net6.0/ref/YD_AllHeartRates.Commons.dll and b/YD_AllHeartRates.Commons/obj/Debug/net6.0/ref/YD_AllHeartRates.Commons.dll differ diff --git a/YD_AllHeartRates.Commons/obj/Debug/net6.0/refint/YD_AllHeartRates.Commons.dll b/YD_AllHeartRates.Commons/obj/Debug/net6.0/refint/YD_AllHeartRates.Commons.dll index 1bcb19d..1f0f8ca 100644 Binary files a/YD_AllHeartRates.Commons/obj/Debug/net6.0/refint/YD_AllHeartRates.Commons.dll and b/YD_AllHeartRates.Commons/obj/Debug/net6.0/refint/YD_AllHeartRates.Commons.dll differ