|
@@ -75,11 +75,12 @@ namespace TEAMModelOS.Controllers
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [AuthToken(Roles = "teacher,admin")]
|
|
|
+
|
|
|
[HttpPost("gen-pdf-process")]
|
|
|
-
|
|
|
+
|
|
|
|
|
|
#if !DEBUG
|
|
|
+ [AuthToken(Roles = "teacher,admin")]
|
|
|
[Authorize(Roles = "IES")]
|
|
|
#endif
|
|
|
public async Task<IActionResult> GenPDFProcess(JsonElement request) {
|
|
@@ -88,13 +89,19 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
return BadRequest();
|
|
|
}
|
|
|
+
|
|
|
+ if (!request.TryGetProperty("schoolId", out JsonElement _schoolId))
|
|
|
+ {
|
|
|
+ return BadRequest();
|
|
|
+ }
|
|
|
+
|
|
|
List<RedisValue> studentIds = new List<RedisValue>();
|
|
|
if (request.TryGetProperty("studentIds", out JsonElement _studentIds) && _studentIds.ValueKind.Equals(JsonValueKind.Array))
|
|
|
{
|
|
|
var studentIdS = _studentIds.ToObject<List<string>>();
|
|
|
studentIdS.ForEach(z => { studentIds.Add(z); }) ;
|
|
|
}
|
|
|
- string key = $"ArtPDF:{_artId}";
|
|
|
+ string key = $"ArtPDF:{_artId}:{_schoolId}";
|
|
|
List<StudentArtResult> results= new List<StudentArtResult>();
|
|
|
if (studentIds.IsNotEmpty())
|
|
|
{
|
|
@@ -130,11 +137,12 @@ namespace TEAMModelOS.Controllers
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [AuthToken(Roles = "teacher,admin")]
|
|
|
+
|
|
|
[HttpPost("gen-pdf")]
|
|
|
-
|
|
|
+
|
|
|
|
|
|
#if !DEBUG
|
|
|
+ [AuthToken(Roles = "teacher,admin")]
|
|
|
[Authorize(Roles = "IES")]
|
|
|
#endif
|
|
|
public async Task<IActionResult> GenPDF(JsonElement request)
|