Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#330 udpate orgnisation servcie, layout refactoring to mudblazor #341

Merged
merged 175 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
9519f63
(#330) update organisation service api
SaintAngeLs Jul 27, 2024
4ee0f15
(#329) udpate api of organization service
SaintAngeLs Jul 28, 2024
8b85272
(#329) update commands for updated api
SaintAngeLs Jul 28, 2024
4839d1c
(#330) update organization core class and permissions
SaintAngeLs Jul 28, 2024
059a5cd
(#330) add core exception
SaintAngeLs Jul 28, 2024
f85465e
(#330) add organisation settings class
SaintAngeLs Jul 28, 2024
a1d7c10
(#330) update organistion settings class
SaintAngeLs Jul 28, 2024
817b0c5
(#330) add organisation's repositories interfaces
SaintAngeLs Jul 28, 2024
35bce7c
(#330) udpate domain events
SaintAngeLs Jul 28, 2024
b363737
(#330) update organization events, commands, commands handlers, excep…
SaintAngeLs Jul 28, 2024
31ea946
(#330) update create root organization, create organization
SaintAngeLs Jul 28, 2024
c3e6538
(#330) add organisation gallery iamges repository, add organisation i…
SaintAngeLs Jul 28, 2024
4c96094
(#330) add core events for organisation iamges updates
SaintAngeLs Jul 28, 2024
447fa13
(#330) add IOrganizationGalleryRepository
SaintAngeLs Jul 28, 2024
995be1c
(#330) update, repo meta description
SaintAngeLs Jul 28, 2024
bffb670
(#330) udpate settings meta description
SaintAngeLs Jul 28, 2024
ff6502c
(#330) add ownerId to organisation
SaintAngeLs Jul 28, 2024
b3b2f5b
(#330) add create suborganization command
SaintAngeLs Jul 28, 2024
6acad87
(#330) remove redundant external events handlers
SaintAngeLs Jul 28, 2024
fd9192e
(#330) udpate core event organization created
SaintAngeLs Jul 28, 2024
504a2f6
(#330) update core doamin organisationCreated evnet
SaintAngeLs Jul 28, 2024
3368abb
(#330) udpate create organisation handler
SaintAngeLs Jul 28, 2024
17be84d
(#330) udpate suborganisation creation command and command handler
SaintAngeLs Jul 28, 2024
4ad8dfb
(#330) add organisation repository members
SaintAngeLs Jul 28, 2024
a668e45
(#330) udpate user class to add permissions feature
SaintAngeLs Jul 28, 2024
6ef75d9
(#329) add assign role to memeber command handler, application event …
SaintAngeLs Jul 28, 2024
b2400f1
(#330) add organistaion settings repository command
SaintAngeLs Jul 28, 2024
0745ee3
(#330) add UpdateRolePermissionsHandler
SaintAngeLs Jul 28, 2024
492e119
(#330) update Inviateion to remove redundant email, Organisation, upd…
SaintAngeLs Jul 28, 2024
f61e167
(#330) udpate user organisation role
SaintAngeLs Jul 28, 2024
08feaa9
(#330) update CreateOrganizationRoleHandler
SaintAngeLs Jul 28, 2024
477f895
(#330) udpate core organization roles interface
SaintAngeLs Jul 28, 2024
4f980ce
(#330) update assignRoleTo memeber
SaintAngeLs Jul 28, 2024
31d0329
(#330) add dts, udpate organisation dtos
SaintAngeLs Jul 28, 2024
22d0304
(#330) update message to log template mapper
SaintAngeLs Jul 28, 2024
4aa74c6
(#330) update organizations documents
SaintAngeLs Jul 28, 2024
ba381a0
(#330) update persistance cqrs mongo documents
SaintAngeLs Jul 28, 2024
9be0b3d
(#330) update organization details dro
SaintAngeLs Jul 28, 2024
582cdab
(#330) add nullable parent id to the organization object
SaintAngeLs Jul 28, 2024
84a0a81
(#330) update invitation class to add organization id
SaintAngeLs Jul 28, 2024
d7c56f1
(#330) update organisation and users core ojbects
SaintAngeLs Jul 28, 2024
5862f98
(#330) refactor documents names
SaintAngeLs Jul 28, 2024
f0ca919
(#330) update core domain object for infrastructure
SaintAngeLs Jul 28, 2024
b107491
(#330) udpate gallery image dto
SaintAngeLs Jul 28, 2024
90fd8c8
(#330) update core gallery image
SaintAngeLs Jul 28, 2024
d536a6f
(#330) udpate UserDto in application
SaintAngeLs Jul 28, 2024
a819b82
(#330) update mongo mapping extensions
SaintAngeLs Jul 28, 2024
05ca328
(#330) update user object
SaintAngeLs Jul 28, 2024
a61bccb
(#330) update repository extensions
SaintAngeLs Jul 28, 2024
db50372
(#330) update user and role core classes
SaintAngeLs Jul 28, 2024
b251bd8
(#330) update organization gallery interface
SaintAngeLs Jul 28, 2024
46004b0
(#330) update organization members repository
SaintAngeLs Jul 28, 2024
fe3e13d
(#330) update organization repository interface
SaintAngeLs Jul 28, 2024
46ba4e5
(#330) update repositories implementation
SaintAngeLs Jul 28, 2024
5503242
(#330) udpate queries and queries dtos
SaintAngeLs Jul 28, 2024
fe1a5a9
(#330) update query handlers
SaintAngeLs Jul 28, 2024
7adf8eb
(#330) update repositories dispatching and collections registrations
SaintAngeLs Jul 28, 2024
9b6be8d
(#330) update api
SaintAngeLs Jul 28, 2024
0bb1b51
(#330) update build microservices script
SaintAngeLs Jul 28, 2024
4dd7f3c
(#330) update readme
SaintAngeLs Jul 28, 2024
039dbce
(#330) update founding yml
SaintAngeLs Jul 28, 2024
16cd3c8
(#330) update founding yml
SaintAngeLs Jul 28, 2024
c69ec43
(#330) api update for the commands
SaintAngeLs Jul 28, 2024
e4bba38
(#330) dispaching commands subscribing
SaintAngeLs Jul 29, 2024
9e490b6
(#330) update api routes
SaintAngeLs Jul 29, 2024
9bda2ec
(#330) update medifiles context type
SaintAngeLs Jul 29, 2024
432b05c
(#330) update core organistaion updated events and core organisation …
SaintAngeLs Jul 29, 2024
a87f4d4
(#330) update organisation update command and command handler
SaintAngeLs Jul 29, 2024
f856595
(#330) udpate subscribed commands
SaintAngeLs Jul 29, 2024
2d04f60
(#330) udpate command name
SaintAngeLs Jul 29, 2024
a8b55bb
(#330) media files service udpate for organization images
SaintAngeLs Jul 29, 2024
c12a9fa
(#330) update application events for organisation images upload
SaintAngeLs Jul 29, 2024
ad6d51c
(#330) api update -- add update organization
SaintAngeLs Jul 29, 2024
b09cef9
(#330) add some service runners script
SaintAngeLs Jul 29, 2024
dff5ff5
(#330) update ntrada file
SaintAngeLs Jul 29, 2024
afa0cc8
(#330) blazor application account components update
SaintAngeLs Jul 29, 2024
9a6c76d
(#330) update external events for 2fa enabled/disabled in stuydnet se…
SaintAngeLs Jul 29, 2024
b0e08ef
(#330) update external events handlers
SaintAngeLs Jul 29, 2024
3d3153d
(#330) subscribe to external evnets in studnet service
SaintAngeLs Jul 29, 2024
413f21c
(#330) update duplications in ntrada
SaintAngeLs Jul 29, 2024
b2c94c8
(#330) udpate styudnet update command
SaintAngeLs Jul 29, 2024
f94ae4e
(#330) update student core class
SaintAngeLs Jul 29, 2024
3b135f3
(#330) separation show accaount to components
SaintAngeLs Jul 29, 2024
ce0ae6b
(#330) update languanges core class
SaintAngeLs Jul 29, 2024
1f84980
(#330) udpate language enumerator
SaintAngeLs Jul 29, 2024
7a7bd5d
(#330) update infrastrucutre data persistance
SaintAngeLs Jul 29, 2024
7d21440
(#330) revice the show account components
SaintAngeLs Jul 29, 2024
673a2aa
(#330) update studnet service api
SaintAngeLs Jul 29, 2024
6ff89d2
(#330) update ntrada for the new studnet service endpoint
SaintAngeLs Jul 29, 2024
0c63e13
(#330) facing the issue with evnetcallbacks
SaintAngeLs Jul 30, 2024
a5e92cd
(#330) udpate student dto, using strings instead of enumerators
SaintAngeLs Jul 30, 2024
7c078cf
(#330) udpate infrastructure persistance mappings
SaintAngeLs Jul 30, 2024
d611ece
(#330) udpate user profile show acoount view component
SaintAngeLs Jul 30, 2024
c9420f7
(#330) udpate studnet domain class for addistional fields
SaintAngeLs Jul 30, 2024
e41a799
(#330) udpate event mapper for the updated external event content
SaintAngeLs Jul 30, 2024
bae1617
(#330) udpate application comands, commands handlers, and external ev…
SaintAngeLs Jul 30, 2024
11d65f3
(#330) udpate studnet dto
SaintAngeLs Jul 30, 2024
10d4f5a
(#330) udpate student infrastructure events
SaintAngeLs Jul 30, 2024
c8082f7
(#330) udpate the issue with imports using
SaintAngeLs Jul 30, 2024
02f600d
(#330) udpate main layout and drawers
SaintAngeLs Jul 30, 2024
e9a627d
(#330) unauthenticated user layout update
SaintAngeLs Jul 30, 2024
1013501
(#330) studentDto update
SaintAngeLs Jul 30, 2024
663ac53
(#330) show account view refactor
SaintAngeLs Jul 30, 2024
528b346
(#330) udpate UpdateStudnet command
SaintAngeLs Jul 30, 2024
f22cede
(#330) udpate core studnet class to add udpate date of birth
SaintAngeLs Jul 30, 2024
ac9b20a
(#330) udpate command handlers after core object updated
SaintAngeLs Jul 30, 2024
c099278
(#330) udpate evnet mapper
SaintAngeLs Jul 30, 2024
e998ccb
(#330) show account update
SaintAngeLs Jul 30, 2024
50d0ee9
(#330) add date of birth no studnet service in blazor application, up…
SaintAngeLs Jul 30, 2024
50dd1da
(#330) profile component update
SaintAngeLs Jul 30, 2024
e6703cf
(#330) media files service update
SaintAngeLs Jul 30, 2024
6fa0505
(#330) update profile component with cropping modal window
SaintAngeLs Jul 30, 2024
a2f7d78
(#330) remove acl from backet settings
SaintAngeLs Jul 30, 2024
4a10c4b
(#330) update cropper instance
SaintAngeLs Jul 30, 2024
d3e75d3
(#330) update studnet banner update in profile razor page
SaintAngeLs Jul 31, 2024
19be235
(#330) update rwd for profile component
SaintAngeLs Jul 31, 2024
8983842
(#330) update profile banner to use MudImage instead
SaintAngeLs Jul 31, 2024
370d60e
(#330) update readme
SaintAngeLs Jul 31, 2024
8125385
(#330) add defult benner image
SaintAngeLs Jul 31, 2024
4059d3c
(#330) profile component buttons update
SaintAngeLs Jul 31, 2024
826e396
(#330) update gallery iamge core class
SaintAngeLs Jul 31, 2024
5387c28
(#330) update user gallery core class
SaintAngeLs Jul 31, 2024
fefd4a2
(#330) remove description
SaintAngeLs Jul 31, 2024
56d21a1
(#330) udpate gallery component
SaintAngeLs Jul 31, 2024
fc08411
(#330) remove redundant razor page
SaintAngeLs Jul 31, 2024
674880a
(#330) udpate gallery component
SaintAngeLs Jul 31, 2024
52837f5
(#330) issue with ballery images uplaod
SaintAngeLs Jul 31, 2024
a3272f3
(#330) resolveing the previous issue with gallery
SaintAngeLs Jul 31, 2024
6a36296
(#330) update files validator
SaintAngeLs Jul 31, 2024
8f090c6
(#330) medifiles update to store blobs
SaintAngeLs Jul 31, 2024
86b2120
(#330) update medifiles service to use bytes to read
SaintAngeLs Jul 31, 2024
75484ed
(#330) refactoring storing images as array of bytes
SaintAngeLs Jul 31, 2024
85c59de
(#330) add practical loggerm lirddleware
SaintAngeLs Jul 31, 2024
e9ea83a
(#330) configure api gateway medi file post endpoint
SaintAngeLs Jul 31, 2024
6d30fc4
(#330) udpate images upload command
SaintAngeLs Jul 31, 2024
0cdd916
(#330) udpate mediafiles infrastructure service
SaintAngeLs Jul 31, 2024
e9d7be0
(#330) udpate gallery compoment for the bytes of images field update
SaintAngeLs Aug 1, 2024
c8249ca
(#330) update the gellery razor component
SaintAngeLs Aug 1, 2024
98fecbd
(#330) update galeery component for user
SaintAngeLs Aug 1, 2024
8459c72
#330 update mediafiles service evens for mediafile deleated
SaintAngeLs Aug 1, 2024
679580b
(#330) update medifiles service infrastrucure to correctly hande wepb…
SaintAngeLs Aug 1, 2024
6b4d915
(#330) medifile deleted external evnet update, MediaFileDeleted evnet…
SaintAngeLs Aug 1, 2024
d5abeba
(#330) update user galery repository method
SaintAngeLs Aug 1, 2024
48b8197
(#330) add myOranizations page, add organizations dtos
SaintAngeLs Aug 1, 2024
6ae715e
(#330) add organizations dtos
SaintAngeLs Aug 1, 2024
500cf0b
(#330) update namespaces
SaintAngeLs Aug 1, 2024
a90e085
(#330) add orgnization service commands dtos
SaintAngeLs Aug 1, 2024
a12844c
(#330) update organisation service
SaintAngeLs Aug 1, 2024
48e30c5
(#330) remove the curved and redundand radzen compoments for organisa…
SaintAngeLs Aug 1, 2024
de3ecd1
(#330) remove other dialogs related to organisations
SaintAngeLs Aug 1, 2024
4be6934
(#330) modify custom http client response, add creaet organisation page
SaintAngeLs Aug 1, 2024
70c997f
(#330) udpate create organisation command
SaintAngeLs Aug 1, 2024
2fb6854
(#330) organizations service -- update applciation command handler to…
SaintAngeLs Aug 1, 2024
ccd6c65
(#330) udpate organisation create view
SaintAngeLs Aug 1, 2024
48f5ca7
(#330) udpate organizationDto in balzor application
SaintAngeLs Aug 1, 2024
ec85b56
(#330) add get user's organizations handler
SaintAngeLs Aug 2, 2024
cfe5078
(#330) add query handler for get users organisations
SaintAngeLs Aug 2, 2024
434f840
(#330) update organization api
SaintAngeLs Aug 2, 2024
3949aa6
(#330) update apigateway
SaintAngeLs Aug 2, 2024
eb3854a
(#330) udpate organisation creation form
SaintAngeLs Aug 2, 2024
c940463
(#330) udpate create organisation command
SaintAngeLs Aug 2, 2024
65a7483
(#330) udpate organisation page, add paramaters of visibility and pri…
SaintAngeLs Aug 2, 2024
673d9e0
(#330) suplament organizationDto with organizationDetailsDto for orga…
SaintAngeLs Aug 2, 2024
5699549
(#330) update infrastructure query handler
SaintAngeLs Aug 2, 2024
4b5d2d6
(#330) udpate organization service api for new request
SaintAngeLs Aug 2, 2024
d23d91a
(#330) udpate apigateway
SaintAngeLs Aug 2, 2024
0bffaeb
(#330) add organization pages for administrator and user
SaintAngeLs Aug 2, 2024
88cd5c7
(#330) udpate organization service in balzor application
SaintAngeLs Aug 2, 2024
04387e3
(#330) udpate organizationDetailsDto
SaintAngeLs Aug 2, 2024
2ee0539
(#330) update infrastructure query handler
SaintAngeLs Aug 2, 2024
c5286b6
(#330) update dtos
SaintAngeLs Aug 2, 2024
6a6fff7
(#330) udpate web applciation dtos, udpate organization details razor…
SaintAngeLs Aug 2, 2024
998262b
(#330) update organization profile page maket
SaintAngeLs Aug 2, 2024
bea1552
(#330) aligning organization details page
SaintAngeLs Aug 2, 2024
f2884bb
(#330) udpate mudimage and mudavatar for organization
SaintAngeLs Aug 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: @SaintAngeLs
patreon: patreon.com/SaintAngeLs
github: SaintAngeLs
patreon: SaintAngeLs
9 changes: 3 additions & 6 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository:
name: distributed_minispace

# A short description of the repository that will show up on GitHub
description: "Microservices-based social network built with .NET8 and ASP .NET Core Blazor Server, employing DDD principles."
description: "Microservices-based social network built with .NET8 and ASP .NET Core Blazor Server, employing DDD principles. Offers a scalable and efficient technical solution for social media applications enginine, leveraging CQRS, MongoDB, SignalR, .NET ML, Elasticsearch and event-driven architecture to ensure high performance and reliability."

# A URL with more information about the repository
homepage: https://minispace.itsharppro.com
Expand Down Expand Up @@ -113,11 +113,8 @@ milestones:
state: open

# Collaborators: give specific users access to this repository.
collaborators:
- username: eggwhat
permission: push
- username: an2508374
permission: push
# collaborators:


# Note: `permission` is only valid on organization-owned repositories.
# The permission to grant the collaborator. Can be one of:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build_microservices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
include:
- project: 'MiniSpace.APIGateway/src/MiniSpace.APIGateway'
- project: 'MiniSpace.Services.Identity/src/MiniSpace.Services.Identity.Api'
test_dir: 'MiniSpace.Services.Identity/tests'
- project: 'MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Api'
test_dir: 'MiniSpace.Services.Posts/tests'
# test_dir: 'MiniSpace.Services.Identity/tests'
- project: 'MiniSpace.Services.Comments/src/MiniSpace.Services.Comments.Api'
test_dir: 'MiniSpace.Services.Comments/tests'
# - project: 'MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Api'
# test_dir: 'MiniSpace.Services.Organizations/tests'
# test_dir: 'MiniSpace.Services.Comments/tests'
- project: 'MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Api'
# test_dir: 'MiniSpace.Services.Organizations/tests'
- project: 'MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Api'
test_dir: 'MiniSpace.Services.Posts/tests'
# test_dir: 'MiniSpace.Services.Posts/tests'
- project: 'MiniSpace.Services.Email/src/MiniSpace.Services.Email.Api'
- project: 'MiniSpace.Services.Notifications/src/MiniSpace.Services.Notifications.Api'
- project: 'MiniSpace.Services.Reactions/src/MiniSpace.Services.Reactions.Api'
test_dir: 'MiniSpace.Services.Reactions/tests'
# test_dir: 'MiniSpace.Services.Reactions/tests'
- project: 'MiniSpace.Services.Events/src/MiniSpace.Services.Events.Api'
test_dir: 'MiniSpace.Services.Events/tests'
# test_dir: 'MiniSpace.Services.Events/tests'
- project: 'MiniSpace.Services.Students/src/MiniSpace.Services.Students.Api'
test_dir: 'MiniSpace.Services.Students/tests'
# test_dir: 'MiniSpace.Services.Students/tests'
- project: 'MiniSpace.Web/src/MiniSpace.Web'
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion MiniSpace.APIGateway/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
export ASPNETCORE_ENVIRONMENT=local
cd src/MiniSpace.APIGateway
cd ../src/MiniSpace.APIGateway
dotnet run
121 changes: 93 additions & 28 deletions MiniSpace.APIGateway/src/MiniSpace.APIGateway/ntrada.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,14 @@ modules:
downstream: students-service/students/{studentId}/notifications
auth: true

- upstream: /{studentId}/languages-and-interests
method: PUT
use: downstream
downstream: students-service/students/{studentId}/languages-and-interests
bind:
- studentId:{studentId}
auth: true

services:
students-service:
localUrl: localhost:5007
Expand Down Expand Up @@ -792,6 +800,10 @@ modules:
use: downstream
downstream: mediafiles-service/media-files
auth: true
requestSizeLimit: 50_000_000 # Example: Limit to 50 MB
formLimits:
multipartBodyLengthLimit: 50_000_000 # Optional: Same as above to ensure large files are allowed


- upstream: /{mediaFileId}
method: GET
Expand Down Expand Up @@ -825,6 +837,47 @@ modules:
downstream: organizations-service/organizations
auth: true

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

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

- upstream: /root
method: GET
use: downstream
downstream: organizations-service/organizations/root

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

- upstream: /{organizationId}/children/all
method: GET
use: downstream
downstream: organizations-service/organizations/{organizationId}/children/all

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

- upstream: /{organizationId}/details/gallery-users
method: GET
use: downstream
downstream: organizations-service/organizations/{organizationId}/details/gallery-users
bind:
- organizationId: {organizationId}


- upstream: /{organizationId}
method: DELETE
use: downstream
Expand All @@ -836,52 +889,64 @@ modules:
use: downstream
downstream: organizations-service/organizations/{organizationId}/children
auth: true
- upstream: /{organizationId}/organizer

- upstream: /{organizationId}/roles
method: POST
use: downstream
downstream: organizations-service/organizations/{organizationId}/organizer
downstream: organizations-service/organizations/{organizationId}/roles
auth: true
- upstream: /{organizationId}/organizer/{organizerId}
method: DELETE

- upstream: /{organizationId}/roles/{roleId}/permissions
method: PUT
use: downstream
downstream: organizations-service/organizations/{organizationId}/organizer/{organizerId}
downstream: organizations-service/organizations/{organizationId}/roles/{roleId}/permissions
auth: true
- upstream: /{organizationId}
method: GET

- upstream: /{organizationId}/invite
method: POST
use: downstream
downstream: organizations-service/organizations/{organizationId}

- upstream: /{organizationId}/details
method: GET
downstream: organizations-service/organizations/{organizationId}/invite
auth: true

- upstream: /{organizationId}/roles/{memberId}
method: POST
use: downstream
downstream: organizations-service/organizations/{organizationId}/details
downstream: organizations-service/organizations/{organizationId}/roles/{memberId}
auth: true

- upstream: /root
method: GET
- upstream: /{organizationId}/privacy
method: POST
use: downstream
downstream: organizations-service/organizations/root

- upstream: /{organizationId}/children
method: GET
downstream: organizations-service/organizations/{organizationId}/privacy
auth: true

- upstream: /{organizationId}/settings
method: PUT
use: downstream
downstream: organizations-service/organizations/{organizationId}/children
downstream: organizations-service/organizations/{organizationId}/settings
auth: true

- upstream: /{organizationId}/children/all
method: GET
- upstream: /{organizationId}/visibility
method: PUT
use: downstream
downstream: organizations-service/organizations/{organizationId}/children/all
downstream: organizations-service/organizations/{organizationId}/visibility
auth: true

- upstream: /organizer/{organizerId}
method: GET
- upstream: /{organizationId}/feed
method: PUT
use: downstream
downstream: organizations-service/organizations/{organizationId}/feed
auth: true

- upstream: /{organizationId}
method: PUT
use: downstream
downstream: organizations-service/organizations/organizer/{organizerId}
downstream: organizations-service/organizations/{organizationId}
auth: true

services:
organizations-service:
localUrl: localhost:5015
url: organizations-service


Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using MiniSpace.Services.MediaFiles.Infrastructure;
using DotNetEnv;
using Convey.CQRS.Commands;
using System.Text;

namespace MiniSpace.Services.MediaFiles.Api
{
Expand All @@ -35,6 +36,7 @@ await WebHost.CreateDefaultBuilder(args)
.AddInfrastructure()
.Build())
.Configure(app => app
// .UseMiddleware<RequestLoggingMiddleware>()
.UseInfrastructure()
.UseEndpoints(endpoints => endpoints
.Post<UploadMediaFile>("media-files", async (cmd, ctx) =>
Expand All @@ -54,4 +56,35 @@ await WebHost.CreateDefaultBuilder(args)
.RunAsync();
}
}



// public class RequestLoggingMiddleware
// {
// private readonly RequestDelegate _next;

// public RequestLoggingMiddleware(RequestDelegate next)
// {
// _next = next;
// }

// public async Task Invoke(HttpContext context)
// {
// // Enable buffering so we can read the request body multiple times
// context.Request.EnableBuffering();

// // Read the request body as a string
// var requestBody = await new StreamReader(context.Request.Body, Encoding.UTF8, leaveOpen: true).ReadToEndAsync();

// // Log the request body
// Console.WriteLine("Request Body:");
// Console.WriteLine(requestBody);

// // Reset the request body stream position so the next middleware can read it
// context.Request.Body.Position = 0;

// // Continue processing the request
// await _next(context);
// }
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ public async Task HandleAsync(DeleteMediaFile command, CancellationToken cancell
await _s3Service.DeleteFileAsync(fileSourceInfo.OriginalFileUrl);
await _s3Service.DeleteFileAsync(fileSourceInfo.FileUrl);
await _fileSourceInfoRepository.DeleteAsync(decodedUrl);
await _messageBroker.PublishAsync(new MediaFileDeleted(decodedUrl,
fileSourceInfo.SourceId, fileSourceInfo.SourceType.ToString()));
await _messageBroker.PublishAsync(new MediaFileDeleted(
decodedUrl,
fileSourceInfo.SourceId,
fileSourceInfo.SourceType.ToString(),
fileSourceInfo.UploaderId));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Convey.CQRS.Commands;
using Microsoft.AspNetCore.Http;
using System;

namespace MiniSpace.Services.MediaFiles.Application.Commands
{
Expand All @@ -11,18 +11,18 @@ public class UploadMediaFile : ICommand
public Guid UploaderId { get; set; }
public string FileName { get; set; }
public string FileContentType { get; set; }
public string Base64Content { get; set; }
public byte[] FileData { get; set; }

public UploadMediaFile(Guid mediaFileId, Guid sourceId, string sourceType, Guid uploaderId,
string fileName, string fileContentType, string base64Content)
string fileName, string fileContentType, byte[] fileData)
{
MediaFileId = mediaFileId == Guid.Empty ? Guid.NewGuid() : mediaFileId;
SourceId = sourceId;
SourceType = sourceType;
UploaderId = uploaderId;
FileName = fileName;
FileContentType = fileContentType;
Base64Content = base64Content;
FileData = fileData;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ public class MediaFileDeleted : IEvent
public string MediaFileUrl { get; }
public Guid SourceId { get; }
public string Source { get; }
public Guid UploaderId { get; }

public MediaFileDeleted(string mediaFileUrl, Guid sourceId, string source)
public MediaFileDeleted(string mediaFileUrl, Guid sourceId, string source, Guid uploaderId)
{
MediaFileUrl = mediaFileUrl;
SourceId = sourceId;
Source = source;
UploaderId = uploaderId;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Convey.CQRS.Events;
using System;

namespace MiniSpace.Services.MediaFiles.Application.Events
{
public class OrganizationImageUploaded : IEvent
{
public Guid OrganizationId { get; }
public string ImageUrl { get; }
public string ImageType { get; }
public DateTime UploadDate { get; }

public OrganizationImageUploaded(Guid organizationId, string imageUrl, string imageType, DateTime uploadDate)
{
OrganizationId = organizationId;
ImageUrl = imageUrl;
ImageType = imageType;
UploadDate = uploadDate;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Convey.CQRS.Events;
using System;

namespace MiniSpace.Services.MediaFiles.Application.Events.External
namespace MiniSpace.Services.MediaFiles.Application.Events
{
public class StudentImageUploaded : IEvent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
public class InvalidFileSizeException : AppException
{
public override string Code { get; } = "invalid_file_size";
public int FileSize { get; }
public int MaxFileSize { get; }
public long FileSize { get; }
public long MaxFileSize { get; }

public InvalidFileSizeException(int fileSize, int maxFileSize)
public InvalidFileSizeException(long fileSize, long maxFileSize)
: base($"Invalid file size: {fileSize}. Maximum valid file size: {maxFileSize}.")
{
FileSize = fileSize;
Expand Down
Loading
Loading