Files
cms-website/apps/api/src/modules/publish/publish.module.ts
T

29 lines
1.1 KiB
TypeScript
Raw Normal View History

// publish 域 Nest 模块(Plan 4 Task 1):注册 PublishService 供 standalone context
// 使用(NestFactory.createApplicationContext(PublishModule)——本切片 API 不监听端口,ADR-002)。
// 与 source.module.ts / import.module.ts 同构薄壳:逻辑全在 publish.service.ts 的
// 零装饰器独立函数里,本类只提供 DI 语境下的调用面;'reflect-metadata' 置顶
// (CLI/测试直接 import publish.service.ts 纯函数文件,不经本模块,故无需提前加载
// reflect-metadata)。
import 'reflect-metadata'
import { Injectable, Module } from '@nestjs/common'
import {
publishSiteContent,
type PublishDb,
type PublishSiteContentInput,
type PublishSiteContentResult,
} from './publish.service.js'
/** publishSiteContent 的 Nest 注入壳(standalone context / 后续 REST 通道复用同一实现) */
@Injectable()
export class PublishService {
publish(db: PublishDb, input: PublishSiteContentInput): Promise<PublishSiteContentResult> {
return publishSiteContent(db, input)
}
}
@Module({
providers: [PublishService],
exports: [PublishService],
})
export class PublishModule {}