FrameworkController.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Microsoft.AspNetCore.Mvc;
  2. using System.Text.Json.Nodes;
  3. namespace IES.ExamServer.Controllers
  4. {
  5. [ApiController]
  6. [Route("controller/framework")]
  7. public class FrameworkController : BaseController
  8. {
  9. public FrameworkController()
  10. {
  11. }
  12. [HttpGet("doHttpRequest")]
  13. public IActionResult DoHttpRequest(JsonNode json )
  14. {
  15. string ip = $"{json["id"]}";//请求:{"id":"ip"}返回:192.168.56.1
  16. return Ok("ok");
  17. }
  18. /// <summary>
  19. /// 本地服务状态检查接⼝(⽹⻚调本地服务接⼝) 完成
  20. /// </summary>
  21. /// <returns></returns>
  22. [HttpGet("check")]
  23. public IActionResult check()
  24. {
  25. return Ok(1==1);
  26. }
  27. [HttpGet("getCacheFile")]
  28. public IActionResult GetCacheFile([FromQuery] string name )
  29. {
  30. return Ok("ok");
  31. }
  32. [HttpPost("uploadFile")]
  33. public IActionResult UploadFile(JsonNode json)
  34. {
  35. /*
  36. {
  37. "fileName": "f824810b-0d3a-4772-85dc-443eb8895955.wav",
  38. "musicQuestionId": "1835",
  39. "thirdAnswerId": "62abefa1-dfd4-419f-8f4d-05b9e9ea3057::82be3962-674c-1172-0caf-b2dcdc2bd935::202106001",
  40. "thirdStudentName": "曾义程",
  41. "thirdSchoolId": "hbcn",
  42. "thirdStudentId": "202106001",
  43. "schoolUniCode": "cb138fa4-31ba-423c-a0b7-c954c9d3c445",
  44. "questionItemId": "249",
  45. "id": "b6141be4c697bd9aa008013a3857e971",
  46. "status": 0,
  47. "name": "f824810b-0d3a-4772-85dc-443eb8895955.wav",
  48. "createTime": 1733389000260
  49. }
  50. 返回正常
  51. 返回
  52. {newurl: fileName}
  53. 异常
  54. 返回
  55. false
  56. */
  57. return Ok("ok");
  58. }
  59. }
  60. }