family update
This commit is contained in:
@@ -256,4 +256,37 @@ export class MediaController {
|
||||
this.core.media.GetChatMediaAccessUrl({ requesterId, roomId, storageKey, fileName })
|
||||
);
|
||||
}
|
||||
|
||||
@Post('chat/:roomId/avatar/upload-url')
|
||||
@ApiBearerAuth()
|
||||
async createChatRoomAvatarUploadUrl(
|
||||
@Headers('authorization') authorization: string | undefined,
|
||||
@Param('roomId') roomId: string,
|
||||
@Body() dto: AvatarUploadDto
|
||||
) {
|
||||
const requesterId = await this.authUserId(authorization);
|
||||
return firstValueFrom(
|
||||
this.core.media.CreateChatRoomAvatarUploadUrl({ requesterId, roomId, contentType: dto.contentType })
|
||||
);
|
||||
}
|
||||
|
||||
@Post('chat/:roomId/avatar/confirm')
|
||||
@ApiBearerAuth()
|
||||
async confirmChatRoomAvatar(
|
||||
@Headers('authorization') authorization: string | undefined,
|
||||
@Param('roomId') roomId: string,
|
||||
@Body() dto: ConfirmAvatarDto
|
||||
) {
|
||||
const requesterId = await this.authUserId(authorization);
|
||||
return firstValueFrom(
|
||||
this.core.media.ConfirmChatRoomAvatar({ requesterId, roomId, storageKey: dto.storageKey })
|
||||
);
|
||||
}
|
||||
|
||||
@Get('chat/:roomId/avatar/url')
|
||||
@ApiBearerAuth()
|
||||
async getChatRoomAvatarUrl(@Headers('authorization') authorization: string | undefined, @Param('roomId') roomId: string) {
|
||||
const requesterId = await this.authUserId(authorization);
|
||||
return firstValueFrom(this.core.media.GetChatRoomAvatarAccessUrl({ requesterId, roomId }));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user