|
@@ -1198,6 +1198,26 @@ namespace TEAMModelOS.Controllers
|
|
|
return Ok(new { });
|
|
|
}
|
|
|
|
|
|
+ [ProducesDefaultResponseType]
|
|
|
+ //[AuthToken(Roles = "teacher")]
|
|
|
+ [HttpPost("fix-activity-art")]
|
|
|
+ public async Task<IActionResult> FixActivityArt(JsonElement data)
|
|
|
+ {
|
|
|
+
|
|
|
+ var client = _azureCosmos.GetCosmosClient();
|
|
|
+ List<StuActivity> activities = new List<StuActivity>();
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<StuActivity>(queryText: "SELECT value(c) FROM c where c.pk = 'Activity' and c.type = 'Atr'"))
|
|
|
+ {
|
|
|
+ activities.Add(item);
|
|
|
+ }
|
|
|
+ foreach (var activity in activities)
|
|
|
+ {
|
|
|
+ activity.type = "Art";
|
|
|
+ await client.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync<StuActivity>(activity, activity.id,new PartitionKey(activity.code));
|
|
|
+ }
|
|
|
+ return Ok(new { });
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 修复名单的scope,school,creatorid
|
|
|
/// </summary>
|