|
@@ -9,8 +9,10 @@ using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
|
|
|
using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
|
|
|
using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
|
|
|
using TEAMModelOS.SDK.Helper.Common.StringHelper;
|
|
|
+using TEAMModelOS.SDK.Module.AzureCosmosDB.Interfaces;
|
|
|
+using TEAMModelOS.SDK.Module.AzureTable.Interfaces;
|
|
|
using TEAMModelOS.Service.Analysis.Interfaces;
|
|
|
-using TEAMModelOS.Service.EvaluaTion.Interfaces;
|
|
|
+
|
|
|
using TEAMModelOS.Service.Models.Core;
|
|
|
using TEAMModelOS.Service.Models.Evaluation.Models.CosmosModels;
|
|
|
|
|
@@ -20,11 +22,12 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
[ApiController]
|
|
|
public class AchievementController : Controller
|
|
|
{
|
|
|
- private readonly IExamInfoService examInfoService;
|
|
|
+
|
|
|
+ private readonly IAzureCosmosDBRepository azureCosmosDBRepository;
|
|
|
private readonly IAchievementService achievementService;
|
|
|
- public AchievementController(IExamInfoService _examInfoService, IAchievementService _achievementService)
|
|
|
+ public AchievementController( IAchievementService _achievementService , IAzureCosmosDBRepository _azureCosmosDBRepository)
|
|
|
{
|
|
|
- examInfoService = _examInfoService;
|
|
|
+ azureCosmosDBRepository = _azureCosmosDBRepository;
|
|
|
achievementService = _achievementService;
|
|
|
|
|
|
}
|
|
@@ -33,12 +36,12 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
{
|
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
Console.WriteLine(DateTimeOffset.Now.Second);
|
|
|
- List<SimpleExam> exams = await examInfoService.FindSimplExam(request.@params);
|
|
|
+ List<SimpleExam> exams = await azureCosmosDBRepository.FindByDict<SimpleExam>(request.@params);
|
|
|
Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
|
{
|
|
|
{ "schoolCode", "Habook" }
|
|
|
};
|
|
|
- List<Student> students = await examInfoService.FindStudents(stuMap);
|
|
|
+ List<Student> students = await azureCosmosDBRepository.FindByDict<Student> (stuMap);
|
|
|
Console.WriteLine(DateTimeOffset.Now.Second);
|
|
|
List<Dictionary<string, object>> examList = new List<Dictionary<string, object>>();
|
|
|
HashSet<string> classList = new HashSet<string>();
|
|
@@ -445,12 +448,12 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
List<Dictionary<string, object>> scatterAnalysis = new List<Dictionary<string, object>>();
|
|
|
//Dictionary<string, object> scatterAnalysis = new Dictionary<string, object>();
|
|
|
- List<SimpleExam> exams = await examInfoService.FindSimplExam(request.@params);
|
|
|
+ List<SimpleExam> exams = await azureCosmosDBRepository.FindByDict<SimpleExam>(request.@params);
|
|
|
Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
|
{
|
|
|
{ "schoolCode", "Habook" }
|
|
|
};
|
|
|
- List<Student> students = await examInfoService.FindStudents(stuMap);
|
|
|
+ List<Student> students = await azureCosmosDBRepository.FindByDict<Student>(stuMap);
|
|
|
List<string> key = new List<string>
|
|
|
{
|
|
|
"name",
|
|
@@ -579,8 +582,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
HashSet<string> classList = new HashSet<string>();
|
|
|
List<Dictionary<string, object>> exerciseScatter = new List<Dictionary<string, object>>();
|
|
|
//Dictionary<string, object> scatterAnalysis = new Dictionary<string, object>();
|
|
|
- List<SimpleExam> exams = await examInfoService.FindSimplExam(request.@params);
|
|
|
- List<ExamPaper> paper = await examInfoService.FindExamPaper(request.@params);
|
|
|
+ List<SimpleExam> exams = await azureCosmosDBRepository.FindByDict<SimpleExam>(request.@params);
|
|
|
+ List<ExamPaper> paper = await azureCosmosDBRepository.FindByDict<ExamPaper>(request.@params);
|
|
|
List<string> key = new List<string>
|
|
|
{
|
|
|
"id",
|
|
@@ -777,13 +780,13 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
public async Task<BaseJosnRPCResponse> KnowledgePoint(JosnRPCRequest<Dictionary<string, object>> request)
|
|
|
{
|
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
- List<ExamPaper> paper = await examInfoService.FindExamPaper(request.@params);
|
|
|
- List<SimpleExam> exams = await examInfoService.FindSimplExam(request.@params);
|
|
|
+ List<ExamPaper> paper = await azureCosmosDBRepository.FindByDict<ExamPaper>(request.@params);
|
|
|
+ List<SimpleExam> exams = await azureCosmosDBRepository.FindByDict<SimpleExam>(request.@params);
|
|
|
Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
|
{
|
|
|
{ "schoolCode", "Habook" }
|
|
|
};
|
|
|
- List<Student> students = await examInfoService.FindStudents(stuMap);
|
|
|
+ List<Student> students = await azureCosmosDBRepository.FindByDict<Student>(stuMap);
|
|
|
HashSet<string> knowledge = new HashSet<string>();
|
|
|
HashSet<string> area = new HashSet<string>();
|
|
|
List<int> point = new List<int>();
|