added statistics for create and found posts
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.krylov.refound.controller;
|
||||
|
||||
import com.krylov.refound.entity.Statistics;
|
||||
import com.krylov.refound.service.StatisticsService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/v1/statistics")
|
||||
public class StatisticsController {
|
||||
private final StatisticsService statisticsService;
|
||||
|
||||
@GetMapping
|
||||
public Statistics get() {
|
||||
return statisticsService.getStatistics();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user