Ejemplo n.º 1
0
        private static void DoServerNewRequest(object sender, IWebServerRequestContext e)
        {
            var token = e.Context.Request.QueryString["token"];

            UyiDebug.WriteLog($"请求Token:{token}");
            if (string.IsNullOrEmpty(token))
            {
                UyiDebug.WriteLog($"请求Token 为空");
                return;
            }
            var json = e.GetPostData();

            if (string.IsNullOrEmpty(json))
            {
                UyiDebug.WriteLog($"请求Json 为空");
                return;
            }


            UyiDebug.WriteLog($"请求数据:{json}");

            var p = WebParamData.FromJson(json);

            var objectID   = p["objectID"];
            var text       = p["text"];
            var objectType = p["objectType"];
            var action     = p["action"];


            var send_json = BuildDingDingMsg(objectType, objectID, action, text);

            UyiDebug.WriteLog(send_json);
            HttpHelper.PostStringAsync(string.Format(C.HookUrl, token), send_json, HttpHelper.ContextType.JSON);
        }
Ejemplo n.º 2
0
 private static void ServerNewRequest(object sender, IWebServerRequestContext e)
 {
     try
     {
         DoServerNewRequest(sender, e);
     }
     catch (Exception ex)
     {
         UyiDebug.WriteLog(UyiDebug.GetErrorFormatString(ex));
     }
 }