public ApiResult <PagedList <ShareOrder> > GetList([FromQuery] ApiBaseInput parameter)
        {
            //接口还未调试,以及参数
            var pageList = Resolve <IShareOrderService>().GetPagedList(parameter.ToJson());

            return(ApiResult.Success(pageList));
        }
Example #2
0
        public ApiResult <RewardApiOutput> Show([FromQuery] ApiBaseInput parameter)
        {
            if (parameter.EntityId.ConvertToLong() <= 0)
            {
                return(ApiResult.Failure <RewardApiOutput>("输入参数不合法!"));
            }

            var model      = new RewardApiOutput();
            var rewardView = Resolve <IRewardService>().GetRewardView(parameter.EntityId.ConvertToLong());

            if (rewardView == null)
            {
                return(ApiResult.Failure <RewardApiOutput>("该分润记录不存在!"));
            }

            model.Reward = rewardView.Reward;
            var userOutput = AutoMapping.SetValue <UserOutput>(rewardView.OrderUser);

            userOutput.GradeName = Resolve <IGradeService>().GetGrade(rewardView.OrderUser.GradeId)?.Name;
            userOutput.Status    = rewardView.OrderUser.Status.GetDisplayName();
            userOutput.UserName  = rewardView.OrderUser.GetUserName();
            userOutput.Avator    = Resolve <IApiService>().ApiUserAvator(rewardView.OrderUser.Id);
            model.OrderUser      = userOutput;

            model.MoneyTypeName = Resolve <IAutoConfigService>().MoneyTypes()
                                  .First(r => r.Id == rewardView.Reward.MoneyTypeId).Name;
            return(ApiResult.Success(model));
        }
Example #3
0
        public ApiResult <IList <AccountOutput> > AllAccounts([FromQuery] ApiBaseInput parameter)
        {
            var httpss = HttpContext.Request.QueryString;
            var model  = Resolve <IAccountService>().GetUserAllAccount(parameter.LoginUserId);
            var moneys = Resolve <IAutoConfigService>().MoneyTypes();
            IList <AccountOutput> result = new List <AccountOutput>();

            foreach (var item in model)
            {
                var config = moneys.FirstOrDefault(r =>
                                                   r.Id == item.MoneyTypeId && r.IsShowFront && r.Status == Status.Normal);
                if (config != null)
                {
                    var apiOutput = new AccountOutput
                    {
                        MoneyTypeName = config.Name,
                        Amount        = item.Amount,
                        MoneyTypeId   = item.MoneyTypeId
                    };
                    result.Add(apiOutput);
                }
            }

            return(ApiResult.Success(result));
        }
Example #4
0
        /// <summary>
        ///     获取虚拟订货商品列表
        /// </summary>
        /// <param name="parameter">参数</param>
        public ProductItemApiOutput GetProductItems(ApiBaseInput parameter)
        {
            var productApiInput = new ProductApiInput
            {
                ProductIds = GetAllProductIds().JoinToString(",")
            };
            var result = Resolve <IProductService>().GetProductItems(productApiInput);

            return(result);
        }
Example #5
0
        public void GetProductItems_ApiBaseInput_test()
        {
            var parameter = new ApiBaseInput();
            var result    = Resolve <IGroupBuyService>().GetProductItems(parameter);

            Assert.NotNull(result);
            var activitys = Resolve <IActivityService>().GetList(r => r.Key == typeof(GroupBuyActivity).FullName);

            if (activitys.Count() > 0)
            {
                Assert.True(result.ProductItems.Count() > 0);
            }
        }
Example #6
0
        public ApiResult <UserOutput> View([FromQuery] ApiBaseInput parameter)
        {
            var userOutPut = Resolve <IUserDetailService>().GetUserOutput(parameter.LoginUserId.ConvertToLong());

            if (userOutPut == null)
            {
                return(ApiResult.Failure <UserOutput>("用户不存在或者已经删除!"));
            }

            if (!(userOutPut.ParentId == parameter.LoginUserId || userOutPut.Id == parameter.LoginUserId))
            {
                return(ApiResult.Failure <UserOutput>("对不起您无权查看!"));
            }

            return(ApiResult.Success(userOutPut));
        }
Example #7
0
        public ApiResult <AutoForm> GetIdentity([FromQuery] ApiBaseInput parameter)
        {
            var model  = Resolve <IIdentityService>().GetSingle(parameter.LoginUserId);
            var result = new AutoForm();

            if (model != null)
            {
                if (model.Status == IdentityStatus.Succeed)
                {
                    result.FromMessage.Type    = FromMessageType.Success;
                    result.FromMessage.Message = "您已完成实名认证!";
                    return(ApiResult.Success(result));
                }

                if (model.Status == IdentityStatus.Failed)
                {
                    result.FromMessage.Type    = FromMessageType.Success;
                    result.FromMessage.Message = "您的实名认证失败,请再次尝试!";
                    return(ApiResult.Success(result));
                }
            }

            return(ApiResult.Success(result));
        }
Example #8
0
        public ApiResult <ProductItemApiOutput> Products([FromQuery] ApiBaseInput parameter)
        {
            var apiOutput = Resolve <IGroupBuyService>().GetProductItems(parameter);

            return(ApiResult.Success(apiOutput));
        }