CommandService
説明
このサービスのメソッドは主にコマンド テーブルを操作するために使用されます。
以下のメソッドの例では、次のように CommandModule
をモジュールにインポートすると仮定します。
import { CommandModule } from "@mbc-cqrs-serverless/core";
import { Module } from "@nestjs/common";
import { CatDataSyncRdsHandler } from "./handler/cat-rds.handler";
import { CatController } from "./cat.controller";
import { CatService } from "./cat.service";
@Module({
imports: [
CommandModule.register({
tableName: "cat",
dataSyncHandlers: [CatDataSyncRdsHandler],
}),
],
controllers: [CatController],
providers: [CatService],
})
export class CatModule {}
これで、CommandService
と DataService
を他のサービスに挿入して使用できるようになります。