mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Rename Index calls to get or getall
This commit is contained in:
@@ -19,7 +19,7 @@ public class GroupsController : Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("Get")]
|
[HttpGet("Get")]
|
||||||
public async Task<GroupsGetResponseModel> GetAsync(GroupsIndexRequestModel model)
|
public async Task<GroupsGetResponseModel> GetAsync(GroupsGetRequestModel model)
|
||||||
{
|
{
|
||||||
if (model is null)
|
if (model is null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,18 +19,18 @@ public class LocationsController : Controller
|
|||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("Index")]
|
[HttpGet("GetAll")]
|
||||||
public async Task<LocationsIndexResponseModel> Index()
|
public async Task<LocationsGetAllResponseModel> GetAll()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IEnumerable<LocationModel> list = await _ldap.ListLocationsAsync();
|
IEnumerable<LocationModel> list = await _ldap.ListLocationsAsync();
|
||||||
return new LocationsIndexResponseModel { Locations = list };
|
return new LocationsGetAllResponseModel { Locations = list };
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError("Unable to list locations: {Message} - {StackTrace}", ex.Message, ex.StackTrace);
|
_logger.LogError("Unable to list locations: {Message} - {StackTrace}", ex.Message, ex.StackTrace);
|
||||||
return new LocationsIndexResponseModel { Locations = [] };
|
return new LocationsGetAllResponseModel { Locations = [] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ public class UsersController : Controller
|
|||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("Index")]
|
[HttpGet("GetAll")]
|
||||||
public async Task<IEnumerable<UserModel>> Index(UsersIndexRequestModel requestModel)
|
public async Task<IEnumerable<UserModel>> GetAll(UsersGetAllRequestModel requestModel)
|
||||||
{
|
{
|
||||||
string? uid = requestModel.Uid;
|
string? uid = requestModel.Uid;
|
||||||
List<string> attributes = ["cn", "sn", "title", "uid", "jpegPhoto", "userPassword", "description"];
|
List<string> attributes = ["cn", "sn", "title", "uid", "jpegPhoto", "userPassword", "description"];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace Berufsschule_HAM.Models;
|
namespace Berufsschule_HAM.Models;
|
||||||
|
|
||||||
public class GroupsIndexRequestModel
|
public class GroupsGetRequestModel
|
||||||
{
|
{
|
||||||
public string? Cn { get; set; }
|
public string? Cn { get; set; }
|
||||||
public bool GidNumber { get; set; } = true;
|
public bool GidNumber { get; set; } = true;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class LocationsDeleteResponseModel(bool successful, string exception = "N
|
|||||||
public string? Exception { get; set; } = exception;
|
public string? Exception { get; set; } = exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LocationsIndexResponseModel
|
public class LocationsGetAllResponseModel
|
||||||
{
|
{
|
||||||
public required IEnumerable<LocationModel> Locations { get; set; }
|
public required IEnumerable<LocationModel> Locations { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace Berufsschule_HAM.Models;
|
namespace Berufsschule_HAM.Models;
|
||||||
|
|
||||||
public class UsersIndexRequestModel
|
public class UsersGetAllRequestModel
|
||||||
{
|
{
|
||||||
public string? Uid { get; set; } = null;
|
public string? Uid { get; set; } = null;
|
||||||
public bool Cn { get; set; } = true;
|
public bool Cn { get; set; } = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user