/// <summary> /// 实例化微信消息管理实例,并指明操作的公众号 /// </summary> /// <param name="connectWeChat">微信接入基本操作对象</param> /// <param name="idOrAppId">公众号的AppId</param> public MessageLinkUp(IConnectLinkUp connectWeChat, string idOrAppId) { connect = connectWeChat; connect.Initialize(idOrAppId); weChatConfig = connect.WeChatConfig; wxcpt = new Tencent.WXBizMsgCrypt(weChatConfig.Token, weChatConfig.EncodingAESKey, weChatConfig.AppID); }
/// <summary> /// 实例化微信素材管理处理实例,后期需Initialize初始化 /// </summary> /// <param name="connectWeChat">微信对接基础对象</param> public MaterialLinkUp(IConnectLinkUp connectWeChat) { connect = connectWeChat; }
/// <summary> /// 实例化微信模板消息处理实例,后期需Initialize初始化 /// </summary> /// <param name="connectWeChat"></param> public TemplateMessageLinkUp(IConnectLinkUp connectWeChat) { connect = connectWeChat; }
/// <summary> /// 实例化客服消息处理实例,后期需Initialize初始化 /// </summary> /// <param name="connectWeChat"></param> public CustomerServiceMsgLinkUp(IConnectLinkUp connectWeChat) { connect = connectWeChat; }
/// <summary> /// 实例化微信自定义菜单处理实例,后期需Initialize初始化 /// </summary> /// <param name="connectWeChat"></param> public CustomMenuLinkUp(IConnectLinkUp connectWeChat) { connect = connectWeChat; }
public WeController(IConnectLinkUp connectLinkUp, IWeChatHandle weChatHandle) { this.connectLinkUp = connectLinkUp; this.weChatHandle = weChatHandle; }
/// <summary> /// 实例化微信消息管理实例,后期需Initialize初始化 /// </summary> /// <param name="connectWeChat">微信接入基本操作对象</param> public MessageLinkUp(IConnectLinkUp connectWeChat) { connect = connectWeChat; }
/// <summary> /// 实例化微信群发接口处理实例,后期需Initialize初始化 /// </summary> /// <param name="connectWeChat"></param> public GroupSendLinkUp(IConnectLinkUp connectWeChat) { connect = connectWeChat; }
/// <summary> /// 实例化微信一次性订阅处理实例,后期需Initialize初始化 /// </summary> /// <param name="connectWeChat">注入依赖的微信对接处理</param> public OnceSubscribeLinkUp(IConnectLinkUp connectWeChat) { connect = connectWeChat; }
/// <summary> /// 实例化微信接入类的测试 /// </summary> public ConnectLinkUpTest() { connectLinkUp = serviceProvider.GetService <IConnectLinkUp>(); connectLinkUp.Initialize(TestConst.WX_APPID); }