chore: src/modules/demo/service/cache.ts

This commit is contained in:
2026-07-01 17:56:35 +08:00
parent ccd037404c
commit bdfb480f49
+18
View File
@@ -0,0 +1,18 @@
import { Provide } from '@midwayjs/core';
import { CoolCache } from '@cool-midway/core';
/**
* 缓存
*/
@Provide()
export class DemoCacheService {
// 数据缓存5秒
@CoolCache(5000)
async get() {
console.log('执行方法');
return {
a: 1,
b: 2,
};
}
}