-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from SaintAngeLs/frontend_posts
Frontend issues resolving and adding some functionalities for posts
- Loading branch information
Showing
25 changed files
with
1,134 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Application/Queries/GetPost.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Convey.CQRS.Queries; | ||
using MiniSpace.Services.Posts.Application.Dto; | ||
|
||
namespace MiniSpace.Services.Posts.Application.Queries | ||
{ | ||
public class GetPost : IQuery<PostDto> | ||
{ | ||
public Guid PostId { get; set; } | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...osts/src/MiniSpace.Services.Posts.Infrastructure/Mongo/Queries/Handlers/GetPostHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Convey.CQRS.Queries; | ||
using Convey.Persistence.MongoDB; | ||
using MiniSpace.Services.Posts.Application.Dto; | ||
using MiniSpace.Services.Posts.Application.Queries; | ||
using MiniSpace.Services.Posts.Infrastructure.Mongo.Documents; | ||
|
||
namespace MiniSpace.Services.Posts.Infrastructure.Mongo.Queries.Handlers | ||
{ | ||
public class GetPostHandler : IQueryHandler<GetPost, PostDto> | ||
{ | ||
private readonly IMongoRepository<PostDocument, Guid> _repository; | ||
|
||
public GetPostHandler(IMongoRepository<PostDocument, Guid> repository) | ||
{ | ||
_repository = repository; | ||
} | ||
|
||
public async Task<PostDto> HandleAsync(GetPost query, CancellationToken cancellationToken) | ||
{ | ||
var post = await _repository.GetAsync(query.PostId); | ||
|
||
return post?.AsDto(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
MiniSpace.Web/src/MiniSpace.Web/Models/Events/UpdateEventModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
namespace MiniSpace.Web.Models.Events | ||
{ | ||
public class UpdateEventModel | ||
{ | ||
public Guid EventId { get; set; } | ||
public string Name { get; set; } | ||
public Guid OrganizerId { get; set; } | ||
public DateTime StartDate { get; set; } | ||
public DateTime EndDate { get; set; } | ||
public string BuildingName { get; set; } | ||
public string Street { get; set; } | ||
public string BuildingNumber { get; set; } | ||
public string ApartmentNumber { get; set; } | ||
public string City { get; set; } | ||
public string ZipCode { get; set; } | ||
public string Description { get; set; } | ||
public int Capacity { get; set; } | ||
public decimal Fee { get; set; } | ||
public string Category { get; set; } | ||
public DateTime PublishDate { get; set; } | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
MiniSpace.Web/src/MiniSpace.Web/Models/Posts/CreatePostModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
|
||
namespace MiniSpace.Web.Models.Posts | ||
{ | ||
public class CreatePostModel | ||
{ | ||
public Guid PostId { get; set; } | ||
public Guid EventId { get; set; } | ||
public Guid OrganizerId { get; set; } | ||
public string TextContent { get; set; } | ||
public string MediaContent { get; set; } | ||
public string State { get; set; } | ||
public DateTime PublishDate { get; set; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
MiniSpace.Web/src/MiniSpace.Web/Models/Posts/UpdatePostModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
|
||
namespace MiniSpace.Web.Models.Posts | ||
{ | ||
public class UpdatePostModel | ||
{ | ||
public Guid PostId { get; set; } | ||
public string TextContent { get; set; } | ||
public string MediaContent { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.