From 29ac025e48ef86e1738e3f4f99ca094fcca32ce6 Mon Sep 17 00:00:00 2001 From: waiting <1661926154@qq.com> Date: Fri, 5 Apr 2024 21:23:22 +0800 Subject: [PATCH] refactor(mwcp): use MConfig instead of Config --- packages/midway-component-kmore/src/configuration.ts | 8 ++++---- .../midway-component-kmore/src/lib/db-source-manager.ts | 5 ++--- .../test/fixtures/base-app/src/10.user-auto-ctx.ts | 5 ++--- .../test/fixtures/base-app/src/52.trx-manual.ts | 3 +-- .../test/fixtures/base-app/src/55.trx-error.ts | 3 +-- .../test/fixtures/base-app/src/auto-paging.ts | 5 ++--- .../fixtures/base-app/src/cache/70a.cache.controller.ts | 3 +-- .../test/fixtures/base-app/src/cache/70b.cache.service.ts | 1 - .../test/fixtures/base-app/src/cache/70c.cache.repo.ts | 1 - .../test/fixtures/base-app/src/cache/70d.cache.repo.ts | 1 - .../base-app/src/cache/71a.ext-cache.controller.ts | 1 - .../fixtures/base-app/src/cache/71b.ext-cache.service.ts | 5 +---- .../fixtures/base-app/src/cache/71c.ext-cache.repo.ts | 1 - .../test/fixtures/base-app/src/middle-trx-auto-action.ts | 3 +-- .../base-app/src/transactional/60a.transactional.ts | 1 - .../src/transactional/61a.method-decorator.controller.ts | 1 - .../src/transactional/61a.method-decorator.service.ts | 1 - .../src/transactional/62a.class-decorator.controller.ts | 1 - .../src/transactional/62a.class-decorator.service.ts | 1 - .../test/fixtures/base-app/src/transactional/63a.args.ts | 1 - .../base-app/src/transactional/64a.supports.controller.ts | 1 - .../base-app/src/transactional/64a.supports.service.ts | 1 - .../base-app/src/transactional/65a.deep.controller.ts | 1 - .../base-app/src/transactional/65b.deep.service.ts | 5 +---- .../fixtures/base-app/src/transactional/65c.deep.repo.ts | 1 - .../base-app/src/transactional/66a.deep.controller.ts | 1 - .../base-app/src/transactional/67a.cross.controller.ts | 1 - .../base-app/src/transactional/67b.cross.service.ts | 5 +---- .../fixtures/base-app/src/transactional/67c.cross.repo.ts | 1 - .../fixtures/base-app/src/transactional/67d.cross.repo.ts | 1 - .../68a.singleton-decorator.controller.ts.todo | 1 - .../transactional/68b.singleton-decorator.service.ts.todo | 1 - .../transactional/68c.singleton-decorator.repo.ts.todo | 1 - .../test/fixtures/base-app/src/user-manaul-ctx.ts | 5 ++--- .../test/fixtures/base-app/src/user-this-ctx.ts | 5 ++--- 35 files changed, 21 insertions(+), 61 deletions(-) diff --git a/packages/midway-component-kmore/src/configuration.ts b/packages/midway-component-kmore/src/configuration.ts index 1e8737ebe..a529984ba 100644 --- a/packages/midway-component-kmore/src/configuration.ts +++ b/packages/midway-component-kmore/src/configuration.ts @@ -2,7 +2,6 @@ import assert from 'node:assert' import { App, - Config as _Config, Configuration, ILifeCycle, ILogger, @@ -19,6 +18,7 @@ import { TraceInit } from '@mwcp/otel' import { Application, IMidwayContainer, + MConfig, RegisterDecoratorHandlerParam, registerDecoratorHandler, registerMiddleware, @@ -62,10 +62,10 @@ export class AutoConfiguration implements ILifeCycle { @Logger() protected readonly logger: ILogger - @_Config(ConfigKey.config) readonly config: Config - @_Config() readonly kmoreSourceConfig: KmoreSourceConfig + @MConfig(ConfigKey.config) readonly config: Config + @MConfig() readonly kmoreSourceConfig: KmoreSourceConfig - @_Config(ConfigKey.propagationConfig) protected readonly propagationConfig: KmorePropagationConfig + @MConfig(ConfigKey.propagationConfig) protected readonly propagationConfig: KmorePropagationConfig @Inject() readonly dbSManager: DbSourceManager diff --git a/packages/midway-component-kmore/src/lib/db-source-manager.ts b/packages/midway-component-kmore/src/lib/db-source-manager.ts index bf839d8c0..a824b0bc8 100644 --- a/packages/midway-component-kmore/src/lib/db-source-manager.ts +++ b/packages/midway-component-kmore/src/lib/db-source-manager.ts @@ -2,7 +2,6 @@ import assert from 'node:assert' import { - Config as _Config, Init, Inject, Logger as _Logger, @@ -21,7 +20,7 @@ import { TraceInit, TraceService, } from '@mwcp/otel' -import type { Context } from '@mwcp/share' +import { Context, MConfig } from '@mwcp/share' import { EventCallbacks, Kmore, @@ -49,7 +48,7 @@ import { ConfigKey, KmoreSourceConfig, DbConfig } from './types.js' export class DbSourceManager extends AbstractDbSourceManager { - @_Config(ConfigKey.config) private readonly sourceConfig: KmoreSourceConfig + @MConfig(ConfigKey.config) private readonly sourceConfig: KmoreSourceConfig @_Logger() private readonly logger: ILogger diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/10.user-auto-ctx.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/10.user-auto-ctx.ts index ac1853a38..74a3eefc1 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/10.user-auto-ctx.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/10.user-auto-ctx.ts @@ -1,13 +1,12 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Inject, Param, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context, MConfig } from '@mwcp/share' import { ConfigKey, @@ -20,7 +19,7 @@ import { Db, Db2, UserDTO, UserExtDTO } from '../../../test.model.js' @Controller('/user') export class UserController { - @_Config(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig + @MConfig(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig @Inject() readonly ctx: Context @Inject() dbManager: DbManager<'master', Db> diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/52.trx-manual.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/52.trx-manual.ts index ac80f5973..3e4a1a863 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/52.trx-manual.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/52.trx-manual.ts @@ -1,14 +1,13 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, Inject, Param, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context } from '@mwcp/share' import { KmoreTransaction } from 'kmore' import { diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/55.trx-error.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/55.trx-error.ts index 0eb2ea5fa..76c3951f2 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/55.trx-error.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/55.trx-error.ts @@ -1,14 +1,13 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, Inject, Param, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context } from '@mwcp/share' import { KmoreTransaction } from 'kmore' import { diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/auto-paging.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/auto-paging.ts index 37eb3bcf4..4cc185afb 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/auto-paging.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/auto-paging.ts @@ -1,13 +1,12 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, Inject, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context, MConfig } from '@mwcp/share' import { ConfigKey, @@ -21,7 +20,7 @@ import { Db, UserDTO } from '../../../test.model.js' @Controller('/user') export class UserPagingController { - @_Config(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig + @MConfig(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig @Inject() readonly ctx: Context @Inject() dbManager: DbManager<'master', Db> diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70a.cache.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70a.cache.controller.ts index c971df5cc..4d5b16429 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70a.cache.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70a.cache.controller.ts @@ -1,10 +1,9 @@ import { - Config as _Config, Controller, Get, Inject, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context } from '@mwcp/share' import { apiPrefix, apiRoute } from '../api-route.js' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70b.cache.service.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70b.cache.service.ts index 71e78521d..d49d9b1f7 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70b.cache.service.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70b.cache.service.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Inject, InjectClient, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70c.cache.repo.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70c.cache.repo.ts index 013992956..7cedd7f7a 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70c.cache.repo.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70c.cache.repo.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70d.cache.repo.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70d.cache.repo.ts index 8d8d934f8..34a6344bc 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70d.cache.repo.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/70d.cache.repo.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71a.ext-cache.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71a.ext-cache.controller.ts index e54daccd2..e53b254e9 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71a.ext-cache.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71a.ext-cache.controller.ts @@ -1,5 +1,4 @@ import { - Config as _Config, Controller, Get, Inject, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71b.ext-cache.service.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71b.ext-cache.service.ts index 5fb8e89df..8a5a31ba0 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71b.ext-cache.service.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71b.ext-cache.service.ts @@ -1,9 +1,6 @@ import assert from 'node:assert/strict' -import { - Config as _Config, - Inject, -} from '@midwayjs/core' +import { Inject } from '@midwayjs/core' import { CacheConfigKey, initCacheManagerOptions } from '@mwcp/cache' import { Transactional } from '../../../../../dist/index.js' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71c.ext-cache.repo.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71c.ext-cache.repo.ts index a41367562..f52557f21 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71c.ext-cache.repo.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/cache/71c.ext-cache.repo.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/middle-trx-auto-action.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/middle-trx-auto-action.ts index 6c178f7d5..09cf28ad9 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/middle-trx-auto-action.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/middle-trx-auto-action.ts @@ -1,14 +1,13 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, Inject, Param, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context } from '@mwcp/share' import { KmoreTransaction } from 'kmore' import { diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/60a.transactional.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/60a.transactional.ts index f4a3992ae..08886c9ca 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/60a.transactional.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/60a.transactional.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.controller.ts index 4e79ab45f..7e3326cc8 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.controller.ts @@ -1,7 +1,6 @@ import assert from 'node:assert' import { - Config as _Config, Controller, Get, Inject, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.service.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.service.ts index 0a4f02d01..67a3adc86 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.service.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/61a.method-decorator.service.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, Provide, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.controller.ts index a21371ae5..20a7a2e65 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.controller.ts @@ -1,7 +1,6 @@ import assert from 'node:assert' import { - Config as _Config, Controller, Get, Inject, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.service.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.service.ts index cd22f3c84..3db7243c3 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.service.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/62a.class-decorator.service.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/63a.args.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/63a.args.ts index 4d930ed23..bbeb6c78f 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/63a.args.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/63a.args.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.controller.ts index c3fa7e6c9..1dfe25c75 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.controller.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.service.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.service.ts index 19c8074d3..e0df462ca 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.service.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/64a.supports.service.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65a.deep.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65a.deep.controller.ts index f8968987b..e7ea61089 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65a.deep.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65a.deep.controller.ts @@ -1,5 +1,4 @@ import { - Config as _Config, Controller, Get, Inject, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65b.deep.service.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65b.deep.service.ts index 88bdbfd3b..b51da1fc5 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65b.deep.service.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65b.deep.service.ts @@ -1,9 +1,6 @@ import assert from 'node:assert/strict' -import { - Config as _Config, - Inject, -} from '@midwayjs/core' +import { Inject } from '@midwayjs/core' import { diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65c.deep.repo.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65c.deep.repo.ts index 7f12e8191..dbe827389 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65c.deep.repo.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/65c.deep.repo.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/66a.deep.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/66a.deep.controller.ts index f4b100481..4096d1fdf 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/66a.deep.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/66a.deep.controller.ts @@ -1,5 +1,4 @@ import { - Config as _Config, Controller, Get, Inject, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67a.cross.controller.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67a.cross.controller.ts index 5318e494d..02f532344 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67a.cross.controller.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67a.cross.controller.ts @@ -1,5 +1,4 @@ import { - Config as _Config, Controller, Get, Inject, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67b.cross.service.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67b.cross.service.ts index 239985057..69ac96ad2 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67b.cross.service.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67b.cross.service.ts @@ -1,9 +1,6 @@ import assert from 'node:assert/strict' -import { - Config as _Config, - Inject, -} from '@midwayjs/core' +import { Inject } from '@midwayjs/core' import { Transactional, TrxPropagateOptions } from '../../../../../dist/index.js' import type { UserDTO } from '../../../../test.model.js' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67c.cross.repo.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67c.cross.repo.ts index 8a88f3405..4cc08102c 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67c.cross.repo.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67c.cross.repo.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67d.cross.repo.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67d.cross.repo.ts index e2f9d73a4..0c8d74684 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67d.cross.repo.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/67d.cross.repo.ts @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, } from '@midwayjs/core' diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68a.singleton-decorator.controller.ts.todo b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68a.singleton-decorator.controller.ts.todo index 1998413f1..31524c083 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68a.singleton-decorator.controller.ts.todo +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68a.singleton-decorator.controller.ts.todo @@ -1,7 +1,6 @@ import assert from 'node:assert' import { - Config as _Config, Controller, Get, Inject, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68b.singleton-decorator.service.ts.todo b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68b.singleton-decorator.service.ts.todo index cdff3396f..f0799e0e9 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68b.singleton-decorator.service.ts.todo +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68b.singleton-decorator.service.ts.todo @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, Singleton, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68c.singleton-decorator.repo.ts.todo b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68c.singleton-decorator.repo.ts.todo index 9a7d1846c..d8de3f879 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68c.singleton-decorator.repo.ts.todo +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/transactional/68c.singleton-decorator.repo.ts.todo @@ -1,7 +1,6 @@ import assert from 'node:assert/strict' import { - Config as _Config, Init, Inject, Singleton, diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/user-manaul-ctx.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/user-manaul-ctx.ts index 7dbad4f30..059792c2d 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/user-manaul-ctx.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/user-manaul-ctx.ts @@ -1,13 +1,12 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Inject, Param, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context, MConfig } from '@mwcp/share' import { ConfigKey, @@ -20,7 +19,7 @@ import { Db, Db2, UserDTO, UserExtDTO } from '../../../test.model.js' @Controller('/user2') export class User2Controller { - @_Config(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig + @MConfig(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig @Inject() readonly ctx: Context @Inject() dbManager: DbManager<'master', Db> diff --git a/packages/midway-component-kmore/test/fixtures/base-app/src/user-this-ctx.ts b/packages/midway-component-kmore/test/fixtures/base-app/src/user-this-ctx.ts index 2ae2161e8..d3711c64b 100644 --- a/packages/midway-component-kmore/test/fixtures/base-app/src/user-this-ctx.ts +++ b/packages/midway-component-kmore/test/fixtures/base-app/src/user-this-ctx.ts @@ -1,14 +1,13 @@ import assert from 'node:assert/strict' import { - Config as _Config, Controller, Get, Init, Inject, Param, } from '@midwayjs/core' -import type { Context } from '@mwcp/share' +import { Context, MConfig } from '@mwcp/share' import { ConfigKey, @@ -22,7 +21,7 @@ import { Db, UserDTO } from '../../../test.model.js' @Controller('/user_this') export class UserThisController { - @_Config(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig + @MConfig(ConfigKey.middlewareConfig) protected readonly mwConfig: MiddlewareConfig @Inject() readonly ctx: Context @Inject() dbManager: DbManager<'master', Db>