123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 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;
- }
- /// <summary>
- /// 获取小组列表
- /// </summary>
- /// <returns></returns>
- [HttpGet("list")]
- public async Task<IEnumerable<GroupDetailResult>> GetGroupDetailResults([FromQuery]string keyWord)
- {
- return await groupRepository.GetGroupDetailResults(keyWord);
- }
- /// <summary>
- /// 修改小组
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [HttpPost("update")]
- public async Task<bool> Update(GroupUpRequest request)
- {
- return await groupRepository.UpdateAsync(request);
- }
- }
- }
|