-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Trigger 支持 IoC ExecutionContainer (#19)
* feat(trigger): support execution container * chore: add todo remark * chore: update pipeline
- Loading branch information
1 parent
52ad74b
commit 20f3446
Showing
11 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'reflect-metadata'; | ||
import { Inject, Injectable, ScopeEnum } from '@artus/injection'; | ||
import TestService from '../services/hello'; | ||
|
||
// TODO: 待实现 Controller/Route 装饰器 | ||
@Injectable({ | ||
scope: ScopeEnum.EXECUTION | ||
}) | ||
export default class HelloController { | ||
@Inject(TestService) | ||
// @ts-ignore | ||
helloService: HelloService; | ||
|
||
async index () { | ||
return { | ||
status: 200, | ||
content: 'Hello Artus', | ||
headers: { | ||
...this.helloService?.getTestHeaders() | ||
} | ||
}; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'reflect-metadata'; | ||
import { Inject, Injectable, ScopeEnum } from '@artus/injection'; | ||
|
||
@Injectable({ | ||
scope: ScopeEnum.EXECUTION | ||
}) | ||
export default class HelloService { | ||
@Inject('headers') | ||
// @ts-ignore | ||
headers: Record<string, any>; | ||
|
||
public getTestHeaders() { | ||
return { | ||
['x-hello-artus']: this.headers['x-hello-artus'] | ||
}; | ||
} | ||
} |