コード例 #1
0
        public IHttpActionResult GroupUpdateAnnouncement(GroupAnnouncementModel model)
        {
            ApiServerMsg result = new ApiServerMsg();

            try
            {
                if (_dicSockets.ContainsKey(model.uuid))
                {
                    var res = _dicSockets[model.uuid].weChatThread.Wx_SetChatroomAnnouncement(model.chatroomid, model.context);
                    result.Success = true;
                    result.Context = res;
                    return(Ok(result));
                }
                else
                {
                    result.Success = false;
                    result.Context = "不存在该websocket连接";
                    return(Ok(result));
                }
            }
            catch (Exception e)
            {
                result.Success    = false;
                result.ErrContext = e.Message;
                return(Ok(result));
            }
        }
コード例 #2
0
        public IHttpActionResult GroupUpdateAnnouncement(GroupAnnouncementModel model)
        {
            ApiServerMsg apiServerMsg = new ApiServerMsg();

            try
            {
                if (XzyWebSocket._dicSockets.ContainsKey(model.uuid))
                {
                    string context = XzyWebSocket._dicSockets[model.uuid].weChatThread.Wx_ESetChatroomAnnouncement(model.chatroomid, model.context);
                    apiServerMsg.Success = true;
                    apiServerMsg.Context = context;
                    return(Ok(apiServerMsg));
                }
                apiServerMsg.Success = false;
                apiServerMsg.Context = "不存在该websocket连接";
                return(Ok(apiServerMsg));
            }
            catch (Exception ex)
            {
                apiServerMsg.Success    = false;
                apiServerMsg.ErrContext = ex.Message;
                return(Ok(apiServerMsg));
            }
        }