Merge pull request #103 from mateuszskoczek/features/roles_endpoints
Features/roles endpoints
This commit is contained in:
22
WatchIt.Common/WatchIt.Common.Model/Roles/ActorRole.cs
Normal file
22
WatchIt.Common/WatchIt.Common.Model/Roles/ActorRole.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class ActorRole
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonPropertyName("type_id")]
|
||||||
|
public required short TypeId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("media_id")]
|
||||||
|
public required long MediaId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("person_id")]
|
||||||
|
public required long PersonId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class ActorRoleMediaQueryParameters : ActorRoleQueryParameters
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[FromQuery(Name = "person_id")]
|
||||||
|
public long? PersonId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override bool IsMeetingConditions(ActorRoleResponse item) =>
|
||||||
|
(
|
||||||
|
base.IsMeetingConditions(item)
|
||||||
|
&&
|
||||||
|
Test(item.PersonId, PersonId)
|
||||||
|
);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class ActorRolePersonQueryParameters : ActorRoleQueryParameters
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[FromQuery(Name = "media_id")]
|
||||||
|
public long? MediaId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override bool IsMeetingConditions(ActorRoleResponse item) =>
|
||||||
|
(
|
||||||
|
base.IsMeetingConditions(item)
|
||||||
|
&&
|
||||||
|
Test(item.MediaId, MediaId)
|
||||||
|
);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using WatchIt.Common.Query;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public abstract class ActorRoleQueryParameters : QueryParameters<ActorRoleResponse>
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[FromQuery(Name = "type_id")]
|
||||||
|
public short? TypeId { get; set; }
|
||||||
|
|
||||||
|
[FromQuery(Name = "name")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override bool IsMeetingConditions(ActorRoleResponse item) =>
|
||||||
|
(
|
||||||
|
Test(item.TypeId, TypeId)
|
||||||
|
&&
|
||||||
|
TestStringWithRegex(item.Name, Name)
|
||||||
|
);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
using WatchIt.Database.Model.Person;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class ActorRoleRequest : ActorRole, IActorRoleMediaRequest, IActorRolePersonRequest
|
||||||
|
{
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
PersonActorRole IActorRoleMediaRequest.CreateActorRole(long mediaId)
|
||||||
|
{
|
||||||
|
MediaId = mediaId;
|
||||||
|
return CreateActorRole();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonActorRole IActorRolePersonRequest.CreateActorRole(long personId)
|
||||||
|
{
|
||||||
|
PersonId = personId;
|
||||||
|
return CreateActorRole();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PersonActorRole CreateActorRole() => new PersonActorRole
|
||||||
|
{
|
||||||
|
MediaId = MediaId,
|
||||||
|
PersonId = PersonId,
|
||||||
|
PersonActorRoleTypeId = TypeId,
|
||||||
|
RoleName = Name,
|
||||||
|
};
|
||||||
|
|
||||||
|
public void UpdateActorRole(PersonActorRole item)
|
||||||
|
{
|
||||||
|
item.MediaId = MediaId;
|
||||||
|
item.PersonId = PersonId;
|
||||||
|
item.PersonActorRoleTypeId = TypeId;
|
||||||
|
item.RoleName = Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using WatchIt.Common.Query;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class ActorRoleResponse : ActorRole, IQueryOrderable<ActorRoleResponse>
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public static IDictionary<string, Func<ActorRoleResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<ActorRoleResponse, IComparable>>
|
||||||
|
{
|
||||||
|
{ "name", item => item.Name },
|
||||||
|
{ "type_id", item => item.TypeId },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public required Guid Id { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
public ActorRoleResponse() {}
|
||||||
|
|
||||||
|
[SetsRequiredMembers]
|
||||||
|
public ActorRoleResponse(Database.Model.Person.PersonActorRole data)
|
||||||
|
{
|
||||||
|
Id = data.Id;
|
||||||
|
MediaId = data.MediaId;
|
||||||
|
PersonId = data.PersonId;
|
||||||
|
TypeId = data.PersonActorRoleTypeId;
|
||||||
|
Name = data.RoleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
19
WatchIt.Common/WatchIt.Common.Model/Roles/CreatorRole.cs
Normal file
19
WatchIt.Common/WatchIt.Common.Model/Roles/CreatorRole.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class CreatorRole
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonPropertyName("type_id")]
|
||||||
|
public required short TypeId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("media_id")]
|
||||||
|
public required long MediaId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("person_id")]
|
||||||
|
public required long PersonId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class CreatorRoleMediaQueryParameters : CreatorRoleQueryParameters
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[FromQuery(Name = "person_id")]
|
||||||
|
public long? PersonId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override bool IsMeetingConditions(CreatorRoleResponse item) =>
|
||||||
|
(
|
||||||
|
base.IsMeetingConditions(item)
|
||||||
|
&&
|
||||||
|
Test(item.PersonId, PersonId)
|
||||||
|
);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class CreatorRolePersonQueryParameters : CreatorRoleQueryParameters
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[FromQuery(Name = "media_id")]
|
||||||
|
public long? MediaId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override bool IsMeetingConditions(CreatorRoleResponse item) =>
|
||||||
|
(
|
||||||
|
base.IsMeetingConditions(item)
|
||||||
|
&&
|
||||||
|
Test(item.MediaId, MediaId)
|
||||||
|
);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using WatchIt.Common.Query;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public abstract class CreatorRoleQueryParameters : QueryParameters<CreatorRoleResponse>
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[FromQuery(Name = "type_id")]
|
||||||
|
public short? TypeId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override bool IsMeetingConditions(CreatorRoleResponse item) =>
|
||||||
|
(
|
||||||
|
Test(item.TypeId, TypeId)
|
||||||
|
);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using WatchIt.Database.Model.Person;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class CreatorRoleRequest : CreatorRole, ICreatorRoleMediaRequest, ICreatorRolePersonRequest
|
||||||
|
{
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
PersonCreatorRole ICreatorRoleMediaRequest.CreateCreatorRole(long mediaId)
|
||||||
|
{
|
||||||
|
MediaId = mediaId;
|
||||||
|
return CreateCreatorRole();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonCreatorRole ICreatorRolePersonRequest.CreateCreatorRole(long personId)
|
||||||
|
{
|
||||||
|
PersonId = personId;
|
||||||
|
return CreateCreatorRole();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PersonCreatorRole CreateCreatorRole() => new PersonCreatorRole
|
||||||
|
{
|
||||||
|
MediaId = MediaId,
|
||||||
|
PersonId = PersonId,
|
||||||
|
PersonCreatorRoleTypeId = TypeId,
|
||||||
|
};
|
||||||
|
|
||||||
|
public void UpdateCreatorRole(PersonCreatorRole item)
|
||||||
|
{
|
||||||
|
item.MediaId = MediaId;
|
||||||
|
item.PersonId = PersonId;
|
||||||
|
item.PersonCreatorRoleTypeId = TypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using WatchIt.Common.Query;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class CreatorRoleResponse : CreatorRole, IQueryOrderable<CreatorRoleResponse>
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public static IDictionary<string, Func<CreatorRoleResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<CreatorRoleResponse, IComparable>>
|
||||||
|
{
|
||||||
|
{ "type_id", item => item.TypeId },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public required Guid Id { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
public CreatorRoleResponse() {}
|
||||||
|
|
||||||
|
[SetsRequiredMembers]
|
||||||
|
public CreatorRoleResponse(Database.Model.Person.PersonCreatorRole data)
|
||||||
|
{
|
||||||
|
Id = data.Id;
|
||||||
|
MediaId = data.MediaId;
|
||||||
|
PersonId = data.PersonId;
|
||||||
|
TypeId = data.PersonCreatorRoleTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using WatchIt.Database.Model.Person;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public interface IActorRoleMediaRequest
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonPropertyName("person_id")]
|
||||||
|
long PersonId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("type_id")]
|
||||||
|
short TypeId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
string Name { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
PersonActorRole CreateActorRole(long mediaId);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using WatchIt.Database.Model.Person;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public interface IActorRolePersonRequest
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonPropertyName("media_id")]
|
||||||
|
long MediaId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("type_id")]
|
||||||
|
short TypeId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
string Name { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
PersonActorRole CreateActorRole(long personId);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using WatchIt.Database.Model.Person;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public interface ICreatorRoleMediaRequest
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonPropertyName("person_id")]
|
||||||
|
long PersonId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("type_id")]
|
||||||
|
short TypeId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
PersonCreatorRole CreateCreatorRole(long mediaId);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using WatchIt.Database.Model.Person;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public interface ICreatorRolePersonRequest
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonPropertyName("media_id")]
|
||||||
|
long MediaId { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("type_id")]
|
||||||
|
short TypeId { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
PersonCreatorRole CreateCreatorRole(long personId);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
13
WatchIt.Common/WatchIt.Common.Model/Roles/RoleType.cs
Normal file
13
WatchIt.Common/WatchIt.Common.Model/Roles/RoleType.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class RoleType
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using WatchIt.Common.Query;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class RoleTypeQueryParameters : QueryParameters<RoleTypeResponse>
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[FromQuery(Name = "name")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override bool IsMeetingConditions(RoleTypeResponse item) => TestStringWithRegex(item.Name, Name);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
18
WatchIt.Common/WatchIt.Common.Model/Roles/RoleTypeRequest.cs
Normal file
18
WatchIt.Common/WatchIt.Common.Model/Roles/RoleTypeRequest.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class RoleTypeRequest : RoleType
|
||||||
|
{
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
public Database.Model.Person.PersonActorRoleType CreateActorRoleType() => new Database.Model.Person.PersonActorRoleType()
|
||||||
|
{
|
||||||
|
Name = Name
|
||||||
|
};
|
||||||
|
|
||||||
|
public Database.Model.Person.PersonCreatorRoleType CreateCreatorRoleType() => new Database.Model.Person.PersonCreatorRoleType()
|
||||||
|
{
|
||||||
|
Name = Name
|
||||||
|
};
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using WatchIt.Common.Query;
|
||||||
|
|
||||||
|
namespace WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
public class RoleTypeResponse : RoleType, IQueryOrderable<RoleTypeResponse>
|
||||||
|
{
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public static IDictionary<string, Func<RoleTypeResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<RoleTypeResponse, IComparable>>
|
||||||
|
{
|
||||||
|
{ "name", item => item.Name }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public required short? Id { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
public RoleTypeResponse() { }
|
||||||
|
|
||||||
|
[SetsRequiredMembers]
|
||||||
|
public RoleTypeResponse(Database.Model.Person.PersonCreatorRoleType creatorRoleType)
|
||||||
|
{
|
||||||
|
Id = creatorRoleType.Id;
|
||||||
|
Name = creatorRoleType.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
[SetsRequiredMembers]
|
||||||
|
public RoleTypeResponse(Database.Model.Person.PersonActorRoleType actorRoleType)
|
||||||
|
{
|
||||||
|
Id = actorRoleType.Id;
|
||||||
|
Name = actorRoleType.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -55,7 +55,7 @@ public class GendersController : ControllerBase
|
|||||||
|
|
||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id}")]
|
||||||
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
[ProducesResponseType(typeof(GenderResponse), StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
public async Task<ActionResult> DeleteGender([FromRoute]short id) => await _gendersControllerService.DeleteGender(id);
|
public async Task<ActionResult> DeleteGender([FromRoute]short id) => await _gendersControllerService.DeleteGender(id);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using WatchIt.Common.Model.Genres;
|
|||||||
using WatchIt.Common.Model.Media;
|
using WatchIt.Common.Model.Media;
|
||||||
using WatchIt.Common.Model.Photos;
|
using WatchIt.Common.Model.Photos;
|
||||||
using WatchIt.Common.Model.Rating;
|
using WatchIt.Common.Model.Rating;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Media;
|
using WatchIt.WebAPI.Services.Controllers.Media;
|
||||||
|
|
||||||
namespace WatchIt.WebAPI.Controllers;
|
namespace WatchIt.WebAPI.Controllers;
|
||||||
@@ -162,5 +163,39 @@ public class MediaController : ControllerBase
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Roles
|
||||||
|
|
||||||
|
[HttpGet("{id}/roles/actor")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<ActorRoleResponse>), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> GetMediaAllActorRoles([FromRoute]long id, ActorRoleMediaQueryParameters query) => await _mediaControllerService.GetMediaAllActorRoles(id, query);
|
||||||
|
|
||||||
|
[HttpPost("{id}/roles/actor")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(typeof(ActorRoleResponse), StatusCodes.Status201Created)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> PostMediaActorRole([FromRoute]long id, [FromBody]IActorRoleMediaRequest body) => await _mediaControllerService.PostMediaActorRole(id, body);
|
||||||
|
|
||||||
|
[HttpGet("{id}/roles/creator")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<CreatorRoleResponse>), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> GetMediaAllCreatorRoles([FromRoute]long id, CreatorRoleMediaQueryParameters query) => await _mediaControllerService.GetMediaAllCreatorRoles(id, query);
|
||||||
|
|
||||||
|
[HttpPost("{id}/roles/creator")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(typeof(CreatorRoleResponse), StatusCodes.Status201Created)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> PostMediaCreatorRole([FromRoute]long id, [FromBody]ICreatorRoleMediaRequest body) => await _mediaControllerService.PostMediaCreatorRole(id, body);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Authorization;
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using WatchIt.Common.Model.Persons;
|
using WatchIt.Common.Model.Persons;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Persons;
|
using WatchIt.WebAPI.Services.Controllers.Persons;
|
||||||
|
|
||||||
namespace WatchIt.WebAPI.Controllers;
|
namespace WatchIt.WebAPI.Controllers;
|
||||||
@@ -106,5 +107,39 @@ public class PersonsController : ControllerBase
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Roles
|
||||||
|
|
||||||
|
[HttpGet("{id}/roles/actor")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<ActorRoleResponse>), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> GetPersonAllActorRoles([FromRoute]long id, ActorRolePersonQueryParameters query) => await _personsControllerService.GetPersonAllActorRoles(id, query);
|
||||||
|
|
||||||
|
[HttpPost("{id}/roles/actor")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(typeof(ActorRoleResponse), StatusCodes.Status201Created)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> PostPersonActorRole([FromRoute]long id, [FromBody]IActorRolePersonRequest body) => await _personsControllerService.PostPersonActorRole(id, body);
|
||||||
|
|
||||||
|
[HttpGet("{id}/roles/creator")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<CreatorRoleResponse>), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> GetPersonAllCreatorRoles([FromRoute]long id, CreatorRolePersonQueryParameters query) => await _personsControllerService.GetPersonAllCreatorRoles(id, query);
|
||||||
|
|
||||||
|
[HttpPost("{id}/roles/creator")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(typeof(CreatorRoleResponse), StatusCodes.Status201Created)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> PostPersonCreatorRole([FromRoute]long id, [FromBody]ICreatorRolePersonRequest body) => await _personsControllerService.PostPersonCreatorRole(id, body);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
139
WatchIt.WebAPI/WatchIt.WebAPI.Controllers/RolesController.cs
Normal file
139
WatchIt.WebAPI/WatchIt.WebAPI.Controllers/RolesController.cs
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
|
using WatchIt.WebAPI.Services.Controllers.Roles;
|
||||||
|
|
||||||
|
namespace WatchIt.WebAPI.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("roles")]
|
||||||
|
public class RolesController : ControllerBase
|
||||||
|
{
|
||||||
|
#region SERVICES
|
||||||
|
|
||||||
|
private readonly IRolesControllerService _rolesControllerService;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
public RolesController(IRolesControllerService rolesControllerService)
|
||||||
|
{
|
||||||
|
_rolesControllerService = rolesControllerService;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region METHODS
|
||||||
|
|
||||||
|
#region Actor
|
||||||
|
|
||||||
|
[HttpGet("actor/{id}")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<ActorRoleResponse>), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> GetActorRole([FromRoute]Guid id) => await _rolesControllerService.GetActorRole(id);
|
||||||
|
|
||||||
|
[HttpPut("actor/{id}")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> PutActorRole([FromRoute]Guid id, [FromBody]ActorRoleRequest body) => await _rolesControllerService.PutActorRole(id, body);
|
||||||
|
|
||||||
|
[HttpDelete("actor/{id}")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
public async Task<ActionResult> DeleteActorRole([FromRoute]Guid id) => await _rolesControllerService.DeleteActorRole(id);
|
||||||
|
|
||||||
|
[HttpGet("actor/type")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<RoleTypeResponse>), StatusCodes.Status200OK)]
|
||||||
|
public async Task<ActionResult> GetAllActorRoleTypes(RoleTypeQueryParameters query) => await _rolesControllerService.GetAllActorRoleTypes(query);
|
||||||
|
|
||||||
|
[HttpGet("actor/type/{type_id}")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(RoleTypeResponse), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> GetActorRoleType([FromRoute(Name = "type_id")]short typeId) => await _rolesControllerService.GetActorRoleType(typeId);
|
||||||
|
|
||||||
|
[HttpPost("actor/type")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(typeof(RoleTypeResponse), StatusCodes.Status201Created)]
|
||||||
|
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
public async Task<ActionResult> PostActorRoleType([FromBody]RoleTypeRequest body) => await _rolesControllerService.PostActorRoleType(body);
|
||||||
|
|
||||||
|
[HttpDelete("actor/type/{type_id}")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
public async Task<ActionResult> DeleteActorRoleType([FromRoute(Name = "type_id")]short typeId) => await _rolesControllerService.DeleteActorRoleType(typeId);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Creator
|
||||||
|
|
||||||
|
[HttpGet("creator/{id}")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<CreatorRoleResponse>), StatusCodes.Status200OK)]
|
||||||
|
public async Task<ActionResult> GetCreatorRole([FromRoute]Guid id) => await _rolesControllerService.GetCreatorRole(id);
|
||||||
|
|
||||||
|
[HttpPut("creator/{id}")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> PutCreatorRole([FromRoute]Guid id, [FromBody]CreatorRoleRequest body) => await _rolesControllerService.PutCreatorRole(id, body);
|
||||||
|
|
||||||
|
[HttpDelete("creator/{id}")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
public async Task<ActionResult> DeleteCreatorRole([FromRoute]Guid id) => await _rolesControllerService.DeleteCreatorRole(id);
|
||||||
|
|
||||||
|
[HttpGet("creator/type")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<RoleTypeResponse>), StatusCodes.Status200OK)]
|
||||||
|
public async Task<ActionResult> GetAllCreatorRoleTypes(RoleTypeQueryParameters query) => await _rolesControllerService.GetAllCreatorRoleTypes(query);
|
||||||
|
|
||||||
|
[HttpGet("creator/type/{id}")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(RoleTypeResponse), StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
public async Task<ActionResult> GetCreatorRoleType([FromRoute]short id) => await _rolesControllerService.GetCreatorRoleType(id);
|
||||||
|
|
||||||
|
[HttpPost("creator/type")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(typeof(RoleTypeResponse), StatusCodes.Status201Created)]
|
||||||
|
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
public async Task<ActionResult> PostCreatorRoleType([FromBody]RoleTypeRequest body) => await _rolesControllerService.PostCreatorRoleType(body);
|
||||||
|
|
||||||
|
[HttpDelete("creator/type/{id}")]
|
||||||
|
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||||
|
public async Task<ActionResult> DeleteCreatorRoleType([FromRoute]short id) => await _rolesControllerService.DeleteCreatorRoleType(id);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Movies\WatchIt.WebAPI.Services.Controllers.Movies.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Movies\WatchIt.WebAPI.Services.Controllers.Movies.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Persons\WatchIt.WebAPI.Services.Controllers.Persons.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Persons\WatchIt.WebAPI.Services.Controllers.Persons.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Photos\WatchIt.WebAPI.Services.Controllers.Photos.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Photos\WatchIt.WebAPI.Services.Controllers.Photos.csproj" />
|
||||||
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Roles\WatchIt.WebAPI.Services.Controllers.Roles.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Series\WatchIt.WebAPI.Services.Controllers.Series.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Series\WatchIt.WebAPI.Services.Controllers.Series.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public class GendersControllerService : IGendersControllerService
|
|||||||
|
|
||||||
#region PUBLIC METHODS
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
#region Main
|
||||||
|
|
||||||
public async Task<RequestResult> GetAllGenders(GenderQueryParameters query)
|
public async Task<RequestResult> GetAllGenders(GenderQueryParameters query)
|
||||||
{
|
{
|
||||||
IEnumerable<Gender> rawData = await _database.Genders.ToListAsync();
|
IEnumerable<Gender> rawData = await _database.Genders.ToListAsync();
|
||||||
@@ -90,4 +92,6 @@ public class GendersControllerService : IGendersControllerService
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using WatchIt.Common.Model.Media;
|
using WatchIt.Common.Model.Media;
|
||||||
using WatchIt.Common.Model.Photos;
|
using WatchIt.Common.Model.Photos;
|
||||||
using WatchIt.Common.Model.Rating;
|
using WatchIt.Common.Model.Rating;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Common;
|
using WatchIt.WebAPI.Services.Controllers.Common;
|
||||||
|
|
||||||
namespace WatchIt.WebAPI.Services.Controllers.Media;
|
namespace WatchIt.WebAPI.Services.Controllers.Media;
|
||||||
@@ -27,4 +28,9 @@ public interface IMediaControllerService
|
|||||||
Task<RequestResult> GetMediaPhotos(long mediaId, PhotoQueryParameters queryParameters);
|
Task<RequestResult> GetMediaPhotos(long mediaId, PhotoQueryParameters queryParameters);
|
||||||
Task<RequestResult> GetMediaPhotoRandomBackground(long mediaId);
|
Task<RequestResult> GetMediaPhotoRandomBackground(long mediaId);
|
||||||
Task<RequestResult> PostMediaPhoto(long mediaId, MediaPhotoRequest data);
|
Task<RequestResult> PostMediaPhoto(long mediaId, MediaPhotoRequest data);
|
||||||
|
|
||||||
|
Task<RequestResult> GetMediaAllActorRoles(long mediaId, ActorRoleMediaQueryParameters queryParameters);
|
||||||
|
Task<RequestResult> PostMediaActorRole(long mediaId, IActorRoleMediaRequest data);
|
||||||
|
Task<RequestResult> GetMediaAllCreatorRoles(long mediaId, CreatorRoleMediaQueryParameters queryParameters);
|
||||||
|
Task<RequestResult> PostMediaCreatorRole(long mediaId, ICreatorRoleMediaRequest data);
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,10 @@ using WatchIt.Common.Model.Genres;
|
|||||||
using WatchIt.Common.Model.Media;
|
using WatchIt.Common.Model.Media;
|
||||||
using WatchIt.Common.Model.Photos;
|
using WatchIt.Common.Model.Photos;
|
||||||
using WatchIt.Common.Model.Rating;
|
using WatchIt.Common.Model.Rating;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.Database;
|
using WatchIt.Database;
|
||||||
using WatchIt.Database.Model.Media;
|
using WatchIt.Database.Model.Media;
|
||||||
|
using WatchIt.Database.Model.Person;
|
||||||
using WatchIt.Database.Model.Rating;
|
using WatchIt.Database.Model.Rating;
|
||||||
using WatchIt.Database.Model.ViewCount;
|
using WatchIt.Database.Model.ViewCount;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Common;
|
using WatchIt.WebAPI.Services.Controllers.Common;
|
||||||
@@ -267,7 +269,7 @@ public class MediaControllerService(DatabaseContext database, IUserService userS
|
|||||||
|
|
||||||
await database.SaveChangesAsync();
|
await database.SaveChangesAsync();
|
||||||
|
|
||||||
MediaPosterResponse returnData = new MediaPosterResponse(media.MediaPosterImage);
|
MediaPosterResponse returnData = new MediaPosterResponse(media.MediaPosterImage!);
|
||||||
return RequestResult.Ok(returnData);
|
return RequestResult.Ok(returnData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,5 +353,79 @@ public class MediaControllerService(DatabaseContext database, IUserService userS
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Roles
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetMediaAllActorRoles(long mediaId, ActorRoleMediaQueryParameters queryParameters)
|
||||||
|
{
|
||||||
|
Database.Model.Media.Media? media = await database.Media.FirstOrDefaultAsync(x => x.Id == mediaId);
|
||||||
|
if (media is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<PersonActorRole> dataRaw = await database.PersonActorRoles.Where(x => x.MediaId == mediaId).ToListAsync();
|
||||||
|
IEnumerable<ActorRoleResponse> data = dataRaw.Select(x => new ActorRoleResponse(x));
|
||||||
|
data = queryParameters.PrepareData(data);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PostMediaActorRole(long mediaId, IActorRoleMediaRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
Database.Model.Media.Media? media = await database.Media.FirstOrDefaultAsync(x => x.Id == mediaId);
|
||||||
|
if (media is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonActorRole item = data.CreateActorRole(mediaId);
|
||||||
|
await database.PersonActorRoles.AddAsync(item);
|
||||||
|
await database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Created($"roles/actor/{item.Id}", new ActorRoleResponse(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetMediaAllCreatorRoles(long mediaId, CreatorRoleMediaQueryParameters queryParameters)
|
||||||
|
{
|
||||||
|
Database.Model.Media.Media? media = await database.Media.FirstOrDefaultAsync(x => x.Id == mediaId);
|
||||||
|
if (media is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<PersonCreatorRole> dataRaw = await database.PersonCreatorRoles.Where(x => x.MediaId == mediaId).ToListAsync();
|
||||||
|
IEnumerable<CreatorRoleResponse> data = dataRaw.Select(x => new CreatorRoleResponse(x));
|
||||||
|
data = queryParameters.PrepareData(data);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PostMediaCreatorRole(long mediaId, ICreatorRoleMediaRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
Database.Model.Media.Media? media = await database.Media.FirstOrDefaultAsync(x => x.Id == mediaId);
|
||||||
|
if (media is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonCreatorRole item = data.CreateCreatorRole(mediaId);
|
||||||
|
await database.PersonCreatorRoles.AddAsync(item);
|
||||||
|
await database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Created($"roles/creator/{item.Id}", new CreatorRoleResponse(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using WatchIt.Common.Model.Persons;
|
using WatchIt.Common.Model.Persons;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Common;
|
using WatchIt.WebAPI.Services.Controllers.Common;
|
||||||
|
|
||||||
namespace WatchIt.WebAPI.Services.Controllers.Persons;
|
namespace WatchIt.WebAPI.Services.Controllers.Persons;
|
||||||
@@ -16,4 +17,9 @@ public interface IPersonsControllerService
|
|||||||
Task<RequestResult> GetPersonPhoto(long id);
|
Task<RequestResult> GetPersonPhoto(long id);
|
||||||
Task<RequestResult> PutPersonPhoto(long id, PersonPhotoRequest data);
|
Task<RequestResult> PutPersonPhoto(long id, PersonPhotoRequest data);
|
||||||
Task<RequestResult> DeletePersonPhoto(long id);
|
Task<RequestResult> DeletePersonPhoto(long id);
|
||||||
|
|
||||||
|
Task<RequestResult> GetPersonAllActorRoles(long personId, ActorRolePersonQueryParameters queryParameters);
|
||||||
|
Task<RequestResult> PostPersonActorRole(long personId, IActorRolePersonRequest data);
|
||||||
|
Task<RequestResult> GetPersonAllCreatorRoles(long personId, CreatorRolePersonQueryParameters queryParameters);
|
||||||
|
Task<RequestResult> PostPersonCreatorRole(long personId, ICreatorRolePersonRequest data);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using WatchIt.Common.Model.Persons;
|
using WatchIt.Common.Model.Persons;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.Database;
|
using WatchIt.Database;
|
||||||
using WatchIt.Database.Model.Person;
|
using WatchIt.Database.Model.Person;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Common;
|
using WatchIt.WebAPI.Services.Controllers.Common;
|
||||||
@@ -218,5 +219,79 @@ public class PersonsControllerService : IPersonsControllerService
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Roles
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetPersonAllActorRoles(long personId, ActorRolePersonQueryParameters queryParameters)
|
||||||
|
{
|
||||||
|
Database.Model.Person.Person? person = await _database.Persons.FirstOrDefaultAsync(x => x.Id == personId);
|
||||||
|
if (person is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<PersonActorRole> dataRaw = await _database.PersonActorRoles.Where(x => x.PersonId == personId).ToListAsync();
|
||||||
|
IEnumerable<ActorRoleResponse> data = dataRaw.Select(x => new ActorRoleResponse(x));
|
||||||
|
data = queryParameters.PrepareData(data);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PostPersonActorRole(long personId, IActorRolePersonRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
Database.Model.Person.Person? person = await _database.Persons.FirstOrDefaultAsync(x => x.Id == personId);
|
||||||
|
if (person is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonActorRole item = data.CreateActorRole(personId);
|
||||||
|
await _database.PersonActorRoles.AddAsync(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Created($"roles/actor/{item.Id}", new ActorRoleResponse(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetPersonAllCreatorRoles(long personId, CreatorRolePersonQueryParameters queryParameters)
|
||||||
|
{
|
||||||
|
Database.Model.Person.Person? media = await _database.Persons.FirstOrDefaultAsync(x => x.Id == personId);
|
||||||
|
if (media is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<PersonCreatorRole> dataRaw = await _database.PersonCreatorRoles.Where(x => x.PersonId == personId).ToListAsync();
|
||||||
|
IEnumerable<CreatorRoleResponse> data = dataRaw.Select(x => new CreatorRoleResponse(x));
|
||||||
|
data = queryParameters.PrepareData(data);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PostPersonCreatorRole(long personId, ICreatorRolePersonRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
Database.Model.Person.Person? media = await _database.Persons.FirstOrDefaultAsync(x => x.Id == personId);
|
||||||
|
if (media is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonCreatorRole item = data.CreateCreatorRole(personId);
|
||||||
|
await _database.PersonCreatorRoles.AddAsync(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Created($"roles/creator/{item.Id}", new CreatorRoleResponse(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
|
using WatchIt.WebAPI.Services.Controllers.Common;
|
||||||
|
|
||||||
|
namespace WatchIt.WebAPI.Services.Controllers.Roles;
|
||||||
|
|
||||||
|
public interface IRolesControllerService
|
||||||
|
{
|
||||||
|
Task<RequestResult> GetActorRole(Guid id);
|
||||||
|
Task<RequestResult> PutActorRole(Guid id, ActorRoleRequest data);
|
||||||
|
Task<RequestResult> DeleteActorRole(Guid id);
|
||||||
|
Task<RequestResult> GetAllActorRoleTypes(RoleTypeQueryParameters query);
|
||||||
|
Task<RequestResult> GetActorRoleType(short typeId);
|
||||||
|
Task<RequestResult> PostActorRoleType(RoleTypeRequest data);
|
||||||
|
Task<RequestResult> DeleteActorRoleType(short typeId);
|
||||||
|
|
||||||
|
Task<RequestResult> GetCreatorRole(Guid id);
|
||||||
|
Task<RequestResult> PutCreatorRole(Guid id, CreatorRoleRequest data);
|
||||||
|
Task<RequestResult> DeleteCreatorRole(Guid id);
|
||||||
|
Task<RequestResult> GetAllCreatorRoleTypes(RoleTypeQueryParameters query);
|
||||||
|
Task<RequestResult> GetCreatorRoleType(short typeId);
|
||||||
|
Task<RequestResult> PostCreatorRoleType(RoleTypeRequest data);
|
||||||
|
Task<RequestResult> DeleteCreatorRoleType(short typeId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,262 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
|
using WatchIt.Database;
|
||||||
|
using WatchIt.Database.Model.Person;
|
||||||
|
using WatchIt.WebAPI.Services.Controllers.Common;
|
||||||
|
using WatchIt.WebAPI.Services.Utility.User;
|
||||||
|
|
||||||
|
namespace WatchIt.WebAPI.Services.Controllers.Roles;
|
||||||
|
|
||||||
|
public class RolesControllerService : IRolesControllerService
|
||||||
|
{
|
||||||
|
#region SERVICES
|
||||||
|
|
||||||
|
private readonly DatabaseContext _database;
|
||||||
|
private readonly IUserService _userService;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
public RolesControllerService(DatabaseContext database, IUserService userService)
|
||||||
|
{
|
||||||
|
_database = database;
|
||||||
|
_userService = userService;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
#region Actor
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetActorRole(Guid id)
|
||||||
|
{
|
||||||
|
PersonActorRole? item = await _database.PersonActorRoles.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
ActorRoleResponse data = new ActorRoleResponse(item);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PutActorRole(Guid id, ActorRoleRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonActorRole? item = await _database.PersonActorRoles.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
data.UpdateActorRole(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> DeleteActorRole(Guid id)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonActorRole? item = await _database.PersonActorRoles.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
_database.PersonActorRoles.Attach(item);
|
||||||
|
_database.PersonActorRoles.Remove(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetAllActorRoleTypes(RoleTypeQueryParameters query)
|
||||||
|
{
|
||||||
|
IEnumerable<PersonActorRoleType> rawData = await _database.PersonActorRoleTypes.ToListAsync();
|
||||||
|
IEnumerable<RoleTypeResponse> data = rawData.Select(x => new RoleTypeResponse(x));
|
||||||
|
data = query.PrepareData(data);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetActorRoleType(short id)
|
||||||
|
{
|
||||||
|
PersonActorRoleType? item = await _database.PersonActorRoleTypes.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
RoleTypeResponse data = new RoleTypeResponse(item);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PostActorRoleType(RoleTypeRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonActorRoleType item = data.CreateActorRoleType();
|
||||||
|
await _database.PersonActorRoleTypes.AddAsync(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Created($"roles/actor/{item.Id}", new RoleTypeResponse(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> DeleteActorRoleType(short id)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonActorRoleType? item = await _database.PersonActorRoleTypes.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
_database.PersonActorRoleTypes.Attach(item);
|
||||||
|
_database.PersonActorRoleTypes.Remove(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Creator
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetCreatorRole(Guid id)
|
||||||
|
{
|
||||||
|
PersonCreatorRole? item = await _database.PersonCreatorRoles.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
CreatorRoleResponse data = new CreatorRoleResponse(item);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PutCreatorRole(Guid id, CreatorRoleRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonCreatorRole? item = await _database.PersonCreatorRoles.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
data.UpdateCreatorRole(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> DeleteCreatorRole(Guid id)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonCreatorRole? item = await _database.PersonCreatorRoles.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
_database.PersonCreatorRoles.Attach(item);
|
||||||
|
_database.PersonCreatorRoles.Remove(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetAllCreatorRoleTypes(RoleTypeQueryParameters query)
|
||||||
|
{
|
||||||
|
IEnumerable<PersonCreatorRoleType> rawData = await _database.PersonCreatorRoleTypes.ToListAsync();
|
||||||
|
IEnumerable<RoleTypeResponse> data = rawData.Select(x => new RoleTypeResponse(x));
|
||||||
|
data = query.PrepareData(data);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> GetCreatorRoleType(short id)
|
||||||
|
{
|
||||||
|
PersonCreatorRoleType? item = await _database.PersonCreatorRoleTypes.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
RoleTypeResponse data = new RoleTypeResponse(item);
|
||||||
|
return RequestResult.Ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> PostCreatorRoleType(RoleTypeRequest data)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonCreatorRoleType item = data.CreateCreatorRoleType();
|
||||||
|
await _database.PersonCreatorRoleTypes.AddAsync(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.Created($"roles/creator/{item.Id}", new RoleTypeResponse(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<RequestResult> DeleteCreatorRoleType(short id)
|
||||||
|
{
|
||||||
|
UserValidator validator = _userService.GetValidator().MustBeAdmin();
|
||||||
|
if (!validator.IsValid)
|
||||||
|
{
|
||||||
|
return RequestResult.Forbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonCreatorRoleType? item = await _database.PersonCreatorRoleTypes.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
_database.PersonCreatorRoleTypes.Attach(item);
|
||||||
|
_database.PersonCreatorRoleTypes.Remove(item);
|
||||||
|
await _database.SaveChangesAsync();
|
||||||
|
|
||||||
|
return RequestResult.NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\..\WatchIt.Common\WatchIt.Common.Model\WatchIt.Common.Model.csproj" />
|
||||||
|
<ProjectReference Include="..\..\..\..\WatchIt.Database\WatchIt.Database\WatchIt.Database.csproj" />
|
||||||
|
<ProjectReference Include="..\..\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.User\WatchIt.WebAPI.Services.Utility.User.csproj" />
|
||||||
|
<ProjectReference Include="..\WatchIt.WebAPI.Services.Controllers.Common\WatchIt.WebAPI.Services.Controllers.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -16,6 +16,7 @@ using WatchIt.WebAPI.Services.Controllers.Media;
|
|||||||
using WatchIt.WebAPI.Services.Controllers.Movies;
|
using WatchIt.WebAPI.Services.Controllers.Movies;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Persons;
|
using WatchIt.WebAPI.Services.Controllers.Persons;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Photos;
|
using WatchIt.WebAPI.Services.Controllers.Photos;
|
||||||
|
using WatchIt.WebAPI.Services.Controllers.Roles;
|
||||||
using WatchIt.WebAPI.Services.Controllers.Series;
|
using WatchIt.WebAPI.Services.Controllers.Series;
|
||||||
using WatchIt.WebAPI.Services.Utility.Configuration;
|
using WatchIt.WebAPI.Services.Utility.Configuration;
|
||||||
using WatchIt.WebAPI.Services.Utility.Tokens;
|
using WatchIt.WebAPI.Services.Utility.Tokens;
|
||||||
@@ -162,6 +163,7 @@ public static class Program
|
|||||||
builder.Services.AddTransient<ISeriesControllerService, SeriesControllerService>();
|
builder.Services.AddTransient<ISeriesControllerService, SeriesControllerService>();
|
||||||
builder.Services.AddTransient<IPhotosControllerService, PhotosControllerService>();
|
builder.Services.AddTransient<IPhotosControllerService, PhotosControllerService>();
|
||||||
builder.Services.AddTransient<IPersonsControllerService, PersonsControllerService>();
|
builder.Services.AddTransient<IPersonsControllerService, PersonsControllerService>();
|
||||||
|
builder.Services.AddTransient<IRolesControllerService, RolesControllerService>();
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
<ProjectReference Include="..\..\WatchIt.Database\WatchIt.Database\WatchIt.Database.csproj" />
|
<ProjectReference Include="..\..\WatchIt.Database\WatchIt.Database\WatchIt.Database.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Controllers\WatchIt.WebAPI.Controllers.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Controllers\WatchIt.WebAPI.Controllers.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Persons\WatchIt.WebAPI.Services.Controllers.Persons.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Persons\WatchIt.WebAPI.Services.Controllers.Persons.csproj" />
|
||||||
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Roles\WatchIt.WebAPI.Services.Controllers.Roles.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Configuration\WatchIt.WebAPI.Services.Utility.Configuration.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Configuration\WatchIt.WebAPI.Services.Utility.Configuration.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Tokens\WatchIt.WebAPI.Services.Utility.Tokens.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Tokens\WatchIt.WebAPI.Services.Utility.Tokens.csproj" />
|
||||||
<ProjectReference Include="..\WatchIt.WebAPI.Validators\WatchIt.WebAPI.Validators.csproj" />
|
<ProjectReference Include="..\WatchIt.WebAPI.Validators\WatchIt.WebAPI.Validators.csproj" />
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ public class Endpoints
|
|||||||
public Series Series { get; set; }
|
public Series Series { get; set; }
|
||||||
public Photos Photos { get; set; }
|
public Photos Photos { get; set; }
|
||||||
public Persons Persons { get; set; }
|
public Persons Persons { get; set; }
|
||||||
|
public Roles Roles { get; set; }
|
||||||
}
|
}
|
||||||
@@ -18,4 +18,8 @@ public class Media
|
|||||||
public string GetMediaPhotos { get; set; }
|
public string GetMediaPhotos { get; set; }
|
||||||
public string GetMediaPhotoRandomBackground { get; set; }
|
public string GetMediaPhotoRandomBackground { get; set; }
|
||||||
public string PostMediaPhoto { get; set; }
|
public string PostMediaPhoto { get; set; }
|
||||||
|
public string GetMediaAllActorRoles { get; set; }
|
||||||
|
public string PostMediaActorRole { get; set; }
|
||||||
|
public string GetMediaAllCreatorRoles { get; set; }
|
||||||
|
public string PostMediaCreatorRole { get; set; }
|
||||||
}
|
}
|
||||||
@@ -12,4 +12,8 @@ public class Persons
|
|||||||
public string GetPersonPhoto { get; set; }
|
public string GetPersonPhoto { get; set; }
|
||||||
public string PutPersonPhoto { get; set; }
|
public string PutPersonPhoto { get; set; }
|
||||||
public string DeletePersonPhoto { get; set; }
|
public string DeletePersonPhoto { get; set; }
|
||||||
|
public string GetPersonAllActorRoles { get; set; }
|
||||||
|
public string PostPersonActorRole { get; set; }
|
||||||
|
public string GetPersonAllCreatorRoles { get; set; }
|
||||||
|
public string PostPersonCreatorRole { get; set; }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace WatchIt.Website.Services.Utility.Configuration.Model;
|
||||||
|
|
||||||
|
public class Roles
|
||||||
|
{
|
||||||
|
public string Base { get; set; }
|
||||||
|
public string GetActorRole { get; set; }
|
||||||
|
public string PutActorRole { get; set; }
|
||||||
|
public string DeleteActorRole { get; set; }
|
||||||
|
public string GetAllActorRoleTypes { get; set; }
|
||||||
|
public string GetActorRoleType { get; set; }
|
||||||
|
public string PostActorRoleType { get; set; }
|
||||||
|
public string DeleteActorRoleType { get; set; }
|
||||||
|
public string GetCreatorRole { get; set; }
|
||||||
|
public string PutCreatorRole { get; set; }
|
||||||
|
public string DeleteCreatorRole { get; set; }
|
||||||
|
public string GetAllCreatorRoleTypes { get; set; }
|
||||||
|
public string GetCreatorRoleType { get; set; }
|
||||||
|
public string PostCreatorRoleType { get; set; }
|
||||||
|
public string DeleteCreatorRoleType { get; set; }
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
using WatchIt.Common.Model.Media;
|
using WatchIt.Common.Model.Media;
|
||||||
using WatchIt.Common.Model.Photos;
|
using WatchIt.Common.Model.Photos;
|
||||||
using WatchIt.Common.Model.Rating;
|
using WatchIt.Common.Model.Rating;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
namespace WatchIt.Website.Services.WebAPI.Media;
|
namespace WatchIt.Website.Services.WebAPI.Media;
|
||||||
|
|
||||||
@@ -27,4 +28,9 @@ public interface IMediaWebAPIService
|
|||||||
Task GetMediaPhotos(long mediaId, PhotoQueryParameters? query = null, Action<IEnumerable<PhotoResponse>>? successAction = null, Action? notFoundAction = null);
|
Task GetMediaPhotos(long mediaId, PhotoQueryParameters? query = null, Action<IEnumerable<PhotoResponse>>? successAction = null, Action? notFoundAction = null);
|
||||||
Task GetMediaPhotoRandomBackground(long mediaId, Action<PhotoResponse>? successAction = null, Action? notFoundAction = null);
|
Task GetMediaPhotoRandomBackground(long mediaId, Action<PhotoResponse>? successAction = null, Action? notFoundAction = null);
|
||||||
Task PostMediaPhoto(long mediaId, MediaPhotoRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null);
|
Task PostMediaPhoto(long mediaId, MediaPhotoRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null);
|
||||||
|
|
||||||
|
Task GetMediaAllActorRoles(long id, ActorRoleMediaQueryParameters? query = null, Action<IEnumerable<ActorRoleResponse>>? successAction = null);
|
||||||
|
Task PostMediaActorRole(long id, IActorRoleMediaRequest data, Action<ActorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
Task GetMediaAllCreatorRoles(long id, CreatorRoleMediaQueryParameters? query = null, Action<IEnumerable<CreatorRoleResponse>>? successAction = null);
|
||||||
|
Task PostMediaCreatorRole(long id, ICreatorRoleMediaRequest data, Action<CreatorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
using WatchIt.Common.Model.Media;
|
using WatchIt.Common.Model.Media;
|
||||||
using WatchIt.Common.Model.Photos;
|
using WatchIt.Common.Model.Photos;
|
||||||
using WatchIt.Common.Model.Rating;
|
using WatchIt.Common.Model.Rating;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.Common.Services.HttpClient;
|
using WatchIt.Common.Services.HttpClient;
|
||||||
using WatchIt.Website.Services.Utility.Configuration;
|
using WatchIt.Website.Services.Utility.Configuration;
|
||||||
using WatchIt.Website.Services.Utility.Configuration.Model;
|
using WatchIt.Website.Services.Utility.Configuration.Model;
|
||||||
@@ -258,6 +259,64 @@ public class MediaWebAPIService : BaseWebAPIService, IMediaWebAPIService
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Roles
|
||||||
|
|
||||||
|
public async Task GetMediaAllActorRoles(long id, ActorRoleMediaQueryParameters? query = null, Action<IEnumerable<ActorRoleResponse>>? successAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Media.GetMediaAllActorRoles, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
request.Query = query;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PostMediaActorRole(long id, IActorRoleMediaRequest data, Action<ActorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Media.PostMediaActorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Post, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetMediaAllCreatorRoles(long id, CreatorRoleMediaQueryParameters? query = null, Action<IEnumerable<CreatorRoleResponse>>? successAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Media.GetMediaAllCreatorRoles, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
request.Query = query;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PostMediaCreatorRole(long id, ICreatorRoleMediaRequest data, Action<CreatorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Media.PostMediaCreatorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Post, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using WatchIt.Common.Model.Persons;
|
using WatchIt.Common.Model.Persons;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
namespace WatchIt.Website.Services.WebAPI.Persons;
|
namespace WatchIt.Website.Services.WebAPI.Persons;
|
||||||
|
|
||||||
@@ -15,4 +16,9 @@ public interface IPersonsWebAPIService
|
|||||||
Task GetPersonPhoto(long id, Action<PersonPhotoResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? notFoundAction = null);
|
Task GetPersonPhoto(long id, Action<PersonPhotoResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? notFoundAction = null);
|
||||||
Task PutPersonPhoto(long id, PersonPhotoRequest data, Action<PersonPhotoResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
Task PutPersonPhoto(long id, PersonPhotoRequest data, Action<PersonPhotoResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
Task DeletePersonPhoto(long id, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
Task DeletePersonPhoto(long id, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
|
||||||
|
Task GetPersonAllActorRoles(long id, ActorRolePersonQueryParameters? query = null, Action<IEnumerable<ActorRoleResponse>>? successAction = null);
|
||||||
|
Task PostPersonActorRole(long id, IActorRolePersonRequest data, Action<ActorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
Task GetPersonAllCreatorRoles(long id, CreatorRolePersonQueryParameters? query = null, Action<IEnumerable<CreatorRoleResponse>>? successAction = null);
|
||||||
|
Task PostPersonCreatorRole(long id, ICreatorRolePersonRequest data, Action<CreatorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
using WatchIt.Common.Model.Persons;
|
using WatchIt.Common.Model.Persons;
|
||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
using WatchIt.Common.Services.HttpClient;
|
using WatchIt.Common.Services.HttpClient;
|
||||||
using WatchIt.Website.Services.Utility.Configuration;
|
using WatchIt.Website.Services.Utility.Configuration;
|
||||||
using WatchIt.Website.Services.WebAPI.Common;
|
using WatchIt.Website.Services.WebAPI.Common;
|
||||||
@@ -187,6 +188,64 @@ public class PersonsWebAPIService : BaseWebAPIService, IPersonsWebAPIService
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Roles
|
||||||
|
|
||||||
|
public async Task GetPersonAllActorRoles(long id, ActorRolePersonQueryParameters? query = null, Action<IEnumerable<ActorRoleResponse>>? successAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Persons.GetPersonAllActorRoles, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
request.Query = query;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PostPersonActorRole(long id, IActorRolePersonRequest data, Action<ActorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Persons.PostPersonActorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Post, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetPersonAllCreatorRoles(long id, CreatorRolePersonQueryParameters? query = null, Action<IEnumerable<CreatorRoleResponse>>? successAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Persons.GetPersonAllCreatorRoles, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
request.Query = query;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PostPersonCreatorRole(long id, ICreatorRolePersonRequest data, Action<CreatorRoleResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Persons.PostPersonCreatorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Post, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
|
|
||||||
|
namespace WatchIt.Website.Services.WebAPI.Roles;
|
||||||
|
|
||||||
|
public interface IRolesWebAPIService
|
||||||
|
{
|
||||||
|
Task GetActorRole(Guid id, Action<ActorRoleResponse>? successAction = null, Action? notFoundAction = null);
|
||||||
|
Task PutActorRole(Guid id, ActorRoleRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null);
|
||||||
|
Task DeleteActorRole(Guid id, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
Task GetAllActorRoleTypes(RoleTypeQueryParameters? query = null, Action<IEnumerable<RoleTypeResponse>>? successAction = null);
|
||||||
|
Task GetActorRoleType(long typeId, Action<RoleTypeResponse>? successAction = null, Action? notFoundAction = null);
|
||||||
|
Task PostActorRoleType(RoleTypeRequest data, Action<RoleTypeResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
Task DeleteActorRoleType(long typeId, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
Task GetCreatorRole(Guid id, Action<CreatorRoleResponse>? successAction = null, Action? notFoundAction = null);
|
||||||
|
Task PutCreatorRole(Guid id, CreatorRoleRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null);
|
||||||
|
Task DeleteCreatorRole(Guid id, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
Task GetAllCreatorRoleTypes(RoleTypeQueryParameters? query = null, Action<IEnumerable<RoleTypeResponse>>? successAction = null);
|
||||||
|
Task GetCreatorRoleType(long typeId, Action<RoleTypeResponse>? successAction = null, Action? notFoundAction = null);
|
||||||
|
Task PostCreatorRoleType(RoleTypeRequest data, Action<RoleTypeResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
Task DeleteCreatorRoleType(long typeId, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null);
|
||||||
|
}
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
using WatchIt.Common.Model.Roles;
|
||||||
|
using WatchIt.Common.Services.HttpClient;
|
||||||
|
using WatchIt.Website.Services.Utility.Configuration;
|
||||||
|
using WatchIt.Website.Services.WebAPI.Common;
|
||||||
|
|
||||||
|
namespace WatchIt.Website.Services.WebAPI.Roles;
|
||||||
|
|
||||||
|
public class RolesWebAPIService : BaseWebAPIService, IRolesWebAPIService
|
||||||
|
{
|
||||||
|
#region SERVICES
|
||||||
|
|
||||||
|
private IHttpClientService _httpClientService;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
public RolesWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService)
|
||||||
|
{
|
||||||
|
_httpClientService = httpClientService;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
#region Actor
|
||||||
|
|
||||||
|
public async Task GetActorRole(Guid id, Action<ActorRoleResponse>? successAction = null, Action? notFoundAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.GetActorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor404NotFound(notFoundAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PutActorRole(Guid id, ActorRoleRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.PutActorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Put, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.RegisterActionFor404NotFound(notFoundAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DeleteActorRole(Guid id, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.DeleteActorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Delete, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetAllActorRoleTypes(RoleTypeQueryParameters? query = null, Action<IEnumerable<RoleTypeResponse>>? successAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.GetAllActorRoleTypes);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
request.Query = query;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetActorRoleType(long typeId, Action<RoleTypeResponse>? successAction = null, Action? notFoundAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.GetActorRoleType, typeId);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor404NotFound(notFoundAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PostActorRoleType(RoleTypeRequest data, Action<RoleTypeResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.PostActorRoleType);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Post, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DeleteActorRoleType(long typeId, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.DeleteActorRoleType, typeId);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Delete, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Creator
|
||||||
|
|
||||||
|
public async Task GetCreatorRole(Guid id, Action<CreatorRoleResponse>? successAction = null, Action? notFoundAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.GetCreatorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor404NotFound(notFoundAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PutCreatorRole(Guid id, CreatorRoleRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.PutCreatorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Put, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.RegisterActionFor404NotFound(notFoundAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DeleteCreatorRole(Guid id, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.DeleteCreatorRole, id);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Delete, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetAllCreatorRoleTypes(RoleTypeQueryParameters? query = null, Action<IEnumerable<RoleTypeResponse>>? successAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.GetAllCreatorRoleTypes);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
request.Query = query;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetCreatorRoleType(long typeId, Action<RoleTypeResponse>? successAction = null, Action? notFoundAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.GetCreatorRoleType, typeId);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Get, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor404NotFound(notFoundAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task PostCreatorRoleType(RoleTypeRequest data, Action<RoleTypeResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.PostCreatorRoleType);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Post, url);
|
||||||
|
request.Body = data;
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor400BadRequest(badRequestAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DeleteCreatorRoleType(long typeId, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null)
|
||||||
|
{
|
||||||
|
string url = GetUrl(EndpointsConfiguration.Roles.DeleteCreatorRoleType, typeId);
|
||||||
|
|
||||||
|
HttpRequest request = new HttpRequest(HttpMethodType.Delete, url);
|
||||||
|
|
||||||
|
HttpResponse response = await _httpClientService.SendRequestAsync(request);
|
||||||
|
response.RegisterActionFor2XXSuccess(successAction)
|
||||||
|
.RegisterActionFor401Unauthorized(unauthorizedAction)
|
||||||
|
.RegisterActionFor403Forbidden(forbiddenAction)
|
||||||
|
.ExecuteAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override string GetServiceBase() => EndpointsConfiguration.Roles.Base;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\..\WatchIt.Common\WatchIt.Common.Services\WatchIt.Common.Services.HttpClient\WatchIt.Common.Services.HttpClient.csproj" />
|
||||||
|
<ProjectReference Include="..\WatchIt.Website.Services.WebAPI.Common\WatchIt.Website.Services.WebAPI.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -51,7 +51,11 @@
|
|||||||
"DeleteMediaPoster": "/{0}/poster",
|
"DeleteMediaPoster": "/{0}/poster",
|
||||||
"GetMediaPhotos": "/{0}/photos",
|
"GetMediaPhotos": "/{0}/photos",
|
||||||
"GetMediaPhotoRandomBackground": "/{0}/photos/random_background",
|
"GetMediaPhotoRandomBackground": "/{0}/photos/random_background",
|
||||||
"PostMediaPhoto": "/{0}/photos"
|
"PostMediaPhoto": "/{0}/photos",
|
||||||
|
"GetMediaAllActorRoles": "/{0}/roles/actor",
|
||||||
|
"PostMediaActorRole": "/{0}/roles/actor",
|
||||||
|
"GetMediaAllCreatorRoles": "/{0}/roles/creator",
|
||||||
|
"PostMediaCreatorRole": "/{0}/roles/creator"
|
||||||
},
|
},
|
||||||
"Movies": {
|
"Movies": {
|
||||||
"Base": "/movies",
|
"Base": "/movies",
|
||||||
@@ -88,7 +92,28 @@
|
|||||||
"GetPersonsViewRank": "/view",
|
"GetPersonsViewRank": "/view",
|
||||||
"GetPersonPhoto": "/{0}/photo",
|
"GetPersonPhoto": "/{0}/photo",
|
||||||
"PutPersonPhoto": "/{0}/photo",
|
"PutPersonPhoto": "/{0}/photo",
|
||||||
"DeletePersonPhoto": "/{0}/photo"
|
"DeletePersonPhoto": "/{0}/photo",
|
||||||
|
"GetPersonAllActorRoles": "/{0}/roles/actor",
|
||||||
|
"PostPersonActorRole": "/{0}/roles/actor",
|
||||||
|
"GetPersonAllCreatorRoles": "/{0}/roles/creator",
|
||||||
|
"PostPersonCreatorRole": "/{0}/roles/creator"
|
||||||
|
},
|
||||||
|
"Roles": {
|
||||||
|
"Base": "/roles",
|
||||||
|
"GetActorRole": "/actor/{0}",
|
||||||
|
"PutActorRole": "/actor/{0}",
|
||||||
|
"DeleteActorRole": "/actor/{0}",
|
||||||
|
"GetAllActorRoleTypes": "/actor/type",
|
||||||
|
"GetActorRoleType": "/actor/type/{0}",
|
||||||
|
"PostActorRoleType": "/actor/type",
|
||||||
|
"DeleteActorRoleType": "/actor/type/{0}",
|
||||||
|
"GetCreatorRole": "/creator/{0}",
|
||||||
|
"PutCreatorRole": "/creator/{0}",
|
||||||
|
"DeleteCreatorRole": "/creator/{0}",
|
||||||
|
"GetAllCreatorRoleTypes": "/creator/type",
|
||||||
|
"GetCreatorRoleType": "/creator/type/{0}",
|
||||||
|
"PostCreatorRoleType": "/creator/type",
|
||||||
|
"DeleteCreatorRoleType": "/creator/type/{0}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
WatchIt.sln
14
WatchIt.sln
@@ -96,6 +96,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Con
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Genders", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Genders\WatchIt.Website.Services.WebAPI.Genders.csproj", "{B74144DE-EF62-430A-AB80-5D185DD03C05}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Genders", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Genders\WatchIt.Website.Services.WebAPI.Genders.csproj", "{B74144DE-EF62-430A-AB80-5D185DD03C05}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Roles", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Roles\WatchIt.WebAPI.Services.Controllers.Roles.csproj", "{847D157A-E486-4FB6-9AA3-43931A60FB5F}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Roles", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Roles\WatchIt.Website.Services.WebAPI.Roles.csproj", "{3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -146,6 +150,8 @@ Global
|
|||||||
{83D42D72-FF67-4577-8280-2ABD5B20F985} = {46E3711F-18BD-4004-AF53-EA4D8643D92F}
|
{83D42D72-FF67-4577-8280-2ABD5B20F985} = {46E3711F-18BD-4004-AF53-EA4D8643D92F}
|
||||||
{13BE36AB-2120-4F1B-815A-6F5E3F589EE8} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7}
|
{13BE36AB-2120-4F1B-815A-6F5E3F589EE8} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7}
|
||||||
{B74144DE-EF62-430A-AB80-5D185DD03C05} = {46E3711F-18BD-4004-AF53-EA4D8643D92F}
|
{B74144DE-EF62-430A-AB80-5D185DD03C05} = {46E3711F-18BD-4004-AF53-EA4D8643D92F}
|
||||||
|
{847D157A-E486-4FB6-9AA3-43931A60FB5F} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7}
|
||||||
|
{3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82} = {46E3711F-18BD-4004-AF53-EA4D8643D92F}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{23383776-1F27-4B5D-8C7C-57BFF75FA473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{23383776-1F27-4B5D-8C7C-57BFF75FA473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
@@ -292,5 +298,13 @@ Global
|
|||||||
{B74144DE-EF62-430A-AB80-5D185DD03C05}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B74144DE-EF62-430A-AB80-5D185DD03C05}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B74144DE-EF62-430A-AB80-5D185DD03C05}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B74144DE-EF62-430A-AB80-5D185DD03C05}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B74144DE-EF62-430A-AB80-5D185DD03C05}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B74144DE-EF62-430A-AB80-5D185DD03C05}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{847D157A-E486-4FB6-9AA3-43931A60FB5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{847D157A-E486-4FB6-9AA3-43931A60FB5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{847D157A-E486-4FB6-9AA3-43931A60FB5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{847D157A-E486-4FB6-9AA3-43931A60FB5F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
Reference in New Issue
Block a user