using System.Collections.Generic; using System.Threading.Tasks; using GxPress.Common.Page; using GxPress.Repository.Interface.SystemLabel; using GxPress.Request.SystemLabel; using GxPress.Result.SystemLabel; using GxPress.Service.Interface.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; private readonly ISystemLableMediaRepository systemLableMediaRepository; private readonly ISystemLabelService systemLabelService; public AdminSystemLabelController(ISystemLabelRepository repository, ISystemLabelService systemLabelService, ISystemLableMediaRepository systemLableMediaRepository) { _repository = repository; this.systemLabelService = systemLabelService; this.systemLableMediaRepository = systemLableMediaRepository; } /// /// 添加 /// /// /// [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); } /// /// 获取标签列表 /// /// [HttpPost("list")] public async Task> GetAllAsync(Common.Page.PageParameter pageParameter) { return await systemLabelService.GetAllAsync(pageParameter); } /// /// 删除 /// /// /// [HttpDelete("{id}")] public async Task DeleteAsync(int id) { return await _repository.DeleteAsync(id); } /// /// 添加标签媒体 /// /// /// [HttpPost("add")] public async Task InsertAsync(SystemLableMediaRequest request) { return await systemLableMediaRepository.InsertAsync(request); } } }