Skip to content

Commit 5993a6b

Browse files
committed
fix: test.ts missing
1 parent 77035c3 commit 5993a6b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

  • framework-ts/yadan/app/service
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)