|
@@ -47,6 +47,7 @@ using Microsoft.Extensions.Hosting;
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
using TEAMModelOS.Models.ShanDa;
|
|
|
using System.Runtime.ConstrainedExecution;
|
|
|
+using DocumentFormat.OpenXml.Wordprocessing;
|
|
|
|
|
|
namespace TEAMModelOS.Controllers
|
|
|
{
|
|
@@ -772,7 +773,9 @@ namespace TEAMModelOS.Controllers
|
|
|
string input = stringBuilder.ToString();
|
|
|
Field fields = input.ToObject<Field>();
|
|
|
List<CourseBase> courses = new();
|
|
|
- List<(string name, double T, double P, int attendCount,int mCount,int groups,long time, List<(string name, int count)> counts, List<(string name, double score)> ps, List<(string name, long time)> appTimes)> scores = new();
|
|
|
+ List<(string name, double T, double P, int attendCount,int mCount,int groups,long time,
|
|
|
+ List<(string name, int count)> counts, List<(string name, double score)> ps,
|
|
|
+ List<(string name, long time)> appTimes, List<(string name, string url, int duration, long time)> vd)> scores = new();
|
|
|
//List<(string name, List<(string name, int count)> counts)> eveCounts = new();
|
|
|
if (response.IsSuccessStatusCode)
|
|
|
{
|
|
@@ -788,6 +791,7 @@ namespace TEAMModelOS.Controllers
|
|
|
var mCount = ne["mCount"].Value<int>();
|
|
|
var time = ne["time"].Value<long>();
|
|
|
var obj = ne["events"].ToObject<List<Events>>();
|
|
|
+ var video = ne["videos"].ToObject<List<Videos>>();
|
|
|
@base.tmdname = tname;
|
|
|
@base.courseName = cname;
|
|
|
@base.attendCount = attendCount;
|
|
@@ -795,6 +799,7 @@ namespace TEAMModelOS.Controllers
|
|
|
@base.groups = new List<string>();
|
|
|
@base.time = time;
|
|
|
@base.eves = obj;
|
|
|
+ @base.videos = video;
|
|
|
//events.Add(obj);
|
|
|
courses.Add(@base);
|
|
|
}
|
|
@@ -813,6 +818,10 @@ namespace TEAMModelOS.Controllers
|
|
|
int P4Count = 0;
|
|
|
int P5Count = 0;
|
|
|
List<(string name, long time)> eveTimes = new();
|
|
|
+ List<(string name, string url,int duration, long time)> videos = new();
|
|
|
+ foreach (var v in eve.videos) {
|
|
|
+ videos.Add((v.videoName,v.video,v.duration, v.startTime));
|
|
|
+ }
|
|
|
foreach (var apps in eve.eves) {
|
|
|
var name = fields.fields.Where(x => x.field.Equals(apps.@event)).FirstOrDefault()?.desc;
|
|
|
eveTimes.Add((name, apps.createTime));
|
|
@@ -943,7 +952,7 @@ namespace TEAMModelOS.Controllers
|
|
|
double scoreT = scoreA + scoreB + scoreC;
|
|
|
scoreT = scoreT > 0 ? Math.Round(scoreT, 2) : 0;
|
|
|
P = P > 0 ? Math.Round(P, 2) : 0;
|
|
|
- scores.Add((eve.courseName, scoreT, P,eve.attendCount,eve.mCount,eve.groups.Count,eve.time,eves, PScore, eveTimes));
|
|
|
+ scores.Add((eve.courseName, scoreT, P,eve.attendCount,eve.mCount,eve.groups.Count,eve.time,eves, PScore, eveTimes, videos));
|
|
|
//eveCounts.Add((eve.courseName, eves));
|
|
|
}
|
|
|
//var eve = courses.Select(c => c.eves).ToList();
|
|
@@ -964,7 +973,8 @@ namespace TEAMModelOS.Controllers
|
|
|
c.time,
|
|
|
count = c.counts.Select(x => new { x.name, x.count }),
|
|
|
pScore = c.ps.Select(x => new {x.name,x.score }),
|
|
|
- appTime = c.appTimes.Select(x => new {x.name,x.time })
|
|
|
+ appTime = c.appTimes.Select(x => new {x.name,x.time }),
|
|
|
+ videos = c.vd.Select(x =>new { x.name,x.url,x.duration,x.time})
|
|
|
});
|
|
|
/*var courseCount = eveCounts.Select(c => new
|
|
|
{
|
|
@@ -2186,6 +2196,7 @@ namespace TEAMModelOS.Controllers
|
|
|
public List<string> groups { get; set; }
|
|
|
public long time { get; set; }
|
|
|
public List<Events> eves { get; set; }
|
|
|
+ public List<Videos> videos { get; set; }
|
|
|
}
|
|
|
public class Events
|
|
|
{
|
|
@@ -2193,4 +2204,11 @@ namespace TEAMModelOS.Controllers
|
|
|
public int freq { get; set; }
|
|
|
public long createTime { get; set; }
|
|
|
}
|
|
|
+ public class Videos
|
|
|
+ {
|
|
|
+ public string videoName { get; set; }
|
|
|
+ public string video { get; set; }
|
|
|
+ public int duration { get; set; }
|
|
|
+ public long startTime { get; set; }
|
|
|
+ }
|
|
|
}
|