Beispiel #1
0
 public override bool ExecuteMQ(string serviceName, WQMessage message)
 {
     string endpoint = Configs.MessageIPE.ToString();
     string msg = SerializeHelper.SerializeToJSon(message, true);
     Log.Info("PushMessageHandler.ExecuteMQ:" + msg + " endpoint:" + endpoint + ", message.TargetID:" + message.TargetID);
     byte[] bs = Config.Encode.GetBytes(msg); 
     return SocketListener.GetInstance(endpoint).Send(message.TargetID, bs); 
 }
Beispiel #2
0
 public override bool ExecuteMQ(string serviceName, WQMessage msg)
 {
     Log.Info("DACHandler.ExecuteMQ:" + serviceName);
     string methodName = msg.MethodName;
     string paras = msg.Body.ToString();
     long t = DateTime.Now.Ticks;
     try
     {
         switch (methodName)
         {
             case "ExecutePagedDataList":
                 dac.ExecutePagedDataList(JsonConvert.DeserializeObject<PagedRecordParameter>(paras));
                 break;
             case "ExecuteDataList":
                 dac.ExecuteDataList(JsonConvert.DeserializeObject<WrapedDatabaseParameter>(paras));
                 break;
             case "ExecuteNonQuery":
                 dac.ExecuteNonQuery(JsonConvert.DeserializeObject<WrapedDatabaseParameter>(paras));
                 break;
             case "ExecuteScalar":
                 dac.ExecuteScalar(JsonConvert.DeserializeObject<WrapedDatabaseParameter>(paras));
                 break;
             case "ExecuteDataTable":
                 dac.ExecuteDataTable(JsonConvert.DeserializeObject<WrapedDatabaseParameter>(paras));
                 break;
             case "ExecuteDataSet":
                 dac.ExecuteDataSet(JsonConvert.DeserializeObject<WrapedDatabaseParameter>(paras)).GetXml();
                 break;
             case "ExecutePagedDataSet":
                 dac.ExecutePagedDataSet(JsonConvert.DeserializeObject<PagedRecordParameter>(paras)).GetXml();
                 break;
             case "Login":
                 dac.Login(JsonConvert.DeserializeObject<LoginReq>(paras));
                 break;
             case "Logout":
                 dac.Logout(paras);
                 break;
             case "CheckLogin":
                 dac.CheckLogin(paras);
                 break;
             case "Regist":
                 dac.Regist(JsonConvert.DeserializeObject<LoginReq>(paras));
                 break;
         }
         Log.Write(LogAction.Info, className, "ExecuteMQ", "end", "end", DateTime.Now.Ticks - t, "Socket_DataReceived:接口方法:" + serviceName + "." + methodName + "处理完成");
     }
     catch (Exception e)
     {
         Log.Write(LogAction.Error, className, "ExecuteMQ", "end", "end", DateTime.Now.Ticks - t, "Socket_DataReceived:接口方法:" + serviceName + "." + methodName + e.Message);
         return false;
     }
     return true;
 }
Beispiel #3
0
        public override object ExecuteMessageRequest(string serviceName, WQMessage message)
        { 
            string msg = SerializeHelper.SerializeToJSon(message, true);
            Log.Info("WYUserHandler.ExecuteMessageRequest:" + msg);
            if (message.ServiceName == "LoginService")
            {
                //DAC dac = new DAC(Configs.WeiYunConnection);


                return null;
            }
            //else return null;
            return message.UserToken;
        }
Beispiel #4
0
 public override object ExecuteMessageRequest(string serviceName, WQMessage message)
 {
     string endpoint = Configs.MessageIPE.ToString();
     string msg = SerializeHelper.SerializeToJSon(message, true); 
     Log.Info("PushMessageHandler.ExecuteMessageRequest:" + msg + " endpoint:" + endpoint + ", message.TargetID:" + message.TargetID);
     if (message.ServiceName != "LoginService")
     {
         byte[] bs = Config.Encode.GetBytes(msg); 
         SocketListener.GetInstance(endpoint).Send(message.TargetID, bs);
         return null;
     }
     //else return null;
     return message.UserToken;
 }
Beispiel #5
0
 public override bool ExecuteMQ(string serviceName, WQMessage message)
 { 
     return true;
 }