|
@@ -278,7 +278,9 @@ namespace TEAMModelOS.Controllers
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("bloblog-list")]
|
|
|
+#if !DEBUG
|
|
|
[Authorize(Roles = "IES")]
|
|
|
+#endif
|
|
|
public async Task<ActionResult> BloblogList(JsonElement request)
|
|
|
{
|
|
|
List<Bloblog> bloblogs = new List<Bloblog>();
|
|
@@ -288,6 +290,7 @@ namespace TEAMModelOS.Controllers
|
|
|
request.TryGetProperty("type", out JsonElement type);
|
|
|
request.TryGetProperty("scope", out JsonElement scope);
|
|
|
request.TryGetProperty("periodId", out JsonElement periodId);
|
|
|
+ request.TryGetProperty("ext", out JsonElement _ext);
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
|
|
|
if (scope.GetString().Equals("school"))
|
|
@@ -309,6 +312,17 @@ namespace TEAMModelOS.Controllers
|
|
|
bloblogs.Add(item);
|
|
|
}
|
|
|
}
|
|
|
+ bloblogs.ForEach(x => {
|
|
|
+ string ext = x.type;
|
|
|
+ if (x.url.LastIndexOf(".") > 0)
|
|
|
+ {
|
|
|
+ ext = x.url.Substring(x.url.LastIndexOf(".") > 0 ? x.url.LastIndexOf(".") : 0);
|
|
|
+ ext = ext.ToLower();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (!string.IsNullOrWhiteSpace($"{_ext}")) {
|
|
|
+ bloblogs= bloblogs.Where(x => x.ext.Equals($"{_ext}", StringComparison.OrdinalIgnoreCase)).ToList();
|
|
|
+ }
|
|
|
return Ok(new { bloblogs = bloblogs });
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -519,6 +533,11 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
if (!exsit)
|
|
|
{
|
|
|
+ string ext = u;
|
|
|
+ if (url.LastIndexOf(".") > 0) {
|
|
|
+ ext = url.Substring(url.LastIndexOf(".") > 0 ? url.LastIndexOf(".") : 0);
|
|
|
+ ext= ext.ToLower();
|
|
|
+ }
|
|
|
var blob = new Bloblog
|
|
|
{
|
|
|
id = Guid.NewGuid().ToString(),
|
|
@@ -530,7 +549,8 @@ namespace TEAMModelOS.Controllers
|
|
|
periodId = periodId.ValueKind.Equals(JsonValueKind.Array) ? periodId.ToObject<List<string>>() : new List<string> { "" },
|
|
|
subjectId = subjectId.ValueKind.Equals(JsonValueKind.Array) ? subjectId.ToObject<List<string>>() : new List<string> { "" },
|
|
|
gradeId = gradeId.ValueKind.Equals(JsonValueKind.Array) ? gradeId.ToObject<List<string>>() : new List<string> { "" },
|
|
|
- type = u
|
|
|
+ type = u,
|
|
|
+ ext= ext
|
|
|
};
|
|
|
if (scope.GetString().Equals("school"))
|
|
|
{
|