public ActionResult SaveApp(string appno, string appevent, string description, bool enabled)
 {
     ServerManager.ServerHelper.GetSubImp.InsertOrUpdateApp(new App
     {
         AppNo       = appno,
         AppEvent    = appevent,
         Description = description,
         Enabled     = enabled
     });
     return(this.Json(AopResult.Success(0)));
 }
 public ActionResult SaveSubMsg(string appno, string pubappno, string pubappevent, string receivetype, string receivecontent, bool enabled)
 {
     ServerManager.ServerHelper.GetSubImp.AddSubMsg(new SubMsg
     {
         AppNo          = appno,
         PubAppNo       = pubappno,
         PubAppEvent    = pubappevent,
         ReceiveType    = receivetype,
         ReceiveContent = receivecontent,
         Enabled        = enabled
     });
     return(this.Json(AopResult.Success(0)));
 }
Beispiel #3
0
        public AopResult <PublishMsgResponse> Post(PublishMsgRequest request)
        {
            // 发布消息,需注册应用和事件
            if (!base.ValidateApp(request.AppNo, request.AppEvent))
            {
                return(AopResult.Fail <PublishMsgResponse>("非法调用!"));
            }
            var msgNo = NumHelper.GetRandomNo();
            var msg   = new MsgContent {
                MsgNo = msgNo, AppNo = request.AppNo, AppEvent = request.AppEvent, Content = request.Content
            };

            // 记录消息日志
            ServerHelper.GetLogImp.AddLog(msg);
            // 推送消息到队列
            var queueId = ServerHelper.GetQueueImp.PushMsg(msg);

            return(AopResult.Success(new PublishMsgResponse
            {
                QueueId = queueId.ToString(),
                MsgNo = msgNo
            }));
        }
        public ActionResult GetApps()
        {
            var apps = ServerManager.ServerHelper.GetSubImp.GetApps();

            return(this.Json(AopResult.Success(apps)));
        }
        public ActionResult GetSubMsgs()
        {
            var msgs = ServerManager.ServerHelper.GetSubImp.GetSubMsgs();

            return(this.Json(AopResult.Success(msgs)));
        }