Skip to content

Conversation

@banadiga
Copy link
Member

No description provided.

Copy link
Collaborator

@flylight flylight left a 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 {
Copy link
Collaborator

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();
Copy link
Collaborator

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 {
Copy link
Collaborator

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why Object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants