public IHttpActionResult LabelSet(LabelSetModel model) { ApiServerMsg result = new ApiServerMsg(); try { if (XzyWebSocket._dicSockets.ContainsKey(model.uuid)) { var res = XzyWebSocket._dicSockets[model.uuid].weChatThread.Wx_SetContactLabel(model.wxid, model.labelid); 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)); } }
public IHttpActionResult LabelSet(LabelSetModel model) { ApiServerMsg apiServerMsg = new ApiServerMsg(); try { if (XzyWebSocket._dicSockets.ContainsKey(model.uuid)) { string context = XzyWebSocket._dicSockets[model.uuid].weChatThread.Wx_SetContactLabel(model.wxid, model.labelid); 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)); } }