Compare commits
No commits in common. "6876b623ac6d162139d09e7d201a3c3d484811d4" and "08efea943cd6e1b690072edf8839a28064e2b0f5" have entirely different histories.
6876b623ac
...
08efea943c
@ -18,8 +18,8 @@ namespace API.Controllers
|
|||||||
where TService : ServiceBase<TService, TDTO, TModel, TAuditModel, TAuthentication>
|
where TService : ServiceBase<TService, TDTO, TModel, TAuditModel, TAuthentication>
|
||||||
{
|
{
|
||||||
public readonly ILogger<TLoggerCategory> Logger;
|
public readonly ILogger<TLoggerCategory> Logger;
|
||||||
public readonly TService Service;
|
|
||||||
public readonly UserService UserService;
|
public readonly UserService UserService;
|
||||||
|
public readonly TService Service;
|
||||||
|
|
||||||
public CRUDBase(ILogger<TLoggerCategory> logger, UserService userService, TService service)
|
public CRUDBase(ILogger<TLoggerCategory> logger, UserService userService, TService service)
|
||||||
{
|
{
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
using API.Authentication.Interfaces;
|
|
||||||
using API.DTO.Base;
|
|
||||||
using API.DTO.Base.Update;
|
|
||||||
using API.Services;
|
|
||||||
using DAL.Models;
|
|
||||||
using DAL.Models.Audits;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace API.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
[Route("api/v1/[controller]")]
|
|
||||||
public class EventController : CRUDBase<EventController, EventDTO, EventUpdateDTO, Event, AuditEvent, IYesAuthentication, EventService>
|
|
||||||
{
|
|
||||||
public EventController(ILogger<EventController> logger, UserService userService, EventService service) : base(logger, userService, service)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using API.Authentication.Interfaces;
|
|
||||||
using API.DTO.Base;
|
|
||||||
using API.DTO.Base.Update;
|
|
||||||
using API.Services;
|
|
||||||
using DAL.Models;
|
|
||||||
using DAL.Models.Audits;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace API.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
[Route("api/v1/[controller]")]
|
|
||||||
public class GrantController : CRUDBase<GrantController, GrantDTO, GrantUpdateDTO, Grant, AuditGrant, IYesAuthentication, GrantService>
|
|
||||||
{
|
|
||||||
public GrantController(ILogger<GrantController> logger, UserService userService, GrantService service) : base(logger, userService, service)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using API.Authentication.Interfaces;
|
|
||||||
using API.DTO.Base;
|
|
||||||
using API.DTO.Base.Update;
|
|
||||||
using API.Services;
|
|
||||||
using DAL.Models;
|
|
||||||
using DAL.Models.Audits;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace API.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
[Route("api/v1/[controller]")]
|
|
||||||
public class ImageController : CRUDBase<ImageController, ImageDTO, ImageUpdateDTO, Image, AuditImage, IYesAuthentication, ImageService>
|
|
||||||
{
|
|
||||||
public ImageController(ILogger<ImageController> logger, UserService userService, ImageService service) : base(logger, userService, service)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using API.Authentication.Interfaces;
|
|
||||||
using API.DTO.Base;
|
|
||||||
using API.DTO.Base.Update;
|
|
||||||
using API.Services;
|
|
||||||
using DAL.Models;
|
|
||||||
using DAL.Models.Audits;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace API.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
[Route("api/v1/[controller]")]
|
|
||||||
public class PermissionController : CRUDBase<PermissionController, PermissionDTO, PermissionUpdateDTO, Permission, AuditPermission, IYesAuthentication, PermissionService>
|
|
||||||
{
|
|
||||||
public PermissionController(ILogger<PermissionController> logger, UserService userService, PermissionService service) : base(logger, userService, service)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using API.Authentication.Interfaces;
|
|
||||||
using API.DTO.Base;
|
|
||||||
using API.DTO.Base.Update;
|
|
||||||
using API.Services;
|
|
||||||
using DAL.Models;
|
|
||||||
using DAL.Models.Audits;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace API.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
[Route("api/v1/[controller]")]
|
|
||||||
public class SavedEventController : CRUDBase<SavedEventController, SavedEventDTO, SavedEventUpdateDTO, SavedEvent, AuditSavedEvent, IYesAuthentication, SavedEventService>
|
|
||||||
{
|
|
||||||
public SavedEventController(ILogger<SavedEventController> logger, UserService userService, SavedEventService service) : base(logger, userService, service)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using API.Authentication.Interfaces;
|
|
||||||
using API.DTO.Base;
|
|
||||||
using API.DTO.Base.Update;
|
|
||||||
using API.Services;
|
|
||||||
using DAL.Models;
|
|
||||||
using DAL.Models.Audits;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace API.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
[Route("api/v1/[controller]")]
|
|
||||||
public class UserController : CRUDBase<UserController, UserDTO, UserUpdateDTO, User, AuditUser, IYesAuthentication, UserService>
|
|
||||||
{
|
|
||||||
public UserController(ILogger<UserController> logger, UserService userService, UserService service) : base(logger, userService, service)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,9 +23,7 @@ namespace API.DTO.Base
|
|||||||
red = red,
|
red = red,
|
||||||
blue = blue,
|
blue = blue,
|
||||||
green = green,
|
green = green,
|
||||||
name = name,
|
name = name
|
||||||
updated = updated,
|
|
||||||
updater = updater
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public void adaptFromModel(in Color model)
|
public void adaptFromModel(in Color model)
|
||||||
@ -35,8 +33,6 @@ namespace API.DTO.Base
|
|||||||
blue = model.blue;
|
blue = model.blue;
|
||||||
green = model.green;
|
green = model.green;
|
||||||
name = model.name;
|
name = model.name;
|
||||||
updated = model.updated;
|
|
||||||
updater = model.updater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ namespace API.DTO.Base
|
|||||||
public ulong savedEventId { get; set; }
|
public ulong savedEventId { get; set; }
|
||||||
|
|
||||||
[MaxLength(64)]
|
[MaxLength(64)]
|
||||||
public string? name { get; set; }
|
public string? name { get; set; } = null!;
|
||||||
|
|
||||||
public ulong? bgColorId { get; set; }
|
public ulong? bgColorId { get; set; }
|
||||||
public ulong? fgColorId { get; set; }
|
public ulong? fgColorId { get; set; }
|
||||||
@ -35,15 +35,7 @@ namespace API.DTO.Base
|
|||||||
}
|
}
|
||||||
public void adaptFromModel(in Event model)
|
public void adaptFromModel(in Event model)
|
||||||
{
|
{
|
||||||
id = model.id;
|
throw new NotImplementedException();
|
||||||
savedEventId = model.savedEventId;
|
|
||||||
name = model.name;
|
|
||||||
bgColorId = model.bgColorId;
|
|
||||||
fgColorId = model.fgColorId;
|
|
||||||
imageId = model.imageId;
|
|
||||||
hidden = model.hidden;
|
|
||||||
updated = model.updated;
|
|
||||||
updater = model.updater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,11 +29,7 @@ namespace API.DTO.Base
|
|||||||
}
|
}
|
||||||
public void adaptFromModel(in Grant model)
|
public void adaptFromModel(in Grant model)
|
||||||
{
|
{
|
||||||
id = model.id;
|
throw new NotImplementedException();
|
||||||
name = model.name;
|
|
||||||
permissionId = model.permissionId;
|
|
||||||
updated = model.updated;
|
|
||||||
updater = model.updater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,7 @@ namespace API.DTO.Base
|
|||||||
}
|
}
|
||||||
public void adaptFromModel(in Image model)
|
public void adaptFromModel(in Image model)
|
||||||
{
|
{
|
||||||
id = model.id;
|
throw new NotImplementedException();
|
||||||
name = model.name;
|
|
||||||
filename = model.filename;
|
|
||||||
updated = model.updated;
|
|
||||||
updater = model.updater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,7 @@ namespace API.DTO.Base
|
|||||||
}
|
}
|
||||||
public void adaptFromModel(in Permission model)
|
public void adaptFromModel(in Permission model)
|
||||||
{
|
{
|
||||||
id = model.id;
|
throw new NotImplementedException();
|
||||||
name = model.name;
|
|
||||||
updated = model.updated;
|
|
||||||
updater = model.updater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,13 +35,7 @@ namespace API.DTO.Base
|
|||||||
}
|
}
|
||||||
public void adaptFromModel(in SavedEvent model)
|
public void adaptFromModel(in SavedEvent model)
|
||||||
{
|
{
|
||||||
id = model.id;
|
throw new NotImplementedException();
|
||||||
name = model.name;
|
|
||||||
bgColorId = model.bgColorId;
|
|
||||||
fgColorId = model.fgColorId;
|
|
||||||
imageId = model.imageId;
|
|
||||||
updated = model.updated;
|
|
||||||
updater = model.updater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
using DAL.Models;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace API.DTO.Base.Update
|
|
||||||
{
|
|
||||||
public class EventUpdateDTO : IUpdateAdaptable<Event>
|
|
||||||
{
|
|
||||||
public ulong? savedEventId { get; set; }
|
|
||||||
|
|
||||||
[MaxLength(64)]
|
|
||||||
public UnSettable<string?>? name { get; set; }
|
|
||||||
|
|
||||||
public UnSettable<ulong?>? bgColorId { get; set; }
|
|
||||||
public UnSettable<ulong?>? fgColorId { get; set; }
|
|
||||||
public UnSettable<ulong?>? imageId { get; set; }
|
|
||||||
public bool? hidden { get; set; }
|
|
||||||
|
|
||||||
public void adaptModel(ref Event model)
|
|
||||||
{
|
|
||||||
if (savedEventId != null) model.savedEventId = (ulong)savedEventId;
|
|
||||||
if (name != null) model.name = ((UnSettable<string?>)name).value;
|
|
||||||
if (bgColorId != null) model.bgColorId = bgColorId.Value.value;
|
|
||||||
if (fgColorId != null) model.bgColorId = fgColorId.Value.value;
|
|
||||||
if (imageId != null) model.imageId = imageId.Value.value;
|
|
||||||
if (hidden != null) model.hidden = (bool)hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using DAL.Models;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace API.DTO.Base.Update
|
|
||||||
{
|
|
||||||
public class GrantUpdateDTO : IUpdateAdaptable<Grant>
|
|
||||||
{
|
|
||||||
[MaxLength(128)]
|
|
||||||
public string? name { get; set; }
|
|
||||||
|
|
||||||
public ulong? permissionId { get; set; }
|
|
||||||
|
|
||||||
public void adaptModel(ref Grant model)
|
|
||||||
{
|
|
||||||
if (name != null) model.name = name;
|
|
||||||
if (permissionId != null) model.permissionId = (ulong)permissionId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
using DAL.Models;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace API.DTO.Base.Update
|
|
||||||
{
|
|
||||||
public class ImageUpdateDTO : IUpdateAdaptable<Image>
|
|
||||||
{
|
|
||||||
[MaxLength(64)]
|
|
||||||
public string? name { get; set; }
|
|
||||||
|
|
||||||
[MaxLength(128)]
|
|
||||||
public string? filename { get; set; }
|
|
||||||
|
|
||||||
public void adaptModel(ref Image model)
|
|
||||||
{
|
|
||||||
if (name != null) model.name = name;
|
|
||||||
if (filename != null) model.filename = filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using DAL.Models;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace API.DTO.Base.Update
|
|
||||||
{
|
|
||||||
public class PermissionUpdateDTO : IUpdateAdaptable<Permission>
|
|
||||||
{
|
|
||||||
[MaxLength(64)]
|
|
||||||
public string? name { get; set; }
|
|
||||||
|
|
||||||
public void adaptModel(ref Permission model)
|
|
||||||
{
|
|
||||||
if (name != null) model.name = name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
using DAL.Models;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace API.DTO.Base.Update
|
|
||||||
{
|
|
||||||
public class SavedEventUpdateDTO : IUpdateAdaptable<SavedEvent>
|
|
||||||
{
|
|
||||||
[MaxLength(64)]
|
|
||||||
public string? name { get; set; }
|
|
||||||
|
|
||||||
public ulong? bgColorId { get; set; }
|
|
||||||
|
|
||||||
public ulong? fgColorId { get; set; }
|
|
||||||
|
|
||||||
public UnSettable<ulong?>? imageId { get; set; }
|
|
||||||
|
|
||||||
public void adaptModel(ref SavedEvent model)
|
|
||||||
{
|
|
||||||
if (name != null) model.name = name;
|
|
||||||
if (bgColorId != null) model.bgColorId = (ulong)bgColorId;
|
|
||||||
if (fgColorId != null) model.fgColorId = (ulong)fgColorId;
|
|
||||||
if (imageId != null) model.imageId = imageId.Value.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
using DAL.Models;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace API.DTO.Base.Update
|
|
||||||
{
|
|
||||||
public class UserUpdateDTO : IUpdateAdaptable<User>
|
|
||||||
{
|
|
||||||
[MaxLength(64)]
|
|
||||||
public string? firstName { get; set; }
|
|
||||||
|
|
||||||
[MaxLength(64)]
|
|
||||||
public string? lastName { get; set; }
|
|
||||||
|
|
||||||
public ulong? phoneNumber { get; set; }
|
|
||||||
|
|
||||||
public ulong? permissionId { get; set; }
|
|
||||||
|
|
||||||
public void adaptModel(ref User model)
|
|
||||||
{
|
|
||||||
if (firstName != null) model.firstName = firstName;
|
|
||||||
if (lastName != null) model.lastName = lastName;
|
|
||||||
if (phoneNumber != null) model.phoneNumber = (ulong)phoneNumber;
|
|
||||||
if (permissionId != null) model.permissionId = (ulong)permissionId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -36,13 +36,7 @@ namespace API.DTO.Base
|
|||||||
}
|
}
|
||||||
public void adaptFromModel(in User model)
|
public void adaptFromModel(in User model)
|
||||||
{
|
{
|
||||||
id = model.id;
|
throw new NotImplementedException();
|
||||||
firstName = model.firstName;
|
|
||||||
lastName = model.lastName;
|
|
||||||
phoneNumber = model.phoneNumber;
|
|
||||||
permissionId = model.permissionId;
|
|
||||||
updated = model.updated;
|
|
||||||
updater = model.updater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
namespace API.DTO
|
|
||||||
{
|
|
||||||
public struct UnSettable<T>
|
|
||||||
{
|
|
||||||
public T value { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user