首页>代码>spring boot整合eCharts,itext读取数据库数据显示eCharts柱状图表,支持pdf文件导出和生成图片>/spring-boot-echarts-master/src/main/java/com/demo/controller/IndexController.java
package com.demo.controller; import com.demo.service.IndexService; import com.sun.org.apache.regexp.internal.RE; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import java.util.HashMap; import java.util.Map; /** * @author zhouyulong * @date 2018/10/28 下午2:43. */ @Controller @RequestMapping(value = "/") public class IndexController { @Autowired private IndexService indexService; @RequestMapping(value = "index", method = RequestMethod.GET) public String index() { return "index"; } @RequestMapping(value = "list", method = RequestMethod.GET) @ResponseBody public Map<String,Object> getList() { Map<String,Object> map = new HashMap<>(); map.put("msg", "ok"); map.put("data", indexService.findAll()); return map; } }