现在在做毕设,做一个电商平台日志分析系统,需要结合可视化,达到一个直观的效果
1.搭建springboot项目,maven搭建,这是项目整体架构
2.后台代码:
@RestController
@RequestMapping("/wanglk_bds")
public class VisualController {
@Autowired
private VisualInterface visualInterface;
@RequestMapping(value="/bar-simple",method=RequestMethod.GET,produces="application/json")
@ResponseBody
public List getDateTotal(){
List all = visualInterface.getAll();
return all;
}
}
@Service
public class VisualInterfaceImpl implements VisualInterface {
@Autowired
VisualMapper visualMapper;
@Override
public List getAll() {
List totals = visualMapper.selectAllFromTable();
return totals;
}
}
@Mapper
public interface VisualMapper {
List selectAllFromTable();
}
date,total select from keyword
3.前端代码:
4.总结:
代码没什么技术含量,都能写出来,但是过程中出现的错误不是每个人都有
1.后台 controller层使用的注解 restcontroller 返回json格式的数据
2.mybatis自动生成文件的xml出错,为解决,
3.前台使用echarts的时候,将echarts部分放进ajax的success函数中,
4.还有css和js代码的位置问题,加载先后顺序
5.端口问题
6.使用本地tomcat部署springboot项目
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



