예제 #1
0
 private void Initialize(ApiClientCustomerActivateContext context)
 {
     //if (context.OverrideAppId > 0)
     //{
     //    context.Request.AppId = context.OverrideAppId;
     //}
     //else
     //{
     //    context.Request.AppId = context.Request.CallContext.App.AppId;
     //}
 }
예제 #2
0
        public override async Task RunAsync(ApiClientCustomerActivateContext context)
        {
            Initialize(context);

            await ExecuteNonQueryAsync(context);

            if (context.Response.Success && context.Response.ApiClientCustomerId > 0)
            {
                var store = this.Store as ApiClientCustomerStrategyStore;
                var ctx   = store.GetByPK.CreateContextBy(context);

                ctx.Request.Id = context.Response.ApiClientCustomerId;
                await store.GetByPK.RunAsync(ctx);

                Finalize(context, ctx);
            }
            // return ExecuteNonQueryAsync(context, Func<CustomerActivateRequest, string> keySpecifier);
        }
예제 #3
0
        private void Finalize(ApiClientCustomerActivateContext context, ApiClientCustomerGetByPKContext ctx)
        {
            context.Request.CallContext.Customer = ctx.Response.Data;

            if (ctx.Response.Success && ctx.Response.Data != null)
            {
                context.Response.Data = new ApiClientCustomerActivateResponseData();

                context.Response.Data.AccessToken    = ctx.Response.Data.AccessToken;
                context.Response.Data.RefreshToken   = ctx.Response.Data.RefreshToken;
                context.Response.Data.EncryptionCode = ctx.Response.Data.EncryptionCode;
                context.Response.Data.LifeLength     = ctx.Response.Data.LifeLength;

                Service.CacheRemove(context);

                context.Request.CallContext.Customer.EncryptionCode.Value = context.Response.OldEncryptionCode;
            }
        }