|
@@ -223,7 +223,7 @@ namespace TEAMModelOS.Services.Common
|
|
|
}
|
|
|
//开始时间,默认最近三十天
|
|
|
var stimestamp = DateTimeOffset.UtcNow.AddDays(-30).ToUnixTimeMilliseconds();
|
|
|
- if (!requert.TryGetProperty("stime", out JsonElement stime))
|
|
|
+ if (requert.TryGetProperty("stime", out JsonElement stime))
|
|
|
{
|
|
|
if (!stime.ValueKind.Equals(JsonValueKind.Undefined) && !stime.ValueKind.Equals(JsonValueKind.Null) &&stime.TryGetInt64(out long data))
|
|
|
{
|
|
@@ -235,28 +235,28 @@ namespace TEAMModelOS.Services.Common
|
|
|
var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
string etimesql = $" and c.startTime <= {etimestamp} ";
|
|
|
var progresssql = "";
|
|
|
- if (!requert.TryGetProperty("progress", out JsonElement progress))
|
|
|
+ if (requert.TryGetProperty("progress", out JsonElement progress))
|
|
|
{
|
|
|
|
|
|
if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
|
|
|
{
|
|
|
- progresssql = $" and c.progress='{progresssql}' ";
|
|
|
+ progresssql = $" and c.progress='{progress}' ";
|
|
|
}
|
|
|
}
|
|
|
var typesql = "";
|
|
|
- if (!requert.TryGetProperty("type", out JsonElement type))
|
|
|
+ if (requert.TryGetProperty("type", out JsonElement type))
|
|
|
{
|
|
|
|
|
|
if (!type.ValueKind.Equals(JsonValueKind.Undefined) && !type.ValueKind.Equals(JsonValueKind.Null) && type.ValueKind.Equals(JsonValueKind.String))
|
|
|
{
|
|
|
- typesql = $" and c.type='{typesql}' ";
|
|
|
+ typesql = $" and c.type='{type}' ";
|
|
|
}
|
|
|
}
|
|
|
string continuationTokenSchool = null;
|
|
|
string continuationTokenTeacher = null;
|
|
|
//默认不指定返回大小
|
|
|
int? topcout = null;
|
|
|
- if (!requert.TryGetProperty("count", out JsonElement jcount))
|
|
|
+ if (requert.TryGetProperty("count", out JsonElement jcount))
|
|
|
{
|
|
|
if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
|
|
|
{
|
|
@@ -266,7 +266,7 @@ namespace TEAMModelOS.Services.Common
|
|
|
//是否需要进行分页查询,默认不分页
|
|
|
bool iscontinuation = false;
|
|
|
//如果指定了返回大小
|
|
|
- if (!requert.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
|
|
|
+ if (requert.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
|
|
|
{
|
|
|
//指定了cancellationToken continuationSchool
|
|
|
if (!continuationSchool.ValueKind.Equals(JsonValueKind.Null) && continuationSchool.ValueKind.Equals(JsonValueKind.String))
|
|
@@ -276,7 +276,7 @@ namespace TEAMModelOS.Services.Common
|
|
|
}
|
|
|
}
|
|
|
//如果指定了返回大小
|
|
|
- if (!requert.TryGetProperty("continuationTokenTeacher", out JsonElement continuationTeacher))
|
|
|
+ if (requert.TryGetProperty("continuationTokenTeacher", out JsonElement continuationTeacher))
|
|
|
{
|
|
|
//指定了cancellationToken 表示需要进行分页
|
|
|
if (!continuationTeacher.ValueKind.Equals(JsonValueKind.Null) && continuationTeacher.ValueKind.Equals(JsonValueKind.String))
|
|
@@ -375,9 +375,9 @@ namespace TEAMModelOS.Services.Common
|
|
|
}
|
|
|
}
|
|
|
bool tips = false;
|
|
|
- if (!requert.TryGetProperty("tips", out JsonElement jtips))
|
|
|
+ if (requert.TryGetProperty("tips", out JsonElement jtips))
|
|
|
{
|
|
|
- if (!jtips.ValueKind.Equals(JsonValueKind.Undefined) && !jtips.ValueKind.Equals(JsonValueKind.Null) && !jtips.ValueKind.Equals(JsonValueKind.True))
|
|
|
+ if (!jtips.ValueKind.Equals(JsonValueKind.Undefined) && !jtips.ValueKind.Equals(JsonValueKind.Null) && (jtips.ValueKind.Equals(JsonValueKind.True)|| jtips.ValueKind.Equals(JsonValueKind.False)))
|
|
|
{
|
|
|
tips = jtips.GetBoolean();
|
|
|
}
|
|
@@ -396,32 +396,32 @@ namespace TEAMModelOS.Services.Common
|
|
|
activityTips = DoVoteTips;
|
|
|
//msgid, //0不能投票,1可以投票,2不在时间范围内,3周期内的可投票数不足
|
|
|
//voteCount 可用投票数
|
|
|
- res = activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
+ res =await activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
break;
|
|
|
//问卷
|
|
|
case "survey":
|
|
|
//msgid 0 已作答, 1未作答,2,未完成
|
|
|
activityTips = DoSurveyTips;
|
|
|
- res = activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
+ res = await activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
break;
|
|
|
//评测
|
|
|
case "exam":
|
|
|
//msgid 0 已作答, 1未作答,2,未完成, 用时间控制 相关发布状态,并且展示相应的结果
|
|
|
activityTips = DoExamTips;
|
|
|
- res = activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
+ res = await activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
break;
|
|
|
//学习活动
|
|
|
case "learn":
|
|
|
//msgid 0 已完成, 1未开始,2,未完成
|
|
|
activityTips = DoLearnTips;
|
|
|
- res = activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
+ res = await activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
break;
|
|
|
//作业活动
|
|
|
case "homework":
|
|
|
//msgid 0 已作答, 1未作答,2,未完成,3已批改,且有错误,4已批改,已完成
|
|
|
//index:0,1,5 错误题序
|
|
|
activityTips = DoHomeworkTips;
|
|
|
- res = activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
+ res = await activityTips(data, _azureCosmos, id, _azureRedis);
|
|
|
break;
|
|
|
default: break;
|
|
|
}
|