using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Repository.Interface;
using GxPress.Request.App.Group;
using GxPress.Result.App.Group;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace GxPress.Api.AdminControllers
{
[Route("api/admin/group")]
[ApiController]
[Authorize]
public class AdminGroupController : Controller
{
private readonly IGroupRepository groupRepository;
public AdminGroupController(IGroupRepository groupRepository)
{
this.groupRepository = groupRepository;
}
///
/// 获取小组列表
///
///
[HttpGet("list")]
public async Task> GetGroupDetailResults([FromQuery]string keyWord)
{
return await groupRepository.GetGroupDetailResults(keyWord);
}
///
/// 修改小组
///
///
///
[HttpPost("update")]
public async Task Update(GroupUpRequest request)
{
return await groupRepository.UpdateAsync(request);
}
}
}