Skip to content

Commit

Permalink
fix: fixed routes of endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriprado committed Nov 14, 2023
1 parent 260b2a5 commit 7f018f6
Show file tree
Hide file tree
Showing 37 changed files with 281 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.ValueObjects;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class CancelArtEventCommandHandler : IRequestHandler<CancelArtEventCommand,string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.Repositories;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class DeleteArtEventCommandHandler : IRequestHandler<DeleteArtEventCommand, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.Repositories;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class EditArtEventCommandHandler : IRequestHandler<EditArtEventCommand, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.ValueObjects;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class FinishArtEventCommandHandler : IRequestHandler<FinishArtEventCommand, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.ValueObjects;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class RegisterArtEventCommandHandler : IRequestHandler<RegisterArtEventCommand, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using PERUSTARS.ProfileManagement.Domain.Repositories;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class RegisterParticipantToArtEventCommandHandler : IRequestHandler<RegisterParticipantToArtEventCommand, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.ValueObjects;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class RescheduleArtEventCommandHandler : IRequestHandler<RescheduleArtEventCommand, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.ValueObjects;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.commands
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Commands
{
public class StartArtEventCommandHandler : IRequestHandler<StartArtEventCommand, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using PERUSTARS.CommunicationAndNotificationManagement.Domain.Model.Commands;
using PERUSTARS.CommunicationAndNotificationManagement.Domain.Services;

namespace PERUSTARS.ArtEventManagement.Application.artevents.events
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Events
{
public class ArtEventRescheduledEventHandler : INotificationHandler<ArtEventRescheduledEvent>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using PERUSTARS.CommunicationAndNotificationManagement.Domain.Services;
using PERUSTARS.Shared.Domain.Repositories;

namespace PERUSTARS.ArtEventManagement.Application.artevents.events
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Events
{
public class CancelledArtEventEventHandler : INotificationHandler<ArtEventCancelledEvent>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.domainevents;
using PERUSTARS.DataAnalytics.Interface.ACL;

namespace PERUSTARS.ArtEventManagement.Application.artevents.events
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Events
{
public class ParticipantRegisteredEventHandler : INotificationHandler<ParticipantRegisteredEvent>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.Repositories;
using PERUSTARS.ArtEventManagement.Domain.Services.ArtEvent;

namespace PERUSTARS.ArtEventManagement.Application.artevents.service
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Service
{
public class ArtEventQueryService: IArtEventQueryService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using PERUSTARS.ArtEventManagement.Domain.Model.Commads;
using PERUSTARS.ArtEventManagement.Domain.Services.ArtEvent;

namespace PERUSTARS.ArtEventManagement.Application.artevents.service
namespace PERUSTARS.ArtEventManagement.Application.ArtEvents.Service
{
public class ArtEventService : IArtEventCommandService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
using PERUSTARS.ArtEventManagement.Domain.Model.ValueObjects;
using PERUSTARS.ArtEventManagement.Domain.Services.ArtEvent;
using PERUSTARS.ArtEventManagement.Interfaces.Resources;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;

namespace PERUSTARS.ArtEventManagement.Interfaces.rest
namespace PERUSTARS.ArtEventManagement.Interfaces.REST
{
[Route("/api/v1/artevents")]
public class ArtEventController : ControllerBase
[ApiController]
[Authorize]
[Route("/api/v1/[controller]")]
public class ArtEventsController : ControllerBase
{
private readonly IMapper _mapper;
private readonly IArtEventCommandService _artEventCommandService;
private readonly IArtEventQueryService _artEventQueryService;
public ArtEventController(IMapper mapper, IArtEventCommandService artEventCommandService, IArtEventQueryService artEventQueryService)
public ArtEventsController(IMapper mapper, IArtEventCommandService artEventCommandService, IArtEventQueryService artEventQueryService)
{
_mapper = mapper;
_artEventCommandService = artEventCommandService;
Expand Down Expand Up @@ -54,7 +57,7 @@ public async Task<IActionResult> startArtEvent(int id) {

}

[HttpPut("edit")]
[HttpPut]
public async Task<IActionResult> editArtEvent([FromBody] EditArtEventCommand editArtEventCommand)
{
string response= await _artEventCommandService.editArtEvent(editArtEventCommand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
using PERUSTARS.ArtEventManagement.Domain.Model.Aggregates;
using PERUSTARS.ArtEventManagement.Domain.Model.Commads;
using PERUSTARS.ArtEventManagement.Domain.Services.Participant;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;

namespace PERUSTARS.ArtEventManagement.Interfaces.rest
namespace PERUSTARS.ArtEventManagement.Interfaces.REST
{
[Route("/api/v1/participants")]
public class ParticipantController : ControllerBase
[ApiController]
[Route("/api/v1/[controller]")]
[Authorize]
public class ParticipantsController : ControllerBase
{
private readonly IMapper _mapper;
private readonly IParticipantQueryService _participantQueryService;
private readonly IParticipantCommandService _participantCommandService;
public ParticipantController(IMapper mapper, IParticipantQueryService participantQueryService, IParticipantCommandService participantCommandService)
public ParticipantsController(IMapper mapper, IParticipantQueryService participantQueryService, IParticipantCommandService participantCommandService)
{
_mapper = mapper;
_participantQueryService = participantQueryService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
using PERUSTARS.Shared.Infrastructure.Configuration;
using PERUSTARS.ArtworkManagement.Domain.Model.Commands;
using PERUSTARS.ArtworkManagement.Interfaces.REST.Resources;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;

namespace PERUSTARS.ArtworkManagement.Interfaces.REST
{
[Authorize]
[Route("api/v1/[controller]")]
[ApiController]
public class ArtworkRecommendationsController : ControllerBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
using PERUSTARS.ArtworkManagement.Domain.Model.Commands;
using PERUSTARS.ArtworkManagement.Domain.Services;
using PERUSTARS.ArtworkManagement.Interfaces.REST.Resources;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;
using PERUSTARS.Shared.Infrastructure.Configuration;

namespace PERUSTARS.ArtworkManagement.Interfaces.REST
{
[Authorize]
[Route("api/v1/[controller]")]
[ApiController]
public class ArtworkReviewsController : ControllerBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
using PERUSTARS.Shared.Infrastructure.Configuration;
using PERUSTARS.ArtworkManagement.Domain.Model.Commands;
using PERUSTARS.ArtworkManagement.Interfaces.REST.Resources;
using Microsoft.AspNetCore.Authorization;
using System.Linq;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;

namespace PERUSTARS.ArtworkManagement.Interfaces.REST
{
[Authorize]
[Route("api/v1/[controller]")]
[ApiController]
public class ArtworksController : ControllerBase
Expand Down Expand Up @@ -64,7 +65,7 @@ public async Task<IActionResult> DeleteArtwork(long artworkId, long artistId)
}

[HttpGet]
[AllowAnonymous]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public async Task<IActionResult> GetAllArtworks()
{
var artworks = await _context.Artworks.ToListAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
using PERUSTARS.ArtworkManagement.Domain.Model.Commands;
using PERUSTARS.ArtworkManagement.Domain.Services;
using PERUSTARS.ArtworkManagement.Interfaces.REST.Resources;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;
using PERUSTARS.Shared.Infrastructure.Configuration;

namespace PERUSTARS.ArtworkManagement.Interfaces.REST
{
[Authorize]
[Route("api/v1/[controller]")]
[ApiController]
public class HobbyistFavoriteArtworksController : ControllerBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;


namespace PERUSTARS.CommunicationAndNotificationManagement.Interfaces.REST
namespace PERUSTARS.CommunicationAndNotificationManagement.Interfaces.REST
{
[Route("api/[controller]")]
[Authorize]
[Route("api/v1/[controller]")]
[ApiController]
public class NotificationsController : ControllerBase
{
private readonly INotificationCommandService _notificatioCommandService;
private readonly INotificationCommandService _notificationCommandService;
private readonly IMapper _mapper;

[HttpGet("artist/{artistId}")]
public async Task<IActionResult> GetNotificationsByArtistId(long artistId)
{
var notifications = await _notificatioCommandService.ListNotificationsReceivedBydArtistIdAsync(artistId);
var notifications = await _notificationCommandService.ListNotificationsReceivedBydArtistIdAsync(artistId);
var result = _mapper.Map<IEnumerable<NotificationResource>>(notifications);

return Ok(result);
Expand All @@ -31,7 +33,7 @@ public async Task<IActionResult> GetNotificationsByArtistId(long artistId)
[HttpGet("hobbyist/{hoobyistId}")]
public async Task<IActionResult> GetNotificationsByHobbyistId(long hoobyistId)
{
var notifications = await _notificatioCommandService.ListNotificationsReceivedByHobbyistIdAsync(hoobyistId);
var notifications = await _notificationCommandService.ListNotificationsReceivedByHobbyistIdAsync(hoobyistId);
var result = _mapper.Map<IEnumerable<NotificationResource>>(notifications);

return Ok(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,33 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;

namespace PERUSTARS.ConductsReportsManagement.Interfaces.REST
{
[Authorize]
[Route("api/v1/[controller]")]
[ApiController]
public class ConductReportController : ControllerBase
public class ConductReportsController : ControllerBase
{
private readonly IConductReportService _conductReportService;
private readonly IMapper _mapper;

public ConductReportController(IConductReportService conductReportService, IMapper mapper)
public ConductReportsController(IConductReportService conductReportService, IMapper mapper)
{
_mapper = mapper;
_conductReportService = conductReportService;
}

[HttpPost("register")]
[HttpPost]
public async Task<IActionResult> RegisterNewConductReport([FromBody] RegisterConductReport registerConductReport)
{
RegisterConductReportCommand registerConductReportCommand = _mapper.Map<RegisterConductReportCommand>(registerConductReport);
ConductReportResource conductReportResource = await _conductReportService.ExecuteRegisterConductReportCommand(registerConductReportCommand);
return Ok(conductReportResource);
}

[HttpDelete("delete/{id}")]
[HttpDelete("{id}")]
public async Task<IActionResult> DeleteConductReport(long _id)
{
DeleteConductReportCommand deleteConductReportCommand = new DeleteConductReportCommand()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
using PERUSTARS.DataAnalytics.Infrastructure.FeignClients.Resources.Response;
using System.Threading.Tasks;
using System.Net;
using PERUSTARS.IdentityAndAccountManagement.Domain.Model.Attributes;

namespace PERUSTARS.DataAnalytics.Interface.REST
{
[ApiController]
[Authorize]
[Route("api/v1/[controller]")]
public class DataAnalyticsController : ControllerBase
{
private readonly PeruStarsMLServiceFeignClient _peruStarsMLServiceFeignClient;
Expand All @@ -16,7 +19,7 @@ public DataAnalyticsController(PeruStarsMLServiceFeignClient peruStarsMLServiceF
_peruStarsMLServiceFeignClient = peruStarsMLServiceFeignClient;
}

[HttpGet("api/data-analytics/hobbyists/{hobbyistId}/recommended-artists")]
[HttpGet("hobbyists/{hobbyistId}/recommended-artists")]
public async Task<IActionResult> GetFavouristArtistsFrom(long hobbyistId)
{
MLResponse result = await _peruStarsMLServiceFeignClient.GetHobbyistRecommendedArtist(hobbyistId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace PERUSTARS.IdentityAndAccountManagement.Interfaces.REST
{
[Authorize]
[Route("api/v1/[controller]")]
[ApiController]
public class UsersController : ControllerBase
Expand Down Expand Up @@ -43,8 +44,7 @@ public async Task<IActionResult> Authenticate([FromBody] AuthenticateRequest aut
await _identityAndAccountManagementCommandService.ExecuteLogInUserCommand(logInUserCommand);
return Ok(authenticateResponse);
}

[AllowAnonymous]

[HttpPut("{userId}")]
public async Task<IActionResult> UpdateUserInformation(long userId, [FromBody] UpdateUserRequest updateUserRequest)
{
Expand Down
2 changes: 1 addition & 1 deletion PERUSTARS/PERUSTARS/PERUSTARS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational.Design" Version="1.1.6" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.11.1" />
<PackageReference Include="MySql.EntityFrameworkCore" Version="5.0.13" />
<PackageReference Include="Npgsql" Version="8.0.0-rc.2" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.4" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.11.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class RegisterProfileArtistCommand : IRequest<ArtistResource>
public Genre Genre { get; set; }
public List<string> SocialMediaLink { get; set; } //SocialNetwork
//Seguir
public List<int> FollowersArtist { get; set; }
//public List<int> FollowersArtist { get; set; }
}


Expand Down
Loading

0 comments on commit 7f018f6

Please sign in to comment.