Ejemplo n.º 1
0
        public void DeleteCustomTest()
        {
            //  var accessToken = AccessTokenContainer.GetAccessToken(_appId);
            var result = CustomServiceApi.DeleteCustom(_appId, _appSecret, "zcc@InnocellenceRobot");

            Assert.AreEqual(result.errcode, ReturnCode.请求成功);
        }
Ejemplo n.º 2
0
        public void DeleteCustomTest()
        {
            var accessToken = AccessTokenContainer.GetAccessToken(_appId);
            var result      = CustomServiceApi.DeleteCustom(accessToken, "zcc@SenparcRobot");

            Assert.AreEqual(result.errcode, ReturnCode.请求成功);
        }
Ejemplo n.º 3
0
        public ActionResult Remove(RemoveCustomViewModel model)
        {
            var message = new MessageInfo
            {
                Message     = "操作成功!",
                MessageType = MessageTypes.Success
            };

            if (!ModelState.IsValid)
            {
                message.Message     = "客服账号输入有误!";
                message.MessageType = MessageTypes.Danger;
                return(Json(message));
            }
            try
            {
                //TODO:切换SDK
                var result = CustomServiceApi.DeleteCustom(
                    WeChatConfigManager.Current.GetAccessToken(),
                    model.Account);

                if (result.errcode != ReturnCode.请求成功)
                {
                    message.Message     = result.errmsg;
                    message.MessageType = MessageTypes.Danger;
                }
            }
            catch (ErrorJsonResultException ex)
            {
                message.Message     = ex.Message;
                message.MessageType = MessageTypes.Danger;
            }
            return(Json(message));
        }