|
@@ -394,14 +394,16 @@ namespace TEAMModelFunction
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[ProducesDefaultResponseType]
|
|
[ProducesDefaultResponseType]
|
|
//[AuthToken(Roles = "teacher")]
|
|
//[AuthToken(Roles = "teacher")]
|
|
- [HttpPost("fix-itemcond")]
|
|
|
|
- public async Task<IActionResult> FixItemCond(JsonElement requert)
|
|
|
|
|
|
+ [FunctionName("fix-itemcond")]
|
|
|
|
+ public async Task<IActionResult> FixItemCond(
|
|
|
|
+ [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
|
|
|
|
+ ILogger log)
|
|
{
|
|
{
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
//List<ItemInfo> items = new List<ItemInfo>();
|
|
//List<ItemInfo> items = new List<ItemInfo>();
|
|
var queryslt = $"SELECT value(c) FROM c ";
|
|
var queryslt = $"SELECT value(c) FROM c ";
|
|
ItemCond cond = new ItemCond();
|
|
ItemCond cond = new ItemCond();
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ItemInfo>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-habook") }))
|
|
|
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ItemInfo>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-hbcn") }))
|
|
{
|
|
{
|
|
ItemService.CountItemCond(item,null,cond);
|
|
ItemService.CountItemCond(item,null,cond);
|
|
//items.Add(item);
|
|
//items.Add(item);
|