BIHttpTrigger.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections.Generic;
  2. using System.Net;
  3. using System.Net.Http;
  4. using Microsoft.Azure.Functions.Worker;
  5. using Microsoft.Azure.Functions.Worker.Http;
  6. using TEAMModelOS.SDK.DI;
  7. namespace TEAMModelOS.FunctionV4.HttpTrigger
  8. {
  9. public class BIHttpTrigger
  10. {
  11. private readonly AzureCosmosFactory _azureCosmos;
  12. private readonly DingDing _dingDing;
  13. private readonly AzureStorageFactory _azureStorage;
  14. private readonly AzureRedisFactory _azureRedis;
  15. private readonly HttpClient _httpClient;
  16. public BIHttpTrigger(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, HttpClient httpClient)
  17. {
  18. _azureCosmos = azureCosmos;
  19. _dingDing = dingDing;
  20. _azureStorage = azureStorage;
  21. _azureRedis = azureRedis;
  22. _httpClient = httpClient;
  23. }
  24. /// <summary>
  25. /// 统计学校的信息
  26. /// </summary>
  27. /// <param name="req"></param>
  28. /// <returns></returns>
  29. [Function("stats-sc-info")]
  30. public HttpResponseData StatsSchoolInfo([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequestData req)
  31. {
  32. var response = req.CreateResponse(HttpStatusCode.OK);
  33. response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
  34. response.WriteString("Welcome to Azure Functions!");
  35. return response;
  36. }
  37. }
  38. }