新增文章目录管理

This commit is contained in:
不做码农
2022-05-13 21:46:27 +08:00
parent 8e24ac205c
commit e8e189b8a8
10 changed files with 666 additions and 85 deletions

View File

@@ -1,17 +1,15 @@
using Infrastructure.Attribute;
using Infrastructure;
using Infrastructure.Attribute;
using Infrastructure.Enums;
using Infrastructure.Model;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model.System;
using ZR.Service.System.IService;
using Infrastructure.Model;
using SqlSugar;
using Mapster;
using ZR.Model.System.Dto;
using Infrastructure.Enums;
using Infrastructure;
using ZR.Admin.WebApi.Extensions;
using System.Reflection;
using System;
using ZR.Service.System.IService;
namespace ZR.Admin.WebApi.Controllers
{
@@ -75,28 +73,6 @@ namespace ZR.Admin.WebApi.Controllers
return SUCCESS(response);
}
/// <summary>
/// 获取文章目录,前端没用到
/// </summary>
/// <returns></returns>
[HttpGet("CategoryList")]
public IActionResult CategoryList()
{
var response = _ArticleCategoryService.GetAll();
return SUCCESS(response);
}
/// <summary>
/// 获取文章目录树
/// </summary>
/// <returns></returns>
[HttpGet("CategoryTreeList")]
public IActionResult CategoryTreeList()
{
var response = _ArticleCategoryService.BuildCategoryTree(_ArticleCategoryService.GetAll());
return SUCCESS(response);
}
/// <summary>
/// 查询文章详情
/// </summary>
@@ -125,7 +101,7 @@ namespace ZR.Admin.WebApi.Controllers
}
//从 Dto 映射到 实体
var addModel = parm.Adapt<Article>().ToCreate(context: HttpContext);
addModel.AuthorName = User.Identity.Name;
addModel.AuthorName = HttpContext.GetName();
return SUCCESS(_ArticleService.Add(addModel));
}