参考资料

Task<MessageModel<BlogViewModels>>

  1. [HttpGet]
  2. [Route("DetailNuxtNoPer")]
  3. public async Task<MessageModel<BlogViewModels>> DetailNuxtNoPer(int id)
  4. {
  5. _logger.LogInformation("xxxxxxxxxxxxxxxxxxx");
  6. return Success(await _blogArticleServices.GetBlogDetails(id));
  7. }
  8. [NonAction]
  9. public MessageModel<T> Success<T>(T data, string msg = "成功")
  10. {
  11. return new MessageModel<T>()
  12. {
  13. success = true,
  14. msg = msg,
  15. response = data,
  16. };
  17. }

Task<IActionResult>

  1. /// <summary>
  2. /// 网关数据变化上报
  3. /// </summary>
  4. /// <param name="notifyData"></param>
  5. /// <returns></returns>
  6. [HttpPost]
  7. [CustomRoute(sericeName, serviceVersion, "gatewaydata")]
  8. public async Task<IActionResult> GatewayData(SubDeviceDataPropertyInfo notifyData)
  9. {
  10. var result = await Panda.Framework.IOCDI.Container.Resolve<Panda.Factory.IGatSubscribe.IHwyV5PSubscribe>($"{sericeName.ToLower()}.cloud.hwyv5p").GatewayData(notifyData, productCategory, sericeName, serviceVersion);
  11. return Ok(result);
  12. }