Ejemplo n.º 1
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <param name="newpassword"></param>
        /// <returns></returns>
        public ModifyResponse ModifyPassword(string username, string password, string newpassword)
        {
            ModifyResponse modifyResponse = new ModifyResponse();

            try
            {
                if (!CheckUtil.CheckAccount(username, password))
                {
                    return((ModifyResponse)CheckUtil.CreateResponse(ResponseCodeEnum.ACCOUNT_ERROR));
                }
                if (string.IsNullOrEmpty(newpassword))
                {
                    return((ModifyResponse)CheckUtil.CreateResponse(ResponseCodeEnum.MODIFY_ERROR));
                }
                modifyResponse.IsSuccess = SmsAccountManage.Instance.UpdatePwd(username, password, newpassword);
                if (modifyResponse.IsSuccess)
                {
                    CacheHelper.Remove(CheckUtil.AcctountCachePre + username);
                }
            }
            catch (Exception exception)
            {
                return((ModifyResponse)CheckUtil.CreateResponse(ResponseCodeEnum.INNER_EXCEPTION, exception.Message));
            }
            return(modifyResponse);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取上行
        /// </summary>
        /// <returns></returns>
        public GetMoResponse GetMoMessage(string username, string password)
        {
            if (!CheckUtil.CheckAccount(username, password))
            {
                return((GetMoResponse)CheckUtil.CreateResponse(ResponseCodeEnum.ACCOUNT_ERROR));
            }
            GetMoResponse response = new GetMoResponse();

            try
            {
                List <SmsMoInfo> smsMos = SmsMOManage.Instance.GetUserMo(username, password);
                response.MoModels = new List <MoModel>();
                foreach (SmsMoInfo mo in smsMos)
                {
                    response.MoModels.Add(new MoModel
                    {
                        Content = mo.Content,
                        Mobile  = mo.Phone,
                        MsgID   = mo.ID,
                        RecTime = mo.ReceiveTime.HasValue ? mo.ReceiveTime.Value : DateTime.Now
                    });
                }
            }
            catch (Exception exception)
            {
                return((GetMoResponse)CheckUtil.CreateResponse(ResponseCodeEnum.INNER_EXCEPTION, exception.Message));
            }

            Console.WriteLine(response.Code);
            return(response);
        }
Ejemplo n.º 3
0
 public PostMsgResponse PostMsgMass(string username, string password, List <string> mobiles, string content, int timeingTime)
 {
     if (!CheckUtil.CheckAccount(username, password))
     {
         return((PostMsgResponse)CheckUtil.CreateResponse(ResponseCodeEnum.ACCOUNT_ERROR));
     }
     return(null);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 充值
 /// </summary>
 /// <returns></returns>
 public ChargeResponse ChargeMoney(string username, string password, double money)
 {
     if (!CheckUtil.CheckAccount(username, password))
     {
         return((ChargeResponse)CheckUtil.CreateResponse(ResponseCodeEnum.ACCOUNT_ERROR));
     }
     return(null);
 }
Ejemplo n.º 5
0
        public PostMsgResponse PostMsgGroup(string username, string password, List <MessageData> messageDatas, int timeingTime)
        {
            if (!CheckUtil.CheckAccount(username, password))
            {
                return((PostMsgResponse)CheckUtil.CreateResponse(ResponseCodeEnum.ACCOUNT_ERROR));
            }
            if (messageDatas.Count == 0)
            {
                return((PostMsgResponse)CheckUtil.CreateResponse(ResponseCodeEnum.ACCOUNT_ERROR));
            }

            return(null);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取账号信息包含余额
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public GetAccountInfoResponse GetAccountBalance(string username, string password)
        {
            if (!CheckUtil.CheckAccount(username, password))
            {
                return((GetAccountInfoResponse)CheckUtil.CreateResponse(ResponseCodeEnum.ACCOUNT_ERROR));
            }
            GetAccountInfoResponse response = new GetAccountInfoResponse();

            try
            {
                SmsAddrecordInfo addRecord = SmsAddRecordManage.Instance.GetAccountInfo(username, password);
                response.AccountInfo       = new AccountModel();
                response.AccountInfo.Mount = addRecord.AfterAdd.HasValue ? addRecord.AfterAdd.Value : 0;
            }
            catch (Exception exception)
            {
                return((GetAccountInfoResponse)CheckUtil.CreateResponse(ResponseCodeEnum.INNER_EXCEPTION, exception.Message));
            }
            return(response);
        }