Ejemplo n.º 1
0
        ////计费
        //private Func<Parameter, Task<ValidationResult>> Charging()
        //{
        //    return async m =>
        //    {
        //        var appinfo = _appService.GetApp(m.Appkey);
        //        await _redisHelper.StringIncrementAsync(RedisKeyName.CreateUserAmountKey(appinfo.UserId), -1);
        //        await _mediator.Send(m);
        //        return ValidationResult.Success;
        //    };
        //}

        private bool VerifTimeStamp(string timetamp)
        {
            var pastTime = TimeStamp.GetLocalDateTimeSeconds(timetamp);
            var st       = DateTime.Now - pastTime;

            return(st.TotalSeconds < 120);
        }
Ejemplo n.º 2
0
 private static void CreateCompleteCommand(Params @params, string nonce, DateTimeOffset dateTime, AppDto appInfo, RespResult respResult, SendCompleteCommand cmd)
 {
     cmd.AppKey          = @params.AppKey;
     cmd.UserId          = appInfo.UserId;
     cmd.Mobile          = respResult.result == null ? "" : respResult.result[ResponseDicKey.Mobile];
     cmd.ReceiveTime     = dateTime.LocalDateTime;
     cmd.UserTimeStamp   = TimeStamp.GetLocalDateTimeSeconds(@params.TimeStamp);
     cmd.UserNonce       = @params.Nonce;
     cmd.Result          = Convert.ToInt32(respResult.success);
     cmd.SendSuccessTime = DateTime.Now;
     cmd.Nonce           = nonce;
     cmd.CreateDate      = DateTime.Now;
     cmd.OperatorType    = respResult.result == null ? "" : respResult.result[ResponseDicKey.OperatorType];
     cmd.Description     = respResult.errorMsg;
     cmd.SalesMan        = appInfo.SalesMan;
     cmd.Signature       = appInfo.Signature;
 }