We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 77035c3 commit 5993a6bCopy full SHA for 5993a6b
1 file changed
framework-ts/yadan/app/service/test.ts
@@ -0,0 +1,24 @@
1
+import { Context, EggAppConfig, Service } from 'egg'
2
+
3
4
+/**
5
+ * Test Service
6
+ */
7
+export default class Test extends Service {
8
+ config: EggAppConfig
9
10
+ constructor(ctx: Context) {
11
+ super(ctx)
12
+ this.config = <EggAppConfig> this.app.config.test
13
+ }
14
15
+ async get(id: number) {
16
+ return { id, name: this.config.key }
17
18
+}
19
20
+declare module 'egg' {
21
+ export interface IService {
22
+ test: Test
23
24
0 commit comments