コード例 #1
0
        public ActionResult GetDocument(string id)
        {
            IWikiDocumentAppService service = this.CreateService <IWikiDocumentAppService>();
            WikiDocumentDetail      doc     = service.GetDocumentDetail(id);

            return(this.SuccessData(doc));
        }
コード例 #2
0
        public ActionResult Document(string id)
        {
            DocumentModel doc = new DocumentModel();

            if (id != null)
            {
                IWikiDocumentAppService service = this.CreateService <IWikiDocumentAppService>();
                WikiDocumentDetail      detail  = service.GetDocumentDetail(id);

                if (detail == null)
                {
                    /* 404 */
                }

                doc.Id           = detail.Id;
                doc.Title        = detail.Title;
                doc.Tag          = detail.Tag;
                doc.Summary      = detail.Summary;
                doc.MarkdownCode = detail.MarkdownCode;
            }

            this.ViewBag.Doc = doc;

            return(View());
        }
コード例 #3
0
        public string Add(AddDocumentInput input)
        {
            input.Validate();

            WikiDocumentDetail detail = AceMapper.Map<WikiDocumentDetail>(input);
            detail.Id = IdHelper.CreateSnowflakeId().ToString();
            detail.IsDeleted = false;
            detail.CreationTime = DateTime.Now;

            this.DbContext.Insert(detail);

            return detail.Id;
        }
コード例 #4
0
ファイル: WikiDocumentAppService.cs プロジェクト: zwq194/Ace
        public string Add(AddDocumentInput input)
        {
            input.Validate();

            WikiDocumentDetail detail = new WikiDocumentDetail();

            detail.Id = IdHelper.CreateSnowflakeId().ToString();

            detail.Title   = input.Title;
            detail.Summary = input.Summary;
            detail.Tag     = input.Tag;

            detail.IsDeleted    = false;
            detail.CreationTime = DateTime.Now;

            detail.HtmlContent  = input.HtmlContent;
            detail.MarkdownCode = input.MarkdownCode;

            this.DbContext.Insert(detail);

            return(detail.Id);
        }
コード例 #5
0
        public ActionResult GetDocument(string id)
        {
            WikiDocumentDetail doc = this.Service.GetDocumentDetail(id);

            return(this.SuccessData(doc));
        }