Add relationships feature and EF migration

This commit is contained in:
Holden
2026-06-26 17:06:15 -05:00
parent dbe33f3148
commit b3028ce741
30 changed files with 536 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using RecNet.Application.Common.Security;
using RecNet.Application.Profiles;
using RecNet.Application.Profiles.Avatar;
using AvatarEntity = RecNet.Domain.Profiles.Avatar;
namespace API.Controllers.Avatar.V1;

View File

@@ -1,6 +1,7 @@
using API.Contracts.Profiles.Responses;
using Microsoft.AspNetCore.Mvc;
using RecNet.Application.Profiles;
using RecNet.Application.Profiles.Login;
using LoginRequest = API.Contracts.Profiles.Requests.LoginRequest;
namespace API.Controllers.Profiles.V1;

View File

@@ -0,0 +1,38 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using RecNet.Application.Common.Security;
using RecNet.Application.Profiles;
using RecNet.Application.Profiles.Relationships;
namespace API.Controllers.Relationships.V1;
[Authorize]
[ApiController]
[Route("api/[controller]/v1")]
public class RelationshipsController(IRelationshipService relationshipService) : ControllerBase
{
[HttpGet("get")]
public async Task<IReadOnlyList<RelationshipDTO>> GetRelationships(CancellationToken ct)
{
var profileId = User.GetProfileId();
return await relationshipService.GetRelationshipsAsync(profileId, ct);
}
[HttpPost("update")]
public async Task<ActionResult<RelationshipDTO>> UpdateRelationship(
[FromBody] RelationshipDTO request,
CancellationToken ct)
{
var profileId = User.GetProfileId();
return Ok(
await relationshipService.UpdateRelationshipAsync
(
profileId: profileId,
command: new UpdateRelationshipCommand(request.ProfileId, request.Muted, request.Ignored),
ct: ct
)
);
}
}

View File

@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using RecNet.Application.Common.Security;
using RecNet.Application.Profiles;
using RecNet.Application.Profiles.Settings;
namespace API.Controllers.Settings.V1;