项目描述
临近学期结束,还是毕业设计,你还在做java程序网络编程,期末作业,老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等。这里根据疫情当下,你想解决的问题,今天给大家介绍一篇基于springboot的电影推荐网站设计与实现。
功能需求
系统功能要求如下:
管理员:管理员登录、用户管理、电影信息管理、电影类型管理、在线留言管理、系统管理、个人信息修改、退出系统。
用户:用户登录注册、首页(协同算法收藏夹推荐)、电影信息检索、电影在线观看、在线留言、个人中心的信息模块、我的搜藏、。
部分效果图
数据库脚本
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,DianyingxinxiEntity dianyingxinxi,
HttpServletRequest request){
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
PageUtils page = dianyingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,DianyingxinxiEntity dianyingxinxi,
HttpServletRequest request){
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
PageUtils page = dianyingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( DianyingxinxiEntity dianyingxinxi){
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( dianyingxinxi, "dianyingxinxi"));
return R.ok().put("data", dianyingxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(DianyingxinxiEntity dianyingxinxi){
EntityWrapper< DianyingxinxiEntity> ew = new EntityWrapper< DianyingxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( dianyingxinxi, "dianyingxinxi"));
DianyingxinxiView dianyingxinxiView = dianyingxinxiService.selectView(ew);
return R.ok("查询电影信息成功").put("data", dianyingxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
DianyingxinxiEntity dianyingxinxi = dianyingxinxiService.selectById(id);
dianyingxinxi.setClicktime(new Date());
dianyingxinxiService.updateById(dianyingxinxi);
return R.ok().put("data", dianyingxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DianyingxinxiEntity dianyingxinxi = dianyingxinxiService.selectById(id);
dianyingxinxi.setClicktime(new Date());
dianyingxinxiService.updateById(dianyingxinxi);
return R.ok().put("data", dianyingxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DianyingxinxiEntity dianyingxinxi, HttpServletRequest request){
dianyingxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(dianyingxinxi);
dianyingxinxiService.insert(dianyingxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DianyingxinxiEntity dianyingxinxi, HttpServletRequest request){
dianyingxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(dianyingxinxi);
dianyingxinxiService.insert(dianyingxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody DianyingxinxiEntity dianyingxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(dianyingxinxi);
dianyingxinxiService.updateById(dianyingxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
dianyingxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<DianyingxinxiEntity> wrapper = new EntityWrapper<DianyingxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = dianyingxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,DianyingxinxiEntity dianyingxinxi, HttpServletRequest request,String pre){
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicktime");
params.put("order", "desc");
PageUtils page = dianyingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 协同算法(按收藏推荐)
*/
@RequestMapping("/autoSort2")
public R autoSort2(@RequestParam Map<String, Object> params,DianyingxinxiEntity dianyingxinxi, HttpServletRequest request){
String userId = request.getSession().getAttribute("userId").toString();
String inteltypeColumn = "dianyingleixing";
List<StoreupEntity> storeups = storeupService.selectList(new EntityWrapper<StoreupEntity>().eq("type", 1).eq("userid", userId).eq("tablename", "dianyingxinxi").orderBy("addtime", false));
List<String> inteltypes = new ArrayList<String>();
Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
List<DianyingxinxiEntity> dianyingxinxiList = new ArrayList<DianyingxinxiEntity>();
//去重
if(storeups!=null && storeups.size()>0) {
for(StoreupEntity s : storeups) {
dianyingxinxiList.addAll(dianyingxinxiService.selectList(new EntityWrapper<DianyingxinxiEntity>().eq(inteltypeColumn, s.getInteltype())));
}
}
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
params.put("sort", "id");
params.put("order", "desc");
PageUtils page = dianyingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingxinxi), params), params));
List<DianyingxinxiEntity> pageList = (List<DianyingxinxiEntity>)page.getList();
if(dianyingxinxiList.size()<limit) {
int toAddNum = (limit-dianyingxinxiList.size())<=pageList.size()?(limit-dianyingxinxiList.size()):pageList.size();
for(DianyingxinxiEntity o1 : pageList) {
boolean addFlag = true;
for(DianyingxinxiEntity o2 : dianyingxinxiList) {
if(o1.getId().intValue()==o2.getId().intValue()) {
addFlag = false;
break;
}
}
if(addFlag) {
dianyingxinxiList.add(o1);
if(--toAddNum==0) break;
}
}
} else if(dianyingxinxiList.size()>limit) {
dianyingxinxiList = dianyingxinxiList.subList(0, limit);
}
page.setList(dianyingxinxiList);
return R.ok().put("data", page);
}
安装部署需求
利用tomcat启动运行
总体设计
本项目用到的技术和框架
(1)采用三层架构的模式使用springboot框架式搭建后端。
(2)vue前端技术搭建前端界面。
(4)采用开源免费的MySQL数据库存储业务数据。
本项目中的关键点
此系统的开发采用java语言开发,基于B/S结构,这些开发环境使系统更加完善。使用到的工具和技术都是开源免费的。
环境工具
开发工具 Eclipse/IDEA
语言 JDK1.8
硬件:笔记本电脑;
软件:Tomcat9.0 Web服务器、Navicat数据库客户端、MySQL;
操作系统:Windows 10;
以上是本系统的部分功能展示,如果你的选题正好相符,那么可以做毕业设计或课程设计使用。