基础服务api
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

StoreServers.cs 1.3 KiB

pirms 8 mēnešiem
123456789101112131415161718192021222324252627282930313233343536
  1. using BPA.SAAS.Manage.Application.Device.Dtos.Device;
  2. using BPA.SAAS.Manage.Comm.Const;
  3. using BPA.SAAS.Manage.Core.Base;
  4. using Furion.RemoteRequest.Extensions;
  5. using Newtonsoft.Json;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace BPA.SAAS.Manage.Application
  12. {
  13. [ApiDescriptionSettings("Stop", Tag = "获取场景")]
  14. public class StoreServers: IDynamicApiController
  15. {
  16. public StoreServers()
  17. {
  18. }
  19. private string BaseServerUrl = App.GetConfig<string>("baseurl");
  20. [HttpGet("/api/stop/getstop")]
  21. public async Task<List<StoreDto>> GetStop()
  22. {
  23. var getStoreurl = BaseServerUrl + "api/store/getstorelist_alm";//获取商品属性
  24. var responseGoodsAttribute = await getStoreurl.SetHeaders(new
  25. {
  26. groupId = App.User?.FindFirst(ClaimConst.GroupId)?.Value
  27. }).SetHttpMethod(HttpMethod.Get).GetAsStringAsync();
  28. var resStore = JsonConvert.DeserializeObject<ResponDataBase>(responseGoodsAttribute);
  29. if (resStore?.statusCode != "200") throw Oops.Oh("获取场景数据失败");
  30. var dataStore = JsonConvert.DeserializeObject<List<StoreDto>>(resStore.data.ToString());
  31. return dataStore;
  32. }
  33. }
  34. }