예제 #1
0
        public bool PushSysMessageToUsers(Jinher.AMP.WCP.Deploy.CustomDTO.CusNewsPushDTO msgDto)
        {
            bool result = false;

            try
            {
                WChatDeveloperFacade facade = new WChatDeveloperFacade();
                facade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo();
                Jinher.AMP.WCP.Deploy.CustomDTO.ReturnInfoDTO searchResult = facade.PushWXPlusMsg(msgDto);
                if (searchResult != null && searchResult.IsSuccess)
                {
                    result = true;
                }
                else
                {
                    if (searchResult != null)
                    {
                        LogHelper.Debug(string.Format("WCPSV.PushWXPlusMsg服务异常:发送微信消息异常。 msgDto:{0},接口返回:{1}。",
                                                      JsonHelper.JsonSerializer(msgDto), searchResult.Message));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("WCPSV.PushWXPlusMsg服务异常:发送微信消息异常。 msgDto:{0}", JsonHelper.JsonSerializer(msgDto)), ex);
            }
            return(result);
        }
예제 #2
0
 public Jinher.AMP.WCP.Deploy.CustomDTO.ReturnInfoDTO GetWXAccessToken(Guid appId)
 {
     try
     {
         //通过appId调用WCP接口获取微信公众号Id、密钥
         Jinher.AMP.WCP.ISV.Facade.WChatDeveloperFacade wChatDeFacade = new WCP.ISV.Facade.WChatDeveloperFacade();
         Jinher.AMP.WCP.Deploy.CustomDTO.ReturnInfoDTO  result        = wChatDeFacade.GetWXAccessToken(appId);
         return(result);
     }
     catch (Exception ex)
     {
         LogHelper.Error(string.Format("WCPSV.GetWXAccessToken服务异常:获取微信设置。 appId:{0}", appId), ex);
         return(null);
     }
 }