//package com.jay.monitor.data.server.controllers;//package com.jay.monitor.data.server.controllers;
//
//import com.jay.monitor.data.core.model.response.ListResponseModel;
//import com.jay.monitor.data.core.model.response.PageInfoModel;
//import com.jay.monitor.data.core.model.response.PageResponseModel;
//import com.jay.monitor.data.core.utils.ResponseUtils;
//import com.jay.monitor.data.server.models.entity.JayMonitorMq;
//import com.jay.monitor.data.server.models.entity.JayMonitorUrl;
//import com.jay.monitor.data.server.models.request.trace.MQRequest;
//import com.jay.monitor.data.server.models.request.trace.URLRequest;
//import com.jay.monitor.data.server.store.ConfigStoreManager;
//import com.jay.monitor.data.server.store.StoreDataManager;
//import com.jay.monitor.data.server.store.mysql.MysqlMQStoreProcess;
//import com.jay.monitor.data.server.store.mysql.MysqlUrlStoreProcess;
//import com.jay.monitor.data.server.utils.DataUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import java.util.List;
//
////import com.jay.monitor.data.server.services.impl.DefaultBackstageRouteService;
//
///**
// * 后台路由管理
// *
// * @author liukx
// * @Date 2019-02-28 15:16
// */
//@Controller
//@RequestMapping(value = "/trace")
//public class TraceController {
//
//    final static private String page = "/trace/";
//
//    @Autowired
//    private ConfigStoreManager configStoreManager;
//
//    @Autowired
//    private MysqlMQStoreProcess mqStoreProcess;
//
//    @Autowired
//    private MysqlUrlStoreProcess urlStoreProcess;
//
//    @Autowired
//    private StoreDataManager storeDataManager;
//
//    @RequestMapping(value = "/mqList.html", method = RequestMethod.GET)
//    public String list(Model model) throws Exception {
//        model.addAttribute("catUrl", configStoreManager.getLogMonitorUrl());
//        return page + "mqList";
//    }
//
//    @RequestMapping(value = "/urlList.html", method = RequestMethod.GET)
//    public String urlList(Model model) throws Exception {
//        model.addAttribute("catUrl", configStoreManager.getLogMonitorUrl());
//        return page + "urlList";
//    }
//
//    @RequestMapping(value = "/mqNodeId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
//    @ResponseBody
//    public ListResponseModel<JayMonitorMq> findMQList(@RequestBody MQRequest request) throws Exception {
//        String date = DataUtils.parseDayString(request.getDate());
//        // 将参数对应的全部匹配赋值
//        List<JayMonitorMq> mqList = mqStoreProcess.searchDataByList(date, request.getPageSize(), request);
//        return ResponseUtils.trueList(mqList);
//    }
//
//    @RequestMapping(value = "/mqList", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
//    @ResponseBody
//    public PageResponseModel<JayMonitorMq> mqNodeId(@RequestBody MQRequest request) throws Exception {
//        String date = DataUtils.parseDayString(request.getDate());
//        // 将参数对应的全部匹配赋值
//        List<JayMonitorMq> mqList = mqStoreProcess.searchDataByList(date, request.getPageSize(), request);
//        PageResponseModel<JayMonitorMq> pageResponseModel = new PageResponseModel<JayMonitorMq>();
//        PageInfoModel pageInfoModel = new PageInfoModel();
//        pageInfoModel.setRowTotal(20);
//        pageInfoModel.setPageSize(1);
//        pageInfoModel.setResultSet(mqList);
//        pageResponseModel.setPageModel(pageInfoModel);
//        return pageResponseModel;
//    }
//
//    @RequestMapping(value = "/urlList", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
//    @ResponseBody
//    public PageResponseModel<JayMonitorUrl> findUrlList(@RequestBody URLRequest request) throws Exception {
//        String date = DataUtils.parseDayString(request.getDate());
//        // 将参数对应的全部匹配赋值
//        List<JayMonitorUrl> mqList = urlStoreProcess.searchDataByList(date, request.getPageSize(), request);
//        PageResponseModel<JayMonitorUrl> pageResponseModel = new PageResponseModel<JayMonitorUrl>();
//        PageInfoModel pageInfoModel = new PageInfoModel();
//        pageInfoModel.setRowTotal(20);
//        pageInfoModel.setPageSize(1);
//        pageInfoModel.setResultSet(mqList);
//        pageResponseModel.setPageModel(pageInfoModel);
//        return pageResponseModel;
//    }
//
//    //    @RequestMapping(value = "/getObjectById", method = RequestMethod.GET)
//    //    @ResponseBody
//    //    public ObjectResponseModel<BackstageRoute> getObjectById(@RequestParam("id") Integer id) throws Exception {
//    //        BackstageRoute result = routesService.getById(id + "");
//    //        ObjectResponseModel<BackstageRoute> model = new ObjectResponseModel<BackstageRoute>();
//    //        model.setSingle(result);
//    //        return model;
//    //    }
//    //
//    //    @RequestMapping(value = "/getObjectByList", method = RequestMethod.POST)
//    //    @ResponseBody
//    //    public ListResponseModel<BackstageRoute> getObjectByList(@RequestBody BackstageRoute request) throws Exception {
//    //        QueryWrapper queryWrapper = new QueryWrapper(request);
//    //        List<BackstageRoute> result = routesService.listObjs(queryWrapper);
//    //        ListResponseModel<BackstageRoute> model = new ListResponseModel<BackstageRoute>();
//    //        model.setList(result);
//    //        return model;
//    //    }
//    //
//    //    @RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
//    //    @ResponseBody
//    //    public ResponseCommonModel updateBackstageRouteInfo(@RequestBody BackstageRoute request) throws Exception {
//    //        request.setUpdated(new Date());
//    //        boolean b = routesService.updateById(request);
//    //        ResponseCommonModel response = new ResponseCommonModel();
//    //        if (b) {
//    //            response.setSuccess(false);
//    //        }
//    //        return response;
//    //    }
//}
