d
This commit is contained in:
parent
65874b3b86
commit
742664d994
@ -97,7 +97,7 @@ namespace YD_AllHeartRates.Api.Mqtt
|
|||||||
studentList = (from d in _smartSportsContext.Device
|
studentList = (from d in _smartSportsContext.Device
|
||||||
join s in _smartSportsContext.Student on d.StudentNo equals s.StudentNo
|
join s in _smartSportsContext.Student on d.StudentNo equals s.StudentNo
|
||||||
join c in _smartSportsContext.Class on s.ClassId equals c.Id
|
join c in _smartSportsContext.Class on s.ClassId equals c.Id
|
||||||
where s.StudentStatus == 1
|
where s.SchoolCode == AppSettings.SchoolCode && s.StudentStatus == 1
|
||||||
select new StudentDto
|
select new StudentDto
|
||||||
{
|
{
|
||||||
SchoolCode = s.SchoolCode,
|
SchoolCode = s.SchoolCode,
|
||||||
@ -114,7 +114,7 @@ namespace YD_AllHeartRates.Api.Mqtt
|
|||||||
DeviceType = d.DeviceType,
|
DeviceType = d.DeviceType,
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
devices = _smartSportsContext.Device.ToList();
|
devices = _smartSportsContext.Device.Where(x => x.SchoolCode == AppSettings.SchoolCode).ToList();
|
||||||
|
|
||||||
_caching.AddObject(AppSettings.StudentListCacheKey, studentList, 28800);
|
_caching.AddObject(AppSettings.StudentListCacheKey, studentList, 28800);
|
||||||
_caching.AddObject(AppSettings.DeviceListCacheKey, devices, 28800);
|
_caching.AddObject(AppSettings.DeviceListCacheKey, devices, 28800);
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
public static string StudentListCacheKey = "student_list";
|
public static string StudentListCacheKey = "student_list";
|
||||||
public static string DeviceListCacheKey = "device_list";
|
public static string DeviceListCacheKey = "device_list";
|
||||||
|
public static string SchoolCode { get; set; }
|
||||||
|
|
||||||
public static void Init(IConfiguration configuration)
|
public static void Init(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
Logging = configuration.GetSection("Logging").Get<LoggingConfig>();
|
Logging = configuration.GetSection("Logging").Get<LoggingConfig>();
|
||||||
@ -25,6 +27,7 @@
|
|||||||
FlushTime = configuration["FlushTime"];
|
FlushTime = configuration["FlushTime"];
|
||||||
DbConnectionString = configuration["DbConnectionString"];
|
DbConnectionString = configuration["DbConnectionString"];
|
||||||
SmartSportsString = configuration["SmartSportsString"];
|
SmartSportsString = configuration["SmartSportsString"];
|
||||||
|
SchoolCode = configuration["SchoolCode"];
|
||||||
RedisConnectionString = configuration["RedisConnectionString"];
|
RedisConnectionString = configuration["RedisConnectionString"];
|
||||||
CorsUrls = configuration["CorsUrls"].Split(',');
|
CorsUrls = configuration["CorsUrls"].Split(',');
|
||||||
Mqtt = configuration.GetSection("Mqtt").Get<MqttConfig>();
|
Mqtt = configuration.GetSection("Mqtt").Get<MqttConfig>();
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
"FlushTime": "2000", //大屏刷新周期
|
"FlushTime": "2000", //大屏刷新周期
|
||||||
|
|
||||||
|
"SchoolCode": "202507280052",
|
||||||
|
|
||||||
"AppUrls": {
|
"AppUrls": {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user