Jelajahi Sumber

处理share

CrazyIter_Bin 3 tahun lalu
induk
melakukan
aaed5898a6

+ 2 - 2
TEAMModelFunction/MonitorServicesBus.cs

@@ -66,8 +66,8 @@ namespace TEAMModelFunction
                 jsonMsg.RootElement.TryGetProperty("code", out JsonElement code);
                 jsonMsg.RootElement.TryGetProperty("code", out JsonElement code);
                 //Dictionary<string, object> keyValuePairs = mySbMsg.ToObject<Dictionary<string, object>>();
                 //Dictionary<string, object> keyValuePairs = mySbMsg.ToObject<Dictionary<string, object>>();
                 var client = _azureCosmos.GetCosmosClient();
                 var client = _azureCosmos.GetCosmosClient();
-                Vote vote = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(id.ToString(), new PartitionKey($"{code}"));
-                vote.progress = progress.ToString();
+                ItemResponse <Vote> vote = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(id.ToString(), new PartitionKey($"{code}"));
+                vote.Value.progress = progress.ToString();
                 await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(vote, id.ToString(), new PartitionKey($"{code}"));
                 await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(vote, id.ToString(), new PartitionKey($"{code}"));
             }
             }
             catch (Exception ex)
             catch (Exception ex)

+ 2 - 0
TEAMModelOS.SDK/Models/Cosmos/Teacher/Share.cs

@@ -33,6 +33,7 @@ namespace TEAMModelOS.SDK.Models
         /// 权限颁发者
         /// 权限颁发者
         /// </summary>
         /// </summary>
         public string issuer { get; set; }
         public string issuer { get; set; }
+        public string issuerName { get; set; }
         public long createTime { get; set; }
         public long createTime { get; set; }
         /// <summary>
         /// <summary>
         /// 学校编码或教师tmdid
         /// 学校编码或教师tmdid
@@ -114,6 +115,7 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         /// </summary>
         [Required(ErrorMessage = "issuer 必须设置")]
         [Required(ErrorMessage = "issuer 必须设置")]
         public string issuer { get; set; }
         public string issuer { get; set; }
+        public string issuerName { get; set; }
 
 
         /// <summary>
         /// <summary>
         /// 分享  type=coedit共编,share分享
         /// 分享  type=coedit共编,share分享

+ 2 - 1
TEAMModelOS/Controllers/Syllabus/ShareController.cs

@@ -179,6 +179,7 @@ namespace TEAMModelOS.Controllers
                     pk = "Share",
                     pk = "Share",
                     ttl = -1,
                     ttl = -1,
                     issuer = request.issuer,
                     issuer = request.issuer,
+                    issuerName=request.issuerName,
                     createTime = now,
                     createTime = now,
                     school = request.school,
                     school = request.school,
                     scope = request.scope,
                     scope = request.scope,
@@ -383,7 +384,7 @@ namespace TEAMModelOS.Controllers
                 {
                 {
                     shares.Add(item);
                     shares.Add(item);
                 }
                 }
-                var sharesGp  =  shares.GroupBy(x => new {id= x.volumeId ,code=x.scope=="school"?x.school:x.issuer}).Select(y=>new { id=y.Key.id,code=y.Key.code,list=y.ToList()});
+                var sharesGp  =  shares.GroupBy(x => new {id= x.volumeId ,code=x.scope=="school"?x.school:x.issuer, issuerName=x.issuerName }).Select(y=>new { id=y.Key.id,code=y.Key.code, issuerName=y.Key.issuerName, list=y.ToList()});
                 return Ok(new { shares = sharesGp ,status=200});
                 return Ok(new { shares = sharesGp ,status=200});
             }
             }
             catch (Exception ex)
             catch (Exception ex)

+ 1 - 1
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -523,7 +523,7 @@ namespace TEAMModelOS.Controllers
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
-                await _dingDing.SendBotMsg($"TEAMModel,{_option.Location},Init/JoinSchool()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"TEAMModel,{_option.Location},Init/JoinSchool()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
                 return BadRequest();
             }
             }
         }
         }