基础服务api
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

37 lines
1.3 KiB

  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. }