|
@@ -8,6 +8,7 @@ using System.Text.Json;
|
|
|
using System.Threading.Tasks;
|
|
|
using TEAMModelOS.SDK.DI;
|
|
|
using TEAMModelOS.SDK.Extension;
|
|
|
+using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
|
|
|
using TEAMModelOS.SDK.Models;
|
|
|
using TEAMModelOS.SDK.Models.Cosmos;
|
|
|
|
|
@@ -70,10 +71,11 @@ namespace TEAMModelFunction
|
|
|
endTime = vote.endTime,
|
|
|
scode = vote.code,
|
|
|
scope = vote.scope,
|
|
|
- classes = vote.classes,
|
|
|
+ classes = vote.classes.IsNotEmpty() ? vote.classes : new List<string> { "" },
|
|
|
tmdids = vote.tmdids,
|
|
|
progress= "going",
|
|
|
- owner =vote.owner
|
|
|
+ owner =vote.owner,
|
|
|
+ subjects = new List<string> { "" }
|
|
|
};
|
|
|
await client.GetContainer("TEAMModelOS", "School").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
|
|
|
}
|
|
@@ -90,9 +92,10 @@ namespace TEAMModelFunction
|
|
|
scode = vote.code,
|
|
|
scope = vote.scope,
|
|
|
progress = "going",
|
|
|
- classes = vote.classes,
|
|
|
- owner = vote.owner
|
|
|
- // tmdids = vote.tmdids
|
|
|
+ classes = vote.classes.IsNotEmpty() ? vote.classes : new List<string> { "" },
|
|
|
+ owner = vote.owner,
|
|
|
+ tmdids = new List<string> { "" },
|
|
|
+ subjects= new List<string> { ""}
|
|
|
};
|
|
|
await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
|
|
|
}
|
|
@@ -155,8 +158,6 @@ namespace TEAMModelFunction
|
|
|
{
|
|
|
await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Vote>(vote, vote.id, new Azure.Cosmos.PartitionKey(vote.code));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
//更新结束状态
|
|
|
if (vote.scope == "school" || vote.scope == "teacher")
|
|
|
{
|