Skip to content

Commit

Permalink
Merge branch 'Developer' of https://github.com/JeffreySu/WeiXinMPSDK
Browse files Browse the repository at this point in the history
…into Developer
  • Loading branch information
JeffreySu committed Sep 1, 2024
2 parents d5fb8f8 + 0090f43 commit f6cedb9
Show file tree
Hide file tree
Showing 12 changed files with 673 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#region Apache License Version 2.0
/*----------------------------------------------------------------
Copyright 2024 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions
and limitations under the License.
Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
----------------------------------------------------------------*/
#endregion Apache License Version 2.0

/*----------------------------------------------------------------
Copyright (C) 2024 Senparc
文件名:RequestMessageEvent_UserAuthorizationCancellation.cs
文件功能描述:事件之授权用户信息变更
https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/authorization_change.html
----------------------------------------------------------------*/

using Senparc.NeuChar.Entities;

namespace Senparc.Weixin.MP.Entities
{
/// <summary>
/// 事件之授权用户信息变更
/// </summary>
public class RequestMessageEvent_UserAuthorizationCancellation : RequestMessageEventBase, IRequestMessageEventBase
{
/// <summary>
/// 事件类型
/// </summary>
public override Event Event
{
get { return Event.user_authorization_revoke; }
}

/// <summary>
/// 授权用户OpenID
/// </summary>
public string OpenID { get; set; }

/// <summary>
/// 公众号的AppID
/// </summary>
public string AppID { get; set; }

/// <summary>
/// 用户撤回的H5授权信息,201:地址,202:发票信息,203:卡券信息,204:麦克风,205:昵称和头像,206:位置信息,207:选中的图片或视频
/// </summary>
public string RevokeInfo { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#region Apache License Version 2.0
/*----------------------------------------------------------------
Copyright 2024 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions
and limitations under the License.
Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
----------------------------------------------------------------*/
#endregion Apache License Version 2.0

/*----------------------------------------------------------------
Copyright (C) 2024 Senparc
文件名:RequestMessageEvent_UserAuthorizationRevoke.cs
文件功能描述:事件之授权用户信息变更
https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/authorization_change.html
----------------------------------------------------------------*/

using Senparc.NeuChar.Entities;

namespace Senparc.Weixin.MP.Entities
{
/// <summary>
/// 事件之授权用户信息变更
/// </summary>
public class RequestMessageEvent_UserAuthorizationRevoke : RequestMessageEventBase, IRequestMessageEventBase
{
/// <summary>
/// 事件类型
/// </summary>
public override Event Event
{
get { return Event.user_authorization_revoke; }
}

/// <summary>
/// 授权用户OpenID
/// </summary>
public string OpenID { get; set; }

/// <summary>
/// 公众号的AppID
/// </summary>
public string AppID { get; set; }

/// <summary>
/// 用户撤回的H5授权信息,201:地址,202:发票信息,203:卡券信息,204:麦克风,205:昵称和头像,206:位置信息,207:选中的图片或视频
/// </summary>
public string RevokeInfo { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#region Apache License Version 2.0
/*----------------------------------------------------------------
Copyright 2024 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions
and limitations under the License.
Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
----------------------------------------------------------------*/
#endregion Apache License Version 2.0

/*----------------------------------------------------------------
Copyright (C) 2024 Senparc
文件名:RequestMessageEvent_UserInfoModified.cs
文件功能描述:事件之授权用户信息变更
https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/authorization_change.html
----------------------------------------------------------------*/

using Senparc.NeuChar.Entities;

namespace Senparc.Weixin.MP.Entities
{
/// <summary>
/// 事件之授权用户信息变更
/// </summary>
public class RequestMessageEvent_UserInfoModified : RequestMessageEventBase, IRequestMessageEventBase
{
/// <summary>
/// 事件类型
/// </summary>
public override Event Event
{
get { return Event.user_info_modified; }
}

/// <summary>
/// 授权用户OpenID
/// </summary>
public string OpenID { get; set; }

/// <summary>
/// 公众号的AppID
/// </summary>
public string AppID { get; set; }

/// <summary>
/// 用户撤回的H5授权信息,201:地址,202:发票信息,203:卡券信息,204:麦克风,205:昵称和头像,206:位置信息,207:选中的图片或视频
/// </summary>
public string RevokeInfo { get; set; }
}
}
13 changes: 13 additions & 0 deletions src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,19 @@ public enum Event
/// </summary>
subscribe_msg_sent_event,
#endregion

/// <summary>
/// 用户资料变更
/// </summary>
user_info_modified,
/// <summary>
/// 用户撤回
/// </summary>
user_authorization_revoke,
/// <summary>
/// 用户完成注销
/// </summary>
user_authorization_cancellation,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ public virtual async Task<IResponseMessageBase> OnEventRequestAsync(IRequestMess
responseMessage = await OnEvent_Subscribe_Msg_SentRequestAsync(RequestMessage as RequestMessageEvent_Subscribe_Msg_Sent).ConfigureAwait(false);
break;

case Event.user_info_modified:
responseMessage = await OnEvent_UserInfoModifiedRequesAsync(RequestMessage as RequestMessageEvent_UserInfoModified).ConfigureAwait(false);
break;
case Event.user_authorization_revoke:
responseMessage = await OnEvent_UserAuthorizationRevokeRequestAsync(RequestMessage as RequestMessageEvent_UserAuthorizationRevoke).ConfigureAwait(false);
break;
case Event.user_authorization_cancellation:
responseMessage = await OnEvent_UserAuthorizationCancellationRequestAsync(RequestMessage as RequestMessageEvent_UserAuthorizationCancellation).ConfigureAwait(false);
break;

#region 微信认证事件推送

Expand Down Expand Up @@ -257,6 +266,34 @@ public virtual async Task<IResponseMessageBase> OnEventRequestAsync(IRequestMess

#region Event下属分类,接收事件方法

/// <summary>
/// 【异步方法】Event事件类型请求之用户资料变更
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual async Task<IResponseMessageBase> OnEvent_UserInfoModifiedRequesAsync(RequestMessageEvent_UserInfoModified requestMessage)
{
return await DefaultAsyncMethod(requestMessage, () => OnEvent_UserInfoModifiedRequest(requestMessage)).ConfigureAwait(false);
}
/// <summary>
/// 【异步方法】Event事件类型请求之用户撤回
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual async Task<IResponseMessageBase> OnEvent_UserAuthorizationRevokeRequestAsync(RequestMessageEvent_UserAuthorizationRevoke requestMessage)
{
return await DefaultAsyncMethod(requestMessage, () => OnEvent_UserAuthorizationRevokeRequest(requestMessage)).ConfigureAwait(false);
}
/// <summary>
/// 【异步方法】Event事件类型请求之用户完成注销
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual async Task<IResponseMessageBase> OnEvent_UserAuthorizationCancellationRequestAsync(RequestMessageEvent_UserAuthorizationCancellation requestMessage)
{
return await DefaultAsyncMethod(requestMessage, () => OnEvent_UserAuthorizationCancellationRequest(requestMessage)).ConfigureAwait(false);
}

/// <summary>
/// 【异步方法】Event事件类型请求之ENTER
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ
responseMessage = OnEvent_Subscribe_Msg_SentRequest(RequestMessage as RequestMessageEvent_Subscribe_Msg_Sent);
break;

case Event.user_info_modified:
responseMessage = OnEvent_UserInfoModifiedRequest(RequestMessage as RequestMessageEvent_UserInfoModified);
break;
case Event.user_authorization_revoke:
responseMessage = OnEvent_UserAuthorizationRevokeRequest(RequestMessage as RequestMessageEvent_UserAuthorizationRevoke);
break;
case Event.user_authorization_cancellation:
responseMessage = OnEvent_UserAuthorizationCancellationRequest(RequestMessage as RequestMessageEvent_UserAuthorizationCancellation);
break;

#region 卡券回调

case Event.giftcard_pay_done:
Expand Down Expand Up @@ -257,6 +267,34 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ

#region Event下属分类,接收事件方法

/// <summary>
/// Event事件类型请求之用户资料变更
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual IResponseMessageBase OnEvent_UserInfoModifiedRequest(RequestMessageEvent_UserInfoModified requestMessage)
{
return DefaultResponseMessage(requestMessage);
}
/// <summary>
/// Event事件类型请求之用户撤回
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual IResponseMessageBase OnEvent_UserAuthorizationRevokeRequest(RequestMessageEvent_UserAuthorizationRevoke requestMessage)
{
return DefaultResponseMessage(requestMessage);
}
/// <summary>
/// Event事件类型请求之用户完成注销
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual IResponseMessageBase OnEvent_UserAuthorizationCancellationRequest(RequestMessageEvent_UserAuthorizationCancellation requestMessage)
{
return DefaultResponseMessage(requestMessage);
}

/// <summary>
/// Event事件类型请求之ENTER
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#region Apache License Version 2.0
/*----------------------------------------------------------------
Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions
and limitations under the License.
Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
----------------------------------------------------------------*/
#endregion Apache License Version 2.0

/*----------------------------------------------------------------
Copyright (C) 2023 Senparc
文件名:RequestMessageEvent_ChargeServiceQuotaNotify.cs
文件功能描述:付费管理订单用量告警事件
创建标识:mc7246 - 20240831
----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.WxOpen.Entities
{
public class RequestMessageEvent_ChargeServiceQuotaNotify : RequestMessageEventBase,IRequestMessageEventBase
{
/// <summary>
/// 事件类型
/// </summary>
public override Event Event
{
get { return Event.charge_service_quota_notify; }
}

/// <summary>
/// 固定值 3
/// </summary>
public int event_type { get; set; }

/// <summary>
/// 购买的商品的SPU_ID
/// </summary>
public long spu_id { get; set; }

/// <summary>
/// 购买的商品的SPU_NAME
/// </summary>
public string spu_name { get; set; }

/// <summary>
/// 所购 SPU 当前总的用量
/// </summary>
public int total_quota { get; set; }

/// <summary>
/// 所购 SPU 当前总已使用的用量
/// </summary>
public int total_used_quota { get; set; }

}
}
Loading

0 comments on commit f6cedb9

Please sign in to comment.