dev add statistic files protected
Test Workflow / test (push) Successful in 2s

This commit is contained in:
vladp
2026-04-16 00:28:27 +07:00
parent be62dd458a
commit 42a5368003
8 changed files with 224 additions and 1 deletions
@@ -0,0 +1,29 @@
package ru.soune.nocopy.handler;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import ru.soune.nocopy.dto.BaseRequest;
import ru.soune.nocopy.dto.BaseResponse;
import ru.soune.nocopy.dto.MessageCode;
import ru.soune.nocopy.dto.statistic.SubscriberStatisticResponse;
import ru.soune.nocopy.service.statistic.SubscriberStatisticService;
@Component
@RequiredArgsConstructor
@Slf4j
public class StatisticSubscriberHandler implements RequestHandler {
private final SubscriberStatisticService statisticService;
@Override
public BaseResponse handle(BaseRequest request) throws Exception {
SubscriberStatisticResponse statistics = statisticService.getSubscriberStatistics();
return new BaseResponse(
request.getMsgId(),
MessageCode.SUCCESS.getCode(),
MessageCode.SUCCESS.getDescription(),
statistics
);
}
}