ClassController.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Microsoft.AspNetCore.Hosting;
  2. using Microsoft.AspNetCore.Mvc;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using TEAMModelOS.Helper.Common.FileHelper;
  8. using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
  9. namespace TEAMModelOS.Starter.CloudServer.Controllers.AnalysisControllers
  10. {
  11. [Route("api/[controller]")]
  12. [ApiController]
  13. public class ClassController: Controller
  14. {
  15. IHostingEnvironment _hostingEnvironment;
  16. public ClassController(IHostingEnvironment hostingEnvironment)
  17. {
  18. _hostingEnvironment = hostingEnvironment;
  19. }
  20. [HttpGet("getClass")]
  21. public BaseJosnRPCResponse getClass(string identity)
  22. {
  23. string contentRootPath = _hostingEnvironment.ContentRootPath;
  24. identity = "json";
  25. JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
  26. string data = FileTool.getJson(contentRootPath,identity);
  27. builder.Data(data);
  28. return builder.build();
  29. }
  30. }
  31. }