Skip to content

Commit

Permalink
Merge pull request #414 from SaintAngeLs/dev
Browse files Browse the repository at this point in the history
Astravent Version 0.1: Implement Communication Service, Update Reactions, Organizations, and Identity Systems
  • Loading branch information
SaintAngeLs authored Sep 20, 2024
2 parents dd0cecb + 91fb896 commit b47a1db
Show file tree
Hide file tree
Showing 556 changed files with 19,932 additions and 4,522 deletions.
214 changes: 212 additions & 2 deletions MiniSpace.APIGateway/src/MiniSpace.APIGateway/ntrada.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,88 @@ modules:
notifications-service:
localUrl: localhost:5006
url: notifications-service


communication:
path: /communication
routes:
- upstream: /chats
method: POST
use: downstream
downstream: communication-service/communication/chats
auth: true

- upstream: /chats/{chatId}/messages
method: POST
use: downstream
downstream: communication-service/communication/chats/{chatId}/messages
auth: true
bind:
- chatId:{chatId}

- upstream: /chats/{chatId}/users
method: PUT
use: downstream
downstream: communication-service/communication/chats/{chatId}/users
auth: true
bind:
- chatId:{chatId}

- upstream: /chats/{chatId}/messages/{messageId}/status
method: PUT
use: downstream
downstream: communication-service/communication/chats/{chatId}/messages/{messageId}/status
auth: true
bind:
- chatId:{chatId}
- messageId:{messageId}

- upstream: /chats/user/{userId}
method: GET
use: downstream
downstream: communication-service/communication/chats/user/{userId}
auth: true
bind:
- userId:{userId}

- upstream: /chats/{chatId}
method: GET
use: downstream
downstream: communication-service/communication/chats/{chatId}
auth: true
bind:
- chatId:{chatId}

- upstream: /chats/{chatId}/messages
method: GET
use: downstream
downstream: communication-service/communication/chats/{chatId}/messages
auth: true
bind:
- chatId:{chatId}

- upstream: /chats/{chatId}/{userId}
method: DELETE
use: downstream
downstream: communication-service/communication/chats/{chatId}/{userId}
auth: true
bind:
- chatId:{chatId}
- userId:{userId}

- upstream: /chats/{chatId}/messages/{messageId}
method: DELETE
use: downstream
downstream: communication-service/communication/chats/{chatId}/messages/{messageId}
auth: true
bind:
- chatId:{chatId}
- messageId:{messageId}

services:
communication-service:
localUrl: localhost:5016
url: communication-service


students:
Expand Down Expand Up @@ -349,6 +431,30 @@ modules:
downstream: students-service/students/{studentId}/notifications
auth: true

- upstream: /profiles/users/{userId}/views/paginated
method: GET
use: downstream
downstream: students-service/students/profiles/users/{userId}/views/paginated
auth: true
bind:
- userId:{userId}

- upstream: /profiles/users/{userId}/views/viewed
method: GET
use: downstream
downstream: students-service/students/profiles/users/{userId}/views/viewed
auth: true
bind:
- userId:{userId}

- upstream: /{blockerId}/blocked-users
method: GET
use: downstream
downstream: students-service/students/{blockerId}/blocked-users
auth: true
bind:
- blockerId:{blockerId}

- upstream: /{studentId}
method: PUT
use: downstream
Expand Down Expand Up @@ -392,6 +498,32 @@ modules:
downstream: students-service/students/{studentId}/notifications
auth: true

- upstream: /profiles/users/{userProfileId}/view
method: POST
use: downstream
downstream: students-service/students/profiles/users/{userProfileId}/view
auth: true
bind:
- userProfileId:{userProfileId}

- upstream: /{blockerId}/block-user/{blockedUserId}
method: POST
use: downstream
downstream: students-service/students/{blockerId}/block-user/{blockedUserId}
auth: true
bind:
- blockerId:{blockerId}
- blockedUserId:{blockedUserId}

- upstream: /{blockerId}/unblock-user/{blockedUserId}
method: POST
use: downstream
downstream: students-service/students/{blockerId}/unblock-user/{blockedUserId}
auth: true
bind:
- blockerId:{blockerId}
- blockedUserId:{blockedUserId}

- upstream: /{studentId}/languages-and-interests
method: PUT
use: downstream
Expand Down Expand Up @@ -454,6 +586,23 @@ modules:
downstream: events-service/events/student/{studentId}
auth: true

- upstream: /users/{userId}/feed
method: GET
use: downstream
downstream: events-service/events/users/{userId}/feed
auth: true
bind:
- userId:{userId}

- upstream: /users/{userId}/views/paginated
method: GET
use: downstream
downstream: events-service/events/users/{userId}/views/paginated
auth: true
bind:
- userId:{userId}


- upstream: /{eventId}
method: DELETE
use: downstream
Expand Down Expand Up @@ -483,6 +632,14 @@ modules:
downstream: events-service/events/{eventId}/show-interest
auth: true

- upstream: /{eventId}/view
method: POST
use: downstream
downstream: events-service/events/{eventId}/view
auth: true
bind:
- eventId:{eventId}

- upstream: /{eventId}/show-interest
method: DELETE
use: downstream
Expand Down Expand Up @@ -590,7 +747,7 @@ modules:
auth: true

- upstream: /search
method: POST
method: GET
use: downstream
downstream: comments-service/comments/search

Expand All @@ -615,11 +772,21 @@ modules:
downstream: reactions-service/reactions
auth: true

- upstream: /{reactionId}
method: PUT
use: downstream
downstream: reactions-service/reactions/{reactionId}
auth: true
bind:
- reactionId: {reactionId}

- upstream: /{reactionId}
method: DELETE
use: downstream
downstream: reactions-service/reactions/{reactionId}
auth: true
bind:
- reactionId: {reactionId}

- upstream: /
method: GET
Expand Down Expand Up @@ -747,6 +914,22 @@ modules:
downstream: friends-service/friends/requests/sent/{userId}
auth: true

- upstream: /{userId}/followers
method: GET
use: downstream
downstream: friends-service/friends/{userId}/followers
auth: true
bind:
- userId: {userId}

- upstream: /{userId}/following
method: GET
use: downstream
downstream: friends-service/friends/{userId}/following
auth: true
bind:
- userId: {userId}

- upstream: /requests/{userId}/withdraw
method: PUT
use: downstream
Expand All @@ -771,6 +954,14 @@ modules:
downstream: posts-service/posts
auth: true

- upstream: /users/{userId}/feed
method: GET
use: downstream
downstream: posts-service/posts/users/{userId}/feed
bind:
- userId:{userId}
auth: true

- upstream: /search
method: GET
use: downstream
Expand Down Expand Up @@ -798,6 +989,8 @@ modules:
method: GET
use: downstream
downstream: posts-service/posts/{postId}
bind:
- postId:{postId}

- upstream: /
method: GET
Expand Down Expand Up @@ -898,7 +1091,7 @@ modules:
- upstream: /users/{userId}/organizations
method: GET
use: downstream
downstream: organizations-service/users/{userId}/organizations
downstream: organizations-service/organizations/users/{userId}/organizations
auth: true
bind:
- userId: {userId}
Expand All @@ -910,6 +1103,16 @@ modules:
auth: true
bind:
- organizationId: {organizationId}

- upstream: /users/{userId}/organizations/follow
method: GET
use: downstream
downstream: organizations-service/organizations/users/{userId}/organizations/follow
auth: true
bind:
- userId: {userId}



- upstream: /{organizationId}/details/gallery-users
method: GET
Expand All @@ -926,6 +1129,13 @@ modules:
bind:
- organizationId: {organizationId}

- upstream: /{organizationId}/requests
method: GET
use: downstream
downstream: organizations-service/organizations/{organizationId}/requests
bind:
- organizationId: {organizationId}

- upstream: /paginated
method: GET
use: downstream
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiniSpace.Services.Comments.Api", "MiniSpace.Services.Comments.Api.csproj", "{A198F9BC-F912-464E-BBCB-851CFBDD320F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A198F9BC-F912-464E-BBCB-851CFBDD320F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A198F9BC-F912-464E-BBCB-851CFBDD320F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A198F9BC-F912-464E-BBCB-851CFBDD320F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A198F9BC-F912-464E-BBCB-851CFBDD320F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {331542E3-F8A0-4711-AC84-18DD6B0D3896}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using MiniSpace.Services.Comments.Application.Queries;
using MiniSpace.Services.Comments.Application.Services;
using MiniSpace.Services.Comments.Infrastructure;
using MiniSpace.Services.Comments.Core.Wrappers;

namespace MiniSpace.Services.Identity.Api
{
Expand All @@ -34,14 +35,10 @@ public static async Task Main(string[] args)
.Configure(app => app
.UseInfrastructure()
.UseEndpoints(endpoints => endpoints
.Get("", ctx => ctx.Response.WriteAsync(ctx.RequestServices.GetService<AppOptions>().Name))
.Post<SearchComments>("comments/search", async (cmd, ctx) =>
{
var pagedResult = await ctx.RequestServices.GetService<ICommentService>().BrowseCommentsAsync(cmd);
await ctx.Response.WriteJsonAsync(pagedResult);
}))
.Get("", ctx => ctx.Response.WriteAsync(ctx.RequestServices.GetService<AppOptions>().Name)))
.UseDispatcherEndpoints(endpoints => endpoints
.Get<GetComment, CommentDto>("comments/{commentID}")
.Get<SearchComments, PagedResponse<CommentDto>>("comments/search")
.Post<CreateComment>("comments")
.Put<UpdateComment>("comments/{commentID}")
.Delete<DeleteComment>("comments/{commentID}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ namespace MiniSpace.Services.Comments.Application.Commands
{
public class AddLike : ICommand
{
public Guid CommentId { get; set; }
public Guid CommentId { get; }
public Guid UserId { get; }
public string CommentContext { get; }

public AddLike(Guid commentId)
public AddLike(Guid commentId, Guid userId, string commentContext)
{
CommentId = commentId;
UserId = userId;
CommentContext = commentContext;
}
}
}
Loading

0 comments on commit b47a1db

Please sign in to comment.