import { CacheManager } from '@midwayjs/cache' ; import { Inject } from '@midwayjs/decorator' ; import { Redis } from 'ioredis' ; import { getConnection , getManager , Connection , EntityManager } from 'typeorm' ; /**
 * BaseService
 */ export class BaseService { @ Inject ( 'cache:cacheManager' ) cacheManager : CacheManager ; getAdminRedis ( ) { return ( this . cacheManager . cache . store as any ) . getClient ( ) ; } getAdminCacheManager ( ) { return this . cacheManager ; } getConnection ( ) { return getConnection ( 'default' ) ; } getManager ( ) { return getManager ( 'default' ) ; } }