create-aomex 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -6,19 +6,18 @@ import { configs } from '@configs';
|
|
|
6
6
|
export const cache = new Caching(redisAdapter(configs.redis));
|
|
7
7
|
|
|
8
8
|
export class CacheService extends Service {
|
|
9
|
-
protected readonly
|
|
9
|
+
protected readonly demoKey = 'demo';
|
|
10
10
|
|
|
11
11
|
getHotRankings() {
|
|
12
|
-
return cache.get<
|
|
12
|
+
return cache.get<DemoItem[]>(this.demoKey, []);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
setHotRankings(value:
|
|
16
|
-
return cache.set(this.
|
|
15
|
+
setHotRankings(value: DemoItem[]) {
|
|
16
|
+
return cache.set(this.demoKey, value, 30_000);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface
|
|
20
|
+
interface DemoItem {
|
|
21
21
|
id: number;
|
|
22
22
|
name: string;
|
|
23
|
-
ranking: number;
|
|
24
23
|
}
|