package com.ndpmedia.rocketmq.cockpit.controller.api;

import com.ndpmedia.rocketmq.cockpit.model.*;
import com.ndpmedia.rocketmq.cockpit.mybatis.mapper.ConsumeProgressMapper;
import com.ndpmedia.rocketmq.cockpit.util.LoginConstant;
import com.ndpmedia.rocketmq.cockpit.util.WebHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping(value = "/api/topic-progress")
public class TopicProgressServiceController {

    @Autowired
    private ConsumeProgressMapper consumeProgressMapper;

    @RequestMapping(method = RequestMethod.GET)
    @ResponseBody
    public List<String> list(HttpServletRequest request) {
        return consumeProgressMapper.topicList(null);
    }

    @RequestMapping(value = "/{topic}", method = RequestMethod.GET)
    @ResponseBody
    public List<ConsumeProgress> list(@PathVariable("topic") String topic){
        return consumeProgressMapper.brokerTPSList(null, topic, null, -1);
    }
}

@@ -51,39 +51,38 @@
 pi;%0A%0Aimport com.
-ndpmedi
+alibab
 a.rocketmq.cockp
@@ -81,22 +81,41 @@
 mq.c
-ockpit.model.*
+lient.exception.MQClientException
 ;%0Aim
@@ -115,39 +115,38 @@
 ion;%0Aimport com.
-ndpmedi
+alibab
 a.rocketmq.cockp
@@ -144,52 +144,103 @@
 tmq.
-cockpit.mybatis.mapper.ConsumeProgressMapper
+remoting.exception.RemotingException;%0Aimport com.alibaba.rocketmq.tools.admin.DefaultMQAdminExt
 ;%0Aim
@@ -278,26 +278,29 @@
 pit.
-util.LoginConstant
+model.ConsumeProgress
 ;%0Aim
@@ -338,19 +338,41 @@
 pit.
-util.WebHel
+mybatis.mapper.ConsumeProgressMap
 per;
@@ -536,78 +536,325 @@
 ion.
-*;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport java.util.Lis
+PathVariable;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Se
 t;%0A%0A
@@ -1378,16 +1378,17 @@
 g topic)
+ 
 %7B%0A      
@@ -1461,11 +1461,849 @@
 );%0A    %7D
+%0A%0A    @RequestMapping(value = %22/d%22, method = RequestMethod.GET)%0A    @ResponseBody%0A    public List%3CString%3E simple() %7B%0A        List%3CString%3E result = new ArrayList%3CString%3E();%0A        DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt();%0A        try %7B%0A            defaultMQAdminExt.start();%0A            Set%3CString%3E bT = defaultMQAdminExt.fetchAllTopicList().getTopicList();%0A            List%3CString%3E dT = consumeProgressMapper.topicList(null);%0A            for (String temp : bT) %7B%0A                if (!dT.contains(temp))%0A                    result.add(temp);%0A            %7D%0A        %7D catch (MQClientException e) %7B%0A            e.printStackTrace();%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D catch (RemotingException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        return result;%0A    %7D
 %0A%7D%0A

fix:could find the topic who never had consumer group