using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Admin.Core.Model.Output;
using Admin.Core.Service.Admin.Document;
using Admin.Core.Service.Admin.Document.Input;
namespace Admin.Core.Controllers.Admin
{
///
/// 文档管理
///
public class DocumentController : AreaController
{
private readonly IDocumentService _documentServices;
public DocumentController(IDocumentService documentServices)
{
_documentServices = documentServices;
}
///
/// 查询文档列表
///
///
///
///
///
[HttpGet]
public async Task GetList(string key, DateTime? start, DateTime? end)
{
return await _documentServices.GetListAsync(key,start,end);
}
///
/// 查询单条分组
///
///
///
[HttpGet]
public async Task GetGroup(long id)
{
return await _documentServices.GetGroupAsync(id);
}
///
/// 查询单条菜单
///
///
///
[HttpGet]
public async Task GetMenu(long id)
{
return await _documentServices.GetMenuAsync(id);
}
///
/// 查询单条文档内容
///
///
///
[HttpGet]
public async Task GetContent(long id)
{
return await _documentServices.GetContentAsync(id);
}
///
/// 查询精简文档列表
///
///
[HttpGet]
public async Task GetPlainList()
{
return await _documentServices.GetPlainListAsync();
}
///
/// 新增分组
///
///
///
[HttpPost]
public async Task AddGroup(DocumentAddGroupInput input)
{
return await _documentServices.AddGroupAsync(input);
}
///
/// 新增菜单
///
///
///
[HttpPost]
public async Task AddMenu(DocumentAddMenuInput input)
{
return await _documentServices.AddMenuAsync(input);
}
///
/// 修改分组
///
///
///
[HttpPut]
public async Task UpdateGroup(DocumentUpdateGroupInput input)
{
return await _documentServices.UpdateGroupAsync(input);
}
///
/// 修改菜单
///
///
///
[HttpPut]
public async Task UpdateMenu(DocumentUpdateMenuInput input)
{
return await _documentServices.UpdateMenuAsync(input);
}
///
/// 修改文档内容
///
///
///
[HttpPut]
public async Task UpdateContent(DocumentUpdateContentInput input)
{
return await _documentServices.UpdateContentAsync(input);
}
///
/// 删除文档
///
///
///
[HttpDelete]
public async Task SoftDelete(long id)
{
return await _documentServices.SoftDeleteAsync(id);
}
}
}