|
@@ -42,19 +42,21 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
public async Task<BaseJosnRPCResponse> FindExam(JosnRPCRequest<Dictionary<string, object>> request)
|
|
public async Task<BaseJosnRPCResponse> FindExam(JosnRPCRequest<Dictionary<string, object>> request)
|
|
{
|
|
{
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
- Dictionary<string, object> info = new Dictionary<string, object>();
|
|
|
|
|
|
+ Dictionary<string, dynamic> info = new Dictionary<string, dynamic>();
|
|
if (RedisHelper.Instance != null)
|
|
if (RedisHelper.Instance != null)
|
|
{
|
|
{
|
|
|
|
|
|
info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + request.method,
|
|
info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + request.method,
|
|
ShaHashHelper.GetSHA1(JsonNetHelper.ToJson(request.@params)), timeoutSeconds, () => { return FindExamRedis(request.@params, request.method); });
|
|
ShaHashHelper.GetSHA1(JsonNetHelper.ToJson(request.@params)), timeoutSeconds, () => { return FindExamRedis(request.@params, request.method); });
|
|
- builder.Data(info);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ builder.Data(JsonApiHelper.FromApiJson<System.Text.Json.JsonElement>(info.ToJson()));
|
|
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
info = await FindExamRedis(request.@params, request.method);
|
|
info = await FindExamRedis(request.@params, request.method);
|
|
- builder.Data(info);
|
|
|
|
|
|
+ builder.Data(JsonApiHelper.FromApiJson<System.Text.Json.JsonElement>(info.ToJson()));
|
|
}
|
|
}
|
|
return builder.build();
|
|
return builder.build();
|
|
|
|
|
|
@@ -84,7 +86,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- public async Task<Dictionary<string, object>> FindExamRedis (Dictionary<string, object> dict, string method) {
|
|
|
|
|
|
+ public async Task<Dictionary<string, dynamic>> FindExamRedis (Dictionary<string, object> dict, string method) {
|
|
|
|
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
//Console.WriteLine(DateTimeOffset.Now.Second);
|
|
//Console.WriteLine(DateTimeOffset.Now.Second);
|
|
@@ -114,7 +116,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
List<List<string>> subjectPoints = new List<List<string>>();
|
|
List<List<string>> subjectPoints = new List<List<string>>();
|
|
Dictionary<string, object> Average = new Dictionary<string, object>();
|
|
Dictionary<string, object> Average = new Dictionary<string, object>();
|
|
Dictionary<string, object> entryTable = new Dictionary<string, object>();
|
|
Dictionary<string, object> entryTable = new Dictionary<string, object>();
|
|
- Dictionary<string, object> achievementAnalysis = new Dictionary<string, object>();
|
|
|
|
|
|
+ Dictionary<string, dynamic> achievementAnalysis = new Dictionary<string, dynamic>();
|
|
List<string> arrSubject = new List<string>();
|
|
List<string> arrSubject = new List<string>();
|
|
List<string> keys = new List<string>();
|
|
List<string> keys = new List<string>();
|
|
List<string> person = new List<string>();
|
|
List<string> person = new List<string>();
|
|
@@ -1295,8 +1297,11 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
if (RedisHelper.Instance != null)
|
|
if (RedisHelper.Instance != null)
|
|
{
|
|
{
|
|
try {
|
|
try {
|
|
|
|
+ ///RedisHelper.Instance.CurrentSerialize = obj => System.Text.Json.JsonSerializer.Serialize(obj);
|
|
|
|
+ /// RedisHelper.Instance.CurrentDeserialize = (json, type) => System.Text.Json.JsonSerializer.Deserialize(json, type);
|
|
List<ExamInfo> info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + request.method,
|
|
List<ExamInfo> info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + request.method,
|
|
ShaHashHelper.GetSHA1(JsonNetHelper.ToJson(request.@params)), timeoutSeconds, () => { return FindExamInfoRedis(request.@params, request.method); });
|
|
ShaHashHelper.GetSHA1(JsonNetHelper.ToJson(request.@params)), timeoutSeconds, () => { return FindExamInfoRedis(request.@params, request.method); });
|
|
|
|
+
|
|
builder.Data(info);
|
|
builder.Data(info);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new BizException(e.Message);
|
|
throw new BizException(e.Message);
|
|
@@ -1314,6 +1319,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
try {
|
|
try {
|
|
List<ExamInfo> info = await azureCosmosDBRepository.FindByDict<ExamInfo>(dict);
|
|
List<ExamInfo> info = await azureCosmosDBRepository.FindByDict<ExamInfo>(dict);
|
|
|
|
+
|
|
if (RedisHelper.Instance != null)
|
|
if (RedisHelper.Instance != null)
|
|
{
|
|
{
|
|
if (!RedisHelper.Exists(CacheCosmosPrefix + method))
|
|
if (!RedisHelper.Exists(CacheCosmosPrefix + method))
|