Example #1
0
        //public async Task<IActionResult> OnPostDeleteAsync(string[] ids)
        //{
        //    var entity = await _sysMenuService.GetFullListAsync(_ => ids.Contains(_.Id) && _.IsLocked == false);
        //    var buttons = await _sysButtonService.GetFullListAsync(_ => ids.Contains(_.MenuId));

        //    await _sysButtonService.DeleteAllAsync(buttons);
        //    await _sysMenuService.DeleteAllAsync(entity);
        //    await _sysMenuService.RemoveMenuAsync();
        //    IEnumerable<string> unDeleteIds = ids.Except(entity.Select(_ => _.Id));
        //    return Ok(unDeleteIds);
        //}

        public async Task <IActionResult> OnPostAddArticleAsync(ArticleDto article)
        {
            if (string.IsNullOrEmpty(article.CatalogMark))
            {
                return(Ok("内容标记不能为空", false, "内容标记不能为空"));
            }
            var entity = await _articleService.CreateOrUpdateAsync(article);

            return(Ok(entity.Id));
        }