using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Repository.Interface.SystemLabel;
using GxPress.Request.SystemLabel;
using GxPress.Result.SystemLabel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace GxPress.Api.AdminControllers
{
///
/// 系统标签管理
///
[Route("api/admin/system-label")]
[ApiController]
[Authorize]
public class AdminSystemLabelController : ControllerBase
{
private readonly ISystemLabelRepository _repository;
public AdminSystemLabelController(ISystemLabelRepository repository)
{
_repository = repository;
}
///
/// 添加
///
///
///
[HttpPost]
public async Task Insert(Entity.SystemLabel.SystemLabel note)
{
return await _repository.InsertAsync(note);
}
///
/// 修改
///
///
///
[HttpPut]
public async Task UpdateAsync(SystemLabelUpRequest request)
{
return await _repository.UpdateAsync(request);
}
///
/// 获取标签列表
///
///
[HttpGet]
public async Task> GetAllAsync()
{
return await _repository.GetAllAsync();
}
///
/// 删除
///
///
///
[HttpDelete("{id}")]
public async Task DeleteAsync(int id)
{
return await _repository.DeleteAsync(id);
}
}
}