添加项目文件。

This commit is contained in:
2026-05-09 17:06:30 +08:00
parent c60f5fe117
commit 720ef957d4
378 changed files with 14843 additions and 0 deletions
@@ -0,0 +1,42 @@
using GroupService.Infrastructure;
using GroupService.WebApi.Application.GroupMember;
using IM.ASPNETCore;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
namespace GroupService.WebApi.Controllers.GroupMember
{
[Route("api/[controller]/[action]")]
[ApiController]
public class GroupMemberController : ControllerBase
{
private readonly GroupMemberService service;
public GroupMemberController(GroupMemberService service)
{
this.service = service;
}
[HttpGet]
public async Task<IActionResult> CheckMember(Guid userId, Guid groupId)
{
return Ok(await service.CheckMemberAsync(groupId, userId));
}
[HttpGet]
public async Task<IActionResult> List(Guid groupId)
{
return Ok(await service.GetByGroupIdAsync(groupId));
}
[HttpPost]
[UnitOfWork(typeof(GroupDbContext))]
public async Task<IActionResult> Delete([FromQuery] Guid memberId)
{
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
return Ok(await service.DeleteAsync(memberId, Guid.Parse(userId)));
}
}
}