lab4: S3-вложения, presigned upload и проверки

This commit is contained in:
Vladislav Kunetskiy
2026-10-21 22:42:48 +03:00
parent d342b2a227
commit 49c2fe3071
79 changed files with 12266 additions and 910 deletions
+22 -11
View File
@@ -44,11 +44,12 @@ type httpResult struct {
}
type routerFixture struct {
users *mocks.MockUserService
chats *mocks.MockChatService
messages *mocks.MockMessageService
health *mocks.MockHealthChecker
sessions *mocks.MockSessionActions
users *mocks.MockUserService
chats *mocks.MockChatService
messages *mocks.MockMessageService
attachments *mocks.MockAttachmentService
health *mocks.MockHealthChecker
sessions *mocks.MockSessionActions
server *httptest.Server
}
@@ -60,18 +61,28 @@ func newRouterFixture(t *testing.T) *routerFixture {
t.Helper()
fixture := &routerFixture{
users: mocks.NewMockUserService(t),
chats: mocks.NewMockChatService(t),
messages: mocks.NewMockMessageService(t),
health: mocks.NewMockHealthChecker(t),
sessions: mocks.NewMockSessionActions(t),
users: mocks.NewMockUserService(t),
chats: mocks.NewMockChatService(t),
messages: mocks.NewMockMessageService(t),
attachments: mocks.NewMockAttachmentService(t),
health: mocks.NewMockHealthChecker(t),
sessions: mocks.NewMockSessionActions(t),
}
router, err := rest.NewRouter(
rest.NewHandler(fixture.users, fixture.chats, fixture.messages, fixture.health, fixture.sessions),
rest.NewHandler(
fixture.users,
fixture.chats,
fixture.messages,
fixture.attachments,
fixture.health,
fixture.sessions,
),
rest.NewSecurityHandler(fixture.sessions),
nil,
logger.New(logger.WithLevel(slog.LevelError)),
testMaxBodyBytes,
testMaxBodyBytes,
)
require.NoError(t, err)