mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-01-04 01:18:12 +00:00
16 lines
378 B
TypeScript
Executable File
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;
|
|
}
|
|
}
|