Skip to content

Commit

Permalink
Work v3.18.1 新加企业微信企业客户标签回调事件 #2948 感谢 @xiaopotian1990
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySu committed Nov 28, 2023
1 parent 7acf8ec commit 4fe93f2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ public async Task RequestMessageEvent_Change_External_Chat_Update()
};

var messageHandler = new CustomMessageHandlers(XDocument.Parse(xml), postModel, 10);

await Console.Out.WriteLineAsync(messageHandler.RequestMessage.ToJson(true));

await messageHandler.ExecuteAsync(new System.Threading.CancellationToken());
var responseMessage = messageHandler.ResponseDocument;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------
Copyright (C) 2023 XiaoPoTian
Copyright (C) 2023 Senparc
文件名:RequestMessageEvent_Change_External_Tag_Base.cs
文件功能描述:企业客户标签或标签组事件
Expand Down Expand Up @@ -50,10 +50,10 @@ public class RequestMessageEvent_Change_External_Tag_Create : RequestMessageEven
/// <summary>
/// TagType类型初始化
/// </summary>
/// <param name="TagTypeStr"></param>
public RequestMessageEvent_Change_External_Tag_Create(string TagTypeStr)
/// <param name="tagTypeStr"></param>
public RequestMessageEvent_Change_External_Tag_Create(string tagTypeStr)
{
TagType = (ExternalTagChangeTagType)Enum.Parse(typeof(ExternalTagChangeTagType), TagTypeStr, true);
TagType = (ExternalTagChangeTagType)Enum.Parse(typeof(ExternalTagChangeTagType), tagTypeStr, true);
}
}

Expand All @@ -70,9 +70,9 @@ public class RequestMessageEvent_Change_External_Tag_Update : RequestMessageEven
/// TagType类型初始化
/// </summary>
/// <param name="TagTypeStr"></param>
public RequestMessageEvent_Change_External_Tag_Update(string TagTypeStr)
public RequestMessageEvent_Change_External_Tag_Update(string tagTypeStr)
{
TagType = (ExternalTagChangeTagType)Enum.Parse(typeof(ExternalTagChangeTagType), TagTypeStr, true);
TagType = (ExternalTagChangeTagType)Enum.Parse(typeof(ExternalTagChangeTagType), tagTypeStr, true);
}
/// <summary>
/// 重写具体事件类型
Expand All @@ -94,9 +94,9 @@ public class RequestMessageEvent_Change_External_Tag_Delete : RequestMessageEven
/// TagType类型初始化
/// </summary>
/// <param name="TagTypeStr"></param>
public RequestMessageEvent_Change_External_Tag_Delete(string TagTypeStr)
public RequestMessageEvent_Change_External_Tag_Delete(string tagTypeStr)
{
TagType = (ExternalTagChangeTagType)Enum.Parse(typeof(ExternalTagChangeTagType), TagTypeStr, true);
TagType = (ExternalTagChangeTagType)Enum.Parse(typeof(ExternalTagChangeTagType), tagTypeStr, true);
}
/// <summary>
/// 重写具体事件类型
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,19 @@ public override IWorkRequestMessageBase GetRequestEntityMappingResult(RequestMsg
}
break;
case "CHANGE_EXTERNAL_TAG"://企业客户标签变更事件推送
//创建标签时,此项为tag,创建标签组时,此项为tag_group
//文档:https://developer.work.weixin.qq.com/document/path/92130#%E4%BC%81%E4%B8%9A%E5%AE%A2%E6%88%B7%E6%A0%87%E7%AD%BE%E5%88%9B%E5%BB%BA%E4%BA%8B%E4%BB%B6
var tagType = doc.Root.Element("TagType").Value;
switch (doc.Root.Element("ChangeType").Value.ToUpper())
{
case "CREATE":
requestMessage = new RequestMessageEvent_Change_External_Tag_Create();
requestMessage = new RequestMessageEvent_Change_External_Tag_Create(tagType);
break;
case "UPDATE":
requestMessage = new RequestMessageEvent_Change_External_Tag_Update();
requestMessage = new RequestMessageEvent_Change_External_Tag_Update(tagType);
break;
case "DELETE":
requestMessage = new RequestMessageEvent_Change_External_Tag_Delete();
requestMessage = new RequestMessageEvent_Change_External_Tag_Delete(tagType);
break;
case "SHUFFLE":
requestMessage = new RequestMessageEvent_Change_External_Tag_Shuffle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ OnThirdPartyEvent_Contact_Sync 改名为 OnThirdPartyEvent_Change_Contact()
修改描述:v3.16.4 企业微信三方代开发处理事件: 修复 Async 方法循环调用的 Bug
修改标识:XiaoPoTian - 20231119
修改描述:3.18.1 添加 RequestMessageEvent_Change_External_Tag_Base 事件中 ChangeType 的判断
修改描述:v3.18.1 添加 RequestMessageEvent_Change_External_Tag_Base 事件中 ChangeType 的判断
----------------------------------------------------------------*/

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<Version>3.18.0</Version>
<Version>3.18.1</Version>
<LangVersion>10.0</LangVersion>
<AssemblyName>Senparc.Weixin.Work</AssemblyName>
<RootNamespace>Senparc.Weixin.Work</RootNamespace>
Expand Down

0 comments on commit 4fe93f2

Please sign in to comment.