Skip to content

Commit

Permalink
Merge pull request #2276 from Billzjh/Senparc.Weixin.Work
Browse files Browse the repository at this point in the history
Senparc.weixin.work
  • Loading branch information
JeffreySu authored Dec 10, 2020
2 parents 6aa60f0 + 3f1c829 commit 8e0d2bf
Show file tree
Hide file tree
Showing 4 changed files with 485 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@


namespace Senparc.Weixin.Work.Entities
{
/// <summary>
/// 推广二维码注册企业微信完成通知
/// </summary>
public class RequestMessager_Register_Corp : ThirdPartyInfoBase, IThirdPartyInfoBase
{
//public override RequestMsgType MsgType
//{
// get { return RequestMsgType.Unknown; }
//}

public ThirdPartyInfo InfoType
{
get { return ThirdPartyInfo.REGISTER_CORP; }
}
/// <summary>
/// 服务商corpid
/// </summary>
public string ServiceCorpId { get; set; }
public string TimeStamp { get; set; }
/// <summary>
/// 创建企业对应的注册码
/// </summary>
public string RegisterCode { get; set; }
/// <summary>
/// 注册成功的企业corpid
/// </summary>
public string AuthCorpId { get; set; }
/// <summary>
/// 授权管理员的信息
/// </summary>
public ContactSyncToken ContactSync { get; set; }
/// <summary>
/// 授权管理员的userid
/// </summary>
public AuthUserInfoModel AuthUserInfo { get; set; }
/// <summary>
/// 用户自定义的状态值,参数值由接口 获取注册码 指定。若未指定,则无该字段
/// </summary>
public string State { get; set; }
/// <summary>
/// 推广包ID
/// </summary>
public string TemplateId { get; set; }
}


#region 这两个类在NeuChar项目中已经定义,为了编译通过,所以定义在此处【测试通过后请删除这两个类】
public class ContactSyncToken
{
public string AccessToken { get; set; }
public int ExpiresIn { get; set; }
}

public class AuthUserInfoModel
{
public string UserId { get; set; }
}
#endregion
}
7 changes: 6 additions & 1 deletion src/Senparc.Weixin.Work/Senparc.Weixin.Work/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ public enum ThirdPartyInfo
/// <summary>
/// 外部联系人变更通知
/// </summary>
CHANGE_EXTERNAL_CONTACT
CHANGE_EXTERNAL_CONTACT,

/// <summary>
/// 推广码注册完成通知
/// </summary>
REGISTER_CORP
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,8 @@ private string OnThirdPartyEvent(IThirdPartyInfoBase thirdPartyInfo)
return OnThirdPartyEvent_Create_Auth((RequestMessageInfo_Create_Auth)thirdPartyInfo);
case ThirdPartyInfo.CHANGE_CONTACT:
return OnThirdPartyEvent_Change_Contact((RequestMessageInfo_Change_Contact)thirdPartyInfo);
case ThirdPartyInfo.REGISTER_CORP:
return OnThirdPartyEvent_REGISTER_CORP((RequestMessager_Register_Corp)thirdPartyInfo);
case ThirdPartyInfo.CHANGE_EXTERNAL_CONTACT:
{
var cecRequestMessage = RequestMessage as IRequestMessageEvent_Change_ExternalContact_Base;
Expand Down Expand Up @@ -779,6 +781,11 @@ protected virtual string OnThirdPartyEvent_Change_Contact(RequestMessageInfo_Cha
return ThirdPartyEventSuccessResult;
}

protected virtual string OnThirdPartyEvent_REGISTER_CORP(RequestMessager_Register_Corp thirdPartyInfo)
{
return ThirdPartyEventSuccessResult;
}

protected virtual string OnThirdPartyEvent_Create_Auth(RequestMessageInfo_Create_Auth thirdPartyInfo)
{
return ThirdPartyEventSuccessResult;
Expand Down
Loading

0 comments on commit 8e0d2bf

Please sign in to comment.