using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Entity;
using GxPress.Entity.WorkProcess;
using GxPress.Repository.Interface;
using GxPress.Repository.Interface.WorkProcess;
using GxPress.Request.ProcessGroup;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace GxPress.Api.AdminControllers
{
///
/// 审批流程组
///
[Route("api/admin/processGroup")]
[ApiController]
[Authorize]
public class AdminProcessGroupController : Controller
{
private readonly IProcessGroupRepository _processGroupRepository;
public AdminProcessGroupController(IProcessGroupRepository processGroupRepository)
{
_processGroupRepository = processGroupRepository;
}
///
/// 添加
///
///
///
[HttpPost]
public async Task Add([FromBody] ArticleGroupAddRequest request)
{
return await _processGroupRepository.AddAsync(request);
}
///
/// 列表
///
///
[HttpGet("list")]
public async Task> GetList()
{
return await _processGroupRepository.GetListAsync();
}
///
/// 修改
///
///
///
///
[HttpPut("{id}")]
public async Task Update(int id, [FromBody]ArticleGroupAddRequest request)
{
return await _processGroupRepository.UpdateAsync(id, request);
}
///
/// 删除
///
///
///
[HttpDelete("{id}")]
public async Task Delete(int id)
{
return await _processGroupRepository.DeleteAsync(id);
}
}
}