瀏覽代碼

{ get; set; }

CrazyIter_Bin 3 年之前
父節點
當前提交
f36432d03b

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/Common/SheetConfig.cs

@@ -111,7 +111,7 @@ namespace TEAMModelOS.SDK.Models
         public int type { get; set; }
         public int pageNum { get; set; }
         public List<Pos> pos { get; set; } = new List<Pos>();
-        public List<Point> points = new List<Point>();
+        public List<Point> points { get; set; } = new List<Point>();
     }
     public  class Pos
     {

+ 18 - 8
TEAMModelOS/Controllers/Research/AbilityStatisticsController.cs

@@ -1560,6 +1560,7 @@ namespace TEAMModelOS.Controllers.Research
         {
             try
             {
+                var client = _azureCosmos.GetCosmosClient();
                 if (!HttpContext.Items.TryGetValue("Standard", out object standard)) return Ok(new { error = 400 });               
                 ///没有订阅的
                 List<Ability> notSub = new List<Ability>();
@@ -1617,18 +1618,27 @@ namespace TEAMModelOS.Controllers.Research
                     return Ok(new { error = 400 });
                 };
 
-                AreaSetting areaSetting = null;
+                Area area = null;
                 try
                 {
-                    areaSetting = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<AreaSetting>("", new PartitionKey("AreaSetting"));
-                    if (!string.IsNullOrEmpty(areaSetting.accessConfig)) { 
-                   
-                    }
+                       client.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>($"", requestOptions:new QueryRequestOptions { PartitionKey=new PartitionKey("Base-Area") });
                 }
-                catch (Exception ex) {
-                    areaSetting = null;
+                catch (CosmosException ex)
+                {
+                    return Ok(new { error = 404, msg = "区域不存在!" });
+                }
+                AreaSetting setting = null;
+                if (area != null)
+                {
+                    try
+                    {
+                        setting = await client.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<AreaSetting>(area.id, new PartitionKey("AreaSetting"));
+                    }
+                    catch (CosmosException)
+                    {
+                        return Ok(new { error = 404, msg = "设置不存在!" });
+                    }
                 }
-
                 foreach (var item in currencyAb2) {
                     var had = hadSubs.Where(x => x.id.Equals(item.id)).FirstOrDefault();
                     if (had == null) {