Example #1
0
 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)));
 }
Example #2
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)));
 }
Example #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
            }));
        }
Example #4
0
        public ActionResult GetApps()
        {
            var apps = ServerManager.ServerHelper.GetSubImp.GetApps();

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

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