|
@@ -0,0 +1,89 @@
|
|
|
+using Microsoft.AspNetCore.Hosting;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using Newtonsoft.Json;
|
|
|
+using Newtonsoft.Json.Linq;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Threading.Tasks;
|
|
|
+
|
|
|
+using TEAMModelOS.Helper.Common.FileHelper;
|
|
|
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
|
|
|
+using TEAMModelOS.SDK.Helper.Common.JsonHelper;
|
|
|
+
|
|
|
+namespace TEAMModelOS.Starter.CloudServer.Controllers.AnalysisControllers
|
|
|
+{
|
|
|
+ [Route("api/[controller]")]
|
|
|
+ [ApiController]
|
|
|
+ public class ClassController: Controller
|
|
|
+ {
|
|
|
+ IHostingEnvironment _hostingEnvironment;
|
|
|
+
|
|
|
+ public ClassController(IHostingEnvironment hostingEnvironment)
|
|
|
+ {
|
|
|
+ _hostingEnvironment = hostingEnvironment;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 获取年级菜单
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="identity"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("getGrade")]
|
|
|
+ public BaseJosnRPCResponse getGrade(string identity)
|
|
|
+ {
|
|
|
+ string contentRootPath = _hostingEnvironment.ContentRootPath;
|
|
|
+ //identity = "grade";
|
|
|
+ JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
+ string data = FileTool.getJson(contentRootPath,identity);
|
|
|
+ builder.Data(JsonConvert.DeserializeObject(data));
|
|
|
+ return builder.build();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取学期菜单
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="identity"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("getTerm")]
|
|
|
+ public BaseJosnRPCResponse getTerm(string identity)
|
|
|
+ {
|
|
|
+ string contentRootPath = _hostingEnvironment.ContentRootPath;
|
|
|
+ identity = "term";
|
|
|
+ JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
+ string data = FileTool.getJson(contentRootPath, identity);
|
|
|
+ builder.Data(JsonConvert.DeserializeObject(data));
|
|
|
+ return builder.build();
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 获取考试列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="identity"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("getExam")]
|
|
|
+ public BaseJosnRPCResponse getExam(string identity)
|
|
|
+ {
|
|
|
+ string contentRootPath = _hostingEnvironment.ContentRootPath;
|
|
|
+ identity = "exam";
|
|
|
+ JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
+ string data = FileTool.getJson(contentRootPath, identity);
|
|
|
+ builder.Data(JsonConvert.DeserializeObject(data));
|
|
|
+ return builder.build();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取基础信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="identity"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("getBase")]
|
|
|
+ public BaseJosnRPCResponse getBase(string identity)
|
|
|
+ {
|
|
|
+ string contentRootPath = _hostingEnvironment.ContentRootPath;
|
|
|
+ identity = "Base";
|
|
|
+ JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
+ string data = FileTool.getJson(contentRootPath, identity);
|
|
|
+ builder.Data(JsonConvert.DeserializeObject(data));
|
|
|
+ return builder.build();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|