2021-02-05 15:19:00 +08:00

16 lines
378 B
TypeScript
Executable File

import { Get, Provide, Inject } from '@midwayjs/decorator';
import { CoolController, CoolCache } from 'midwayjs-cool-core';
@Provide()
@CoolController()
export class Home1Controller {
@Inject('cool:cache')
coolCache: CoolCache;
@Get('/1')
async home() {
const data = await this.coolCache.get('a');
console.log('获得到的数据', data)
return data;
}
}