Skip to content

Commit

Permalink
apache#1759 Update PushController.java
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Pujara <104253184+MananPoojara@users.noreply.github.com>
  • Loading branch information
MananPoojara authored Apr 17, 2024
1 parent e43060c commit b989eaf
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* push controller
*/
@Tag(name = "Metrics Push API | 监控数据推送API")
@Tag(name = "Metrics Push API")
@RestController
@RequestMapping(value = "/api/push", produces = {APPLICATION_JSON_VALUE})
public class PushController {
Expand All @@ -41,17 +41,17 @@ public class PushController {
private PushService pushService;

@PostMapping
@Operation(summary = "Push metric data to hertzbeat", description = "推送监控数据到hertzbeat")
@Operation(summary = "Push metric data to hertzbeat", description = "Push metric data to hertzbeat")
public ResponseEntity<Message<Void>> pushMetrics(@RequestBody PushMetricsDto pushMetricsDto) {
pushService.pushMetricsData(pushMetricsDto);
return ResponseEntity.ok(Message.success("Push success"));
}

@GetMapping()
@Operation(summary = "Get metric data for hertzbeat", description = "获取监控数据")
@Operation(summary = "Get metric data for hertzbeat", description = "Get metric data for hertzbeat")
public ResponseEntity<Message<PushMetricsDto>> getMetrics(
@Parameter(description = "监控id", example = "6565463543") @RequestParam("id") final Long id,
@Parameter(description = "上一次拉取的时间", example = "6565463543") @RequestParam("time") final Long time) {
@Parameter(description = "Monitor ID", example = "6565463543") @RequestParam("id") final Long id,
@Parameter(description = "Last pull time", example = "6565463543") @RequestParam("time") final Long time) {
PushMetricsDto pushMetricsDto = pushService.getPushMetricData(id, time);
return ResponseEntity.ok(Message.success(pushMetricsDto));
}
Expand Down

0 comments on commit b989eaf

Please sign in to comment.