|
@@ -48,8 +48,10 @@ namespace TEAMModelOS.Controllers.Both
|
|
|
_httpTrigger = httpTrigger;
|
|
|
}
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [HttpPost("item-import")]
|
|
|
+ [HttpPost("import")]
|
|
|
+#if !DEBUG
|
|
|
[Authorize(Roles = "IES")]
|
|
|
+#endif
|
|
|
[AuthToken(Roles = "admin", Permissions = "knowledge-upd")]
|
|
|
public IActionResult ItemImport([FromForm] IFormFile file)
|
|
|
{
|
|
@@ -142,7 +144,7 @@ namespace TEAMModelOS.Controllers.Both
|
|
|
}
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [HttpPost("read-knowledge")]
|
|
|
+ [HttpPost("read")]
|
|
|
#if !DEBUG
|
|
|
|
|
|
[Authorize(Roles = "IES")]
|
|
@@ -214,7 +216,7 @@ namespace TEAMModelOS.Controllers.Both
|
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [HttpPost("modify-knowledge-node")]
|
|
|
+ [HttpPost("modify")]
|
|
|
#if !DEBUG
|
|
|
|
|
|
[Authorize(Roles = "IES")]
|
|
@@ -300,7 +302,7 @@ namespace TEAMModelOS.Controllers.Both
|
|
|
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [HttpPost("upsert-knowledge")]
|
|
|
+ [HttpPost("upsert")]
|
|
|
#if !DEBUG
|
|
|
|
|
|
[Authorize(Roles = "IES")]
|
|
@@ -432,8 +434,10 @@ namespace TEAMModelOS.Controllers.Both
|
|
|
}
|
|
|
}
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [HttpPost("find-count")]
|
|
|
+ [HttpPost("list")]
|
|
|
+#if !DEBUG
|
|
|
[Authorize(Roles = "IES")]
|
|
|
+#endif
|
|
|
[AuthToken(Roles = "teacher,admin,student", Permissions = "knowledge-read,knowledge-upd")]
|
|
|
public async Task<IActionResult> FindCount(JsonElement json)
|
|
|
{
|
|
@@ -473,7 +477,7 @@ namespace TEAMModelOS.Controllers.Both
|
|
|
}
|
|
|
else {
|
|
|
string sql= $" select value c from c where c.subjectId='{subject.id}' and c.periodId='{period.id}' ";
|
|
|
- var result = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetList<Knowledge>(sql, $"Knowledge-{school}-{subject.id}");
|
|
|
+ var result = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).GetList<Knowledge>(sql, $"Knowledge-{school}-{subject.id}");
|
|
|
if (result.list.IsNotEmpty())
|
|
|
{
|
|
|
foreach (var item in result.list) {
|
|
@@ -508,9 +512,9 @@ namespace TEAMModelOS.Controllers.Both
|
|
|
scope="school",
|
|
|
pcount=0,
|
|
|
bcount=0,
|
|
|
- };
|
|
|
+ };
|
|
|
+ datas.Add(record);
|
|
|
}
|
|
|
- datas.Add(record);
|
|
|
}
|
|
|
}
|
|
|
}
|