Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer #2999

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*----------------------------------------------------------------
Copyright (C) 2024 Senparc

文件名:RequestMessageEvent_TemplateCardClick.cs
文件功能描述:模板卡片点击回调事件


创建标识:LofyLiu - 20240315
----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Qubit.Weixin.Work.Entities
{
public class RequestMessageEvent_TemplateCardClick : RequestMessageEventBase, IRequestMessageEventBase, IRequestMessageEventKey
{
/// <summary>
/// 事件类型
/// </summary>
public override Event Event
{
get { return Event.TEMPLATE_CARD_CLICK; }
}

/// <summary>
/// 事件KEY值,与自定义菜单接口中KEY值对应
/// </summary>
public string EventKey { get; set; }
}
}
9 changes: 8 additions & 1 deletion src/Senparc.Weixin.Work/Senparc.Weixin.Work/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ GroupTaskSentStatus 枚举
修改标识:IcedMango - 20240229
修改描述:添加枚举“企业微信会话存档-产生会话回调事件”(MSGAUDIT_NOTIFY)

修改标识:LofyLiu - 20240315
修改描述:添加枚举“模板卡片点击回调事件”
----------------------------------------------------------------*/

using static System.Net.WebRequestMethods;
Expand Down Expand Up @@ -213,7 +215,12 @@ public enum Event
/// <summary>
/// 会话存档-产生会话回调事件
/// </summary>
MSGAUDIT_NOTIFY
MSGAUDIT_NOTIFY,

/// <summary>
/// 模板卡片点击回调事件
/// </summary>
TEMPLATE_CARD_CLICK
}

public enum TencentGender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

修改标识:IcedMango - 20240229
修改描述:添加: 企业微信会话存档-产生会话回调事件(MSGAUDIT_NOTIFY)

修改标识:LofyLiu - 20240315
修改描述:添加: 模板卡片回调事件
----------------------------------------------------------------*/

using Senparc.NeuChar;
Expand Down Expand Up @@ -235,6 +238,9 @@ public override IWorkRequestMessageBase GetRequestEntityMappingResult(RequestMsg
case "MSGAUDIT_NOTIFY":
requestMessage = new RequestMessageEvent_MsgAuditNotify();
break;
case "TEMPLATE_CARD_EVENT": //模板卡片回调事件
requestMessage = new RequestMessageEvent_TemplateCardClick();
break;
default://其他意外类型(也可以选择抛出异常)
requestMessage = new RequestMessageEventBase();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
修改标识:IcedMango - 20240229
修改描述:添加: 企业微信会话存档-产生会话回调事件

修改标识:LofyLiu - 20240315
修改描述:添加: 模板卡片点击回调事件
----------------------------------------------------------------*/

using Senparc.NeuChar.Context;
Expand Down Expand Up @@ -391,6 +393,10 @@ public virtual async Task<IWorkResponseMessageBase> OnEventRequestAsync(IRequest
OnEvent_MsgAuditNotifyRequestAsync(
RequestMessage as RequestMessageEvent_MsgAuditNotify);
break;
case Event.TEMPLATE_CARD_CLICK://模板卡片点击回调事件
responseMessage = await
OnEvent_TemplateCardEventClickRequestAsync(
RequestMessage as RequestMessageEvent_TemplateCardClick);
default:
throw new UnknownRequestMsgTypeException("未知的Event下属请求信息", null);
}
Expand Down Expand Up @@ -810,6 +816,15 @@ public virtual async Task<IWorkResponseMessageBase> OnEvent_MsgAuditNotifyReques
return await Task.Run(() => OnEvent_MsgAuditNotifyRequest(requestMessage)).ConfigureAwait(false);
}

/// <summary>
/// 模板卡片点击回调事件
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual async Task<IWorkResponseMessageBase> OnEvent_TemplateCardEventClickRequestAsync(RequestMessageEvent_TemplateCardClick requestMessage)
{
return await Task.Run(() => OnEvent_TemplateCardEventClickRequest(requestMessage)).ConfigureAwait(false);
}
#endregion //Event 下属分类

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ OnThirdPartyEvent_Contact_Sync 改名为 OnThirdPartyEvent_Change_Contact()

修改标识:IcedMango - 20240229
修改描述:添加: 企业微信会话存档-产生会话回调事件

修改标识:LofyLiu - 20240315
修改描述:添加: 模板卡片点击回调事件
----------------------------------------------------------------*/

using System;
Expand Down Expand Up @@ -897,6 +900,16 @@ public virtual IWorkResponseMessageBase OnEvent_MsgAuditNotifyRequest(RequestMes
return DefaultResponseMessage(requestMessage);
}

/// <summary>
/// 模板卡片点击回调事件
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual IWorkResponseMessageBase OnEvent_TemplateCardEventClickRequest(RequestMessageEvent_TemplateCardClick requestMessage)
{
return DefaultResponseMessage(requestMessage);
}

#endregion //Event 下属分类
#endregion

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.19.0</Version>
<Version>3.20.0</Version>
<LangVersion>10.0</LangVersion>
<AssemblyName>Senparc.Weixin.Work</AssemblyName>
<RootNamespace>Senparc.Weixin.Work</RootNamespace>
Expand Down Expand Up @@ -209,6 +209,7 @@
1、Work v3.18.1 新加企业微信企业客户标签回调事件(PR #2948)
2、修复:ApprovalCreateTemplateRequest.template_names 命名更正为:template_name(Issue #2949)
v3.19.0 企业微信中间件增加:会话存档-产生会话回调事件回调 (PR #2993)
v3.20.0 模板卡片点击回调事件(PR #2997)
</PackageReleaseNotes>
<RepositoryUrl>https://github.com/JeffreySu/WeiXinMPSDK</RepositoryUrl>
<SignAssembly>False</SignAssembly>
Expand Down
Loading