Add services and controllers for games (#12)
Co-authored-by: Maxime Adler <madler@sqli.com> Reviewed-on: #12
This commit was merged in pull request #12.
This commit is contained in:
7
src/GameIdeas/GameIdeas.Shared/Dto/DeveloperDto.cs
Normal file
7
src/GameIdeas/GameIdeas.Shared/Dto/DeveloperDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class DeveloperDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
@@ -2,6 +2,21 @@
|
||||
|
||||
public class GameDto
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public string? ReleaseDate { get; set; }
|
||||
public int? Id { get; set; }
|
||||
public string? Title { get; set; }
|
||||
public DateTime? ReleaseDate { get; set; }
|
||||
public DateTime? CreationDate { get; set; }
|
||||
public UserDto? CreationUser { get; set; }
|
||||
public int? CreationUserId { get; set; }
|
||||
public DateTime? ModificationDate { get; set; }
|
||||
public UserDto? ModificationUser { get; set; }
|
||||
public int? ModificationUserId { get; set; }
|
||||
public double? StorageSpace { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public int? Interest { get; set; }
|
||||
public IEnumerable<PlatformDto>? Platforms { get; set; }
|
||||
public IEnumerable<PropertyDto>? Properties { get; set; }
|
||||
public IEnumerable<TagDto>? Tags { get; set; }
|
||||
public IEnumerable<PublisherDto>? Publishers { get; set; }
|
||||
public IEnumerable<DeveloperDto>? Developers { get; set; }
|
||||
}
|
||||
16
src/GameIdeas/GameIdeas.Shared/Dto/GameFilterDto.cs
Normal file
16
src/GameIdeas/GameIdeas.Shared/Dto/GameFilterDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class GameFilterDto
|
||||
{
|
||||
public IEnumerable<string>? Platforms { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public IEnumerable<string>? Tags { get; set; }
|
||||
public IEnumerable<string>? Properties { get; set; }
|
||||
public int? MinInterest { get; set; }
|
||||
public int? MaxInterest { get; set; }
|
||||
public IEnumerable<int>? ReleaseYears { get; set; }
|
||||
public IEnumerable<int>? PublisherIds { get; set; }
|
||||
public IEnumerable<int>? DeveloperIds { get; set; }
|
||||
public IEnumerable<int>? CreationUserIds { get; set; }
|
||||
public IEnumerable<int>? ModificationUserIds { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
using GameIdeas.Shared.Enum;
|
||||
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class LoginDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Username { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public Role? Role { get; set; }
|
||||
}
|
||||
|
||||
7
src/GameIdeas/GameIdeas.Shared/Dto/PaggingDto.cs
Normal file
7
src/GameIdeas/GameIdeas.Shared/Dto/PaggingDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class PaggingDto
|
||||
{
|
||||
public int CurrentPage { get; set; }
|
||||
public int NumberPerPage { get; set; }
|
||||
}
|
||||
8
src/GameIdeas/GameIdeas.Shared/Dto/PlatformDto.cs
Normal file
8
src/GameIdeas/GameIdeas.Shared/Dto/PlatformDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class PlatformDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Label { get; set; }
|
||||
public string? Url { get; set; }
|
||||
}
|
||||
7
src/GameIdeas/GameIdeas.Shared/Dto/PropertyDto.cs
Normal file
7
src/GameIdeas/GameIdeas.Shared/Dto/PropertyDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class PropertyDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Label { get; set; }
|
||||
}
|
||||
7
src/GameIdeas/GameIdeas.Shared/Dto/PublisherDto.cs
Normal file
7
src/GameIdeas/GameIdeas.Shared/Dto/PublisherDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class PublisherDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
8
src/GameIdeas/GameIdeas.Shared/Dto/TagDto.cs
Normal file
8
src/GameIdeas/GameIdeas.Shared/Dto/TagDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class TagDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Label { get; set; }
|
||||
}
|
||||
11
src/GameIdeas/GameIdeas.Shared/Dto/UserDto.cs
Normal file
11
src/GameIdeas/GameIdeas.Shared/Dto/UserDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using GameIdeas.Shared.Enum;
|
||||
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Username { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public Role? Role { get; set; }
|
||||
}
|
||||
8
src/GameIdeas/GameIdeas.Shared/Enum/Role.cs
Normal file
8
src/GameIdeas/GameIdeas.Shared/Enum/Role.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace GameIdeas.Shared.Enum;
|
||||
|
||||
public enum Role
|
||||
{
|
||||
Guest = 1,
|
||||
Member = 2,
|
||||
Administrator = 3
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace GameIdeas.Shared.Exceptions;
|
||||
|
||||
public class NotFoundException(string msg, Exception? innerException = null) : Exception(msg, innerException);
|
||||
@@ -8,7 +8,7 @@ public partial class Platform
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Libelle { get; set; } = null!;
|
||||
public string Label { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<GamePlatform> GamePlatforms { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user