增加消息根据时间范围发送统计的查询.
This commit is contained in:
@@ -6,8 +6,10 @@ import com.xuxd.kafka.console.beans.QueryMessage;
|
||||
import com.xuxd.kafka.console.beans.ResponseData;
|
||||
import com.xuxd.kafka.console.beans.SendMessage;
|
||||
import com.xuxd.kafka.console.beans.dto.QueryMessageDTO;
|
||||
import com.xuxd.kafka.console.beans.dto.QuerySendStatisticsDTO;
|
||||
import com.xuxd.kafka.console.service.MessageService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -72,4 +74,12 @@ public class MessageController {
|
||||
}
|
||||
return messageService.delete(messages);
|
||||
}
|
||||
|
||||
@PostMapping("/send/statistics")
|
||||
public Object sendStatistics(@RequestBody QuerySendStatisticsDTO dto) {
|
||||
if (StringUtils.isEmpty(dto.getTopic())) {
|
||||
return ResponseData.create().failed("Topic is null");
|
||||
}
|
||||
return messageService.sendStatisticsByTime(dto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user