Skip to content
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

[refactor] move code from CollectorController to CollectorService #2433

Merged
merged 8 commits into from
Aug 9, 2024

Conversation

ceekay47
Copy link
Contributor

@ceekay47 ceekay47 commented Aug 1, 2024

What's changed?

Move code from CollectorController to CollectorService

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

@Calvin979 Calvin979 added the good first pull request Good for newcomers label Aug 1, 2024
@Calvin979 Calvin979 linked an issue Aug 1, 2024 that may be closed by this pull request
6 tasks
@yuluo-yx
Copy link
Contributor

yuluo-yx commented Aug 2, 2024

it seems that code style question: you can run mvn checkstyle:checkstyle to fix it .

@Calvin979
Copy link
Contributor

@ceekay47 Hi, please fix Backend CI on your branch when you have time.

@ceekay47
Copy link
Contributor Author

ceekay47 commented Aug 8, 2024

@Calvin979 @yuluo-yx Fixed the Checkstyle errors. Can you please take a look? Thanks.

try {
this.collectorService.deleteRegisteredCollector(collectors);
return ResponseEntity.ok(Message.success("Delete success"));
} catch (CommonException ex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed because CommonException is handled by GlobalExceptionHandler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

return ResponseEntity.ok(Message.fail(CommonConstants.FAIL_CODE, "There already has same collector name."));
try {
return ResponseEntity.ok(Message.success(collectorService.generateCollectorDeployInfo(collector)));
} catch (CommonException ex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@Calvin979
Copy link
Contributor

lgtm

@Calvin979 Calvin979 merged commit 23d16ae into apache:master Aug 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

[Task] <Move code from controller to service in module hertzbeat-manager>
3 participants