All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.jhipster.lite.statistic.infrastructure.primary.StatisticsResources Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package tech.jhipster.lite.statistic.infrastructure.primary;

import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.jhipster.lite.statistic.application.StatisticsApplicationService;
import tech.jhipster.lite.statistic.domain.criteria.StatisticsCriteria;

@RestController
@Tag(name = "Statistics")
@RequestMapping("/api/statistics")
class StatisticsResources {

  private final StatisticsApplicationService statistics;

  public StatisticsResources(StatisticsApplicationService statistics) {
    this.statistics = statistics;
  }

  @GetMapping
  @ApiResponse(description = "JHipster lite usage statistics", responseCode = "200")
  ResponseEntity getStatistics(RestStatisticsCriteria criteria) {
    StatisticsCriteria statisticsCriteria = criteria.toDomain();
    return ResponseEntity.ok(RestStatistics.from(statistics.get(statisticsCriteria)));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy