public async Task <ActionResult> DisabledAsync(int id, [FromForm] string description)
        {
            Domain.Posts.Post post   = Domain.Posts.Hub.GetPost(id);
            Domain.Resp       detail = await post.DisabledAsync(description);

            return(Pack(detail));
        }
        public async Task <IActionResult> BackAsync(int id, [FromBody] Share.SingleContent model)
        {
            Domain.Questions.Question question = Domain.Questions.Hub.GetQuestion(id);
            Domain.Resp resp = await question.BackAsync(model.Content);

            return(Pack(resp));
        }
        public async Task <ActionResult> GetDetailAsync(int id)
        {
            Domain.Posts.Post post   = Domain.Posts.Hub.GetPost(id);
            Domain.Resp       detail = await post.GetDetail();

            return(Pack(detail));
        }
        public async Task <IActionResult> UnLikeAsync(int id)
        {
            Domain.Answers.Answer answer = Domain.Answers.Hub.GetAnswer(id);
            Domain.Resp           r      = await answer.UnLikeAsync();

            return(Pack(r));
        }
        public async Task <IActionResult> GetDetailAsync(int id)
        {
            Paginator pager = Paginator.New(1, 10);

            Domain.Questions.Question question = Domain.Questions.Hub.GetQuestion(id);
            Domain.Resp resp = await question.GetDetailAsync(Domain.Questions.Question.DetailSource.Admin, pager);

            return(Pack(resp));
        }
        public async Task <IActionResult> PostCommentAsync(int id, [FromBody] string comment)
        {
            //  必须登录
            if (CurrentUser.IsEmpty())
            {
                return(Pack(Domain.Resp.NeedLogin()));
            }

            if (string.IsNullOrWhiteSpace(comment))
            {
                return(Pack(Domain.Resp.Fault(Domain.Resp.NONE, "追问不能未空")));
            }

            Domain.Answers.Answer answer = Domain.Answers.Hub.GetAnswer(id);
            Domain.Resp           r      = await answer.AddCommentAsync(CurrentUser.Id, comment);

            return(Pack(r));
        }
        public async Task <IActionResult> ChangePasswordAsync([FromBody] Domain.Clients.Models.ChangePassword model)
        {
            Domain.Resp r = await CurrentUser.ChangePasswordAsync(model);

            return(Pack(r));
        }
        public async Task <IActionResult> ChangeUserNameAsync([FromBody] Domain.Clients.Models.UserModify model)
        {
            Domain.Resp r = await CurrentUser.ChangeUserInfoAsync(model);

            return(Pack(r));
        }