|
@@ -1,4 +1,5 @@
|
|
|
using Azure.Cosmos;
|
|
|
+using HTEXLib.COMM.Helpers;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
@@ -198,6 +199,23 @@ namespace TEAMModelOS.Controllers
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ var tmdids= lessonRecords.Select(x => x.tmdid).ToHashSet();
|
|
|
+ if (tmdids != null && tmdids.Count > 0) {
|
|
|
+ List< IdNameCode > codes= new List<IdNameCode> ();
|
|
|
+ string sqltmd = $"select c.id,c.name,c.picture from c where c.id in ({string.Join(",", tmdids.Select(x => $"'{x}'"))})";
|
|
|
+ await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).GetItemQueryIterator<IdNameCode>(queryText:sqltmd,requestOptions:new QueryRequestOptions { PartitionKey=new PartitionKey("Base") })){
|
|
|
+ codes.Add(item);
|
|
|
+ }
|
|
|
+ if (codes.IsNotEmpty()) {
|
|
|
+ lessonRecords.ForEach(x => {
|
|
|
+ var tmd= codes.Find(z => z.id.Equals(x.tmdid));
|
|
|
+ if (tmd != null) {
|
|
|
+ x.tmdname = tmd.name;
|
|
|
+ x.tmdpicture= tmd.picture;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
return Ok(new { currCount=lessonRecords.Count, continuationToken, lessonRecords });
|
|
|
} catch (Exception ex) {
|
|
|
continuationToken = null;
|