From 11395279af2d57ebd243ef2a1f0115617bbda56b Mon Sep 17 00:00:00 2001 From: "saito.k" Date: Tue, 26 Nov 2024 08:45:27 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20954:=20NotificationHub=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task4580: NotificationHubへのデバイス登録方法を修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/4580) - NotificationHubのデバイス登録時に付与するInstallationIDをuuidからuserIdに変更 ## 動作確認状況 - ローカルで確認、develop環境で確認など - 修正範囲がNotificationHubのserviceに閉じているため、既存のテストが通ることを確認したのみ ## 補足 - 相談、参考資料などがあれば --- .../src/features/notification/notification.service.ts | 5 ++--- .../src/gateways/blobstorage/blobstorage.service.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dictation_server/src/features/notification/notification.service.ts b/dictation_server/src/features/notification/notification.service.ts index 2d9edda..a329c08 100644 --- a/dictation_server/src/features/notification/notification.service.ts +++ b/dictation_server/src/features/notification/notification.service.ts @@ -54,9 +54,8 @@ export class NotificationService { } try { - // TODO: 登録毎に新規登録する想定でUUIDを付与している - // もしデバイスごとに登録を上書きするようであればUUID部分にデバイス識別子を設定 - const installationId = `${pns}_${userId}_${uuidv4()}`; + // installationIdにuserIdを設定し、1ユーザー1端末の登録にする + const installationId = `odms-user-${userId}`; this.logger.log(`[${context.getTrackingId()}] ${installationId}`); await this.notificationhubService.register( diff --git a/dictation_server/src/gateways/blobstorage/blobstorage.service.ts b/dictation_server/src/gateways/blobstorage/blobstorage.service.ts index fcd8301..65a71c6 100644 --- a/dictation_server/src/gateways/blobstorage/blobstorage.service.ts +++ b/dictation_server/src/gateways/blobstorage/blobstorage.service.ts @@ -521,7 +521,16 @@ export class BlobstorageService { } | params: { ` + `accountId: ${accountId} };`, ); + // アカウントIDをもとにblobのリージョンマッピング用テーブルからストレージアカウントの情報を取得する const containerName = `account-${accountId}`; + if (accountId) { + const blobService = new BlobServiceClient( + '', + new StorageSharedKeyCredential('', ''), + ); + return blobService.getContainerClient(containerName); + } + if (BLOB_STORAGE_REGION_US.includes(country)) { return this.blobServiceClientUS.getContainerClient(containerName); } else if (BLOB_STORAGE_REGION_AU.includes(country)) {