-
Notifications
You must be signed in to change notification settings - Fork 2
Init dsl demo #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init dsl demo #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No tests
|
|
||
| @RestController | ||
| @RequestMapping(path = "/dsl") | ||
| public class DslController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why DSL ? We have some specific domain for this script, right? Then lets make this controller represents actual meaning.
|
|
||
| DelegatingScript delegatingScript = (DelegatingScript) groovy.parse(script); | ||
| delegatingScript.setDelegate(dsl); | ||
| delegatingScript.run(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is too much logic as for Controller. Lets create a service layer and move all logic into that class. Lets use controller only as communication layer
| private RatingServiceClient ratingServiceClient; | ||
|
|
||
| @GetMapping(path = "/{scriptName}") | ||
| public Object runScript(@PathVariable(name = "scriptName") String scriptName) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have @responsebody annotation or no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And why Object?
No description provided.