using DigitalData.Core.API; using DigitalData.UserManager.Application.Contracts; using DigitalData.UserManager.Application.DTOs.User; using DigitalData.UserManager.Domain.Entities; using DigitalData.UserManager.Infrastructure.Contracts; using Microsoft.AspNetCore.Mvc; namespace DigitalData.UserManager.API.Controllers { public class UserController : CRUDControllerBase { public UserController(ILogger logger, IUserService service) : base(logger, service) { } [HttpGet("ByModuleId/{moduleId}")] public async Task GetByModuleId([FromRoute] int moduleId, [FromQuery]bool assigned = true) { var result = assigned ? await _service.ReadByModuleIdAsync(moduleId) : await _service.ReadUnassignedByModuleIdAsync(moduleId); return Ok(result); } [HttpGet("ByGroupId/{groupId}")] public async Task GetByGroupId([FromRoute] int groupId, [FromQuery] bool assigned = true) { var result = assigned ? await _service.ReadByGroupIdAsync(groupId) : await _service.ReadUnassignedByGroupIdAsync(groupId); ; return Ok(result); } } }