大家好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发运行环境
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
源码下载地址:
https://download.csdn.net/download/m0_46388260/89278276
论文目录
【如需全文请按文末获取联系】
目录
一、项目简介
本文以Java为开发技术,实现了一个新闻类网站。新闻类网站的主要实现功能包括:管理员:首页、个人中心、用户管理、新闻类别管理、新闻信息管理、用户分享管理、系统管理,用户;首页、个人中心、用户分享管理、我的收藏管理,前台首页;首页、新闻信息、用户分享、公告信息、个人中心、后台管理功能,基本上实现了整个新闻类网站的过程。
二、系统设计
2.1软件功能模块设计
系统架构图属于系统设计阶段,系统架构图只是这个阶段一个产物,系统的总体架构决定了整个系统的模式,是系统的基础。新闻类网站的整体结构设计如图4-2所示。
2.2数据库设计
1、新闻信息实体图如图4-3所示:
2、用户信息实体图如图4-4所示:
3、用户分享信息实体图如图4-5所示:
三、系统项目部分截图
3.1注册登陆功能
管理员输入个人的用户名、密码和角色登录系统,这时候系统的数据库就会在进行查找相关的信息,如果我们输入的用户名、密码和角色不正确,数据库就会提示出错误的信息提示,同时会提示管理员重新输入自己的用户名、密码、角色,直到用户名、密码输入成功后,会提登录成功的信息。网站管理员登录效果图如图5-1所示:
3.2管理员功能模块
用户管理
管理员对用户管理进行查看用户名、姓名、性别、头像、手机、邮箱、审核回复、审核状态、审核并进行详情、删除、修改等操作。程序成效图如下图5-2所示:
新闻类别管理
管理员对新闻类别管理进行查看新闻类别等信息并可以进行删除、修改操作。程序效果图如下图5-3所示:
新闻信息管理
管理员对新闻信息管理进行查看新闻标题、新闻类别、新闻地区、新闻图片、新闻视频、发布日期等信息并可以进行详情、删除、修改操作。程序效果图如下图5-4所示:
3.3前台首页功能模块
前台首页详情页面查看首页、新闻信息、用户分享、公告信息、个人中心、后台管理等功能操作。程序效果图如下图5-8所示:
用户注册、用户登录
用户在线填写用户名、密码、姓名、手机、邮箱等信息进行注册、登录操作。程序效果图如下图5-9所示:
新闻信息
用户进入新闻信息可以查看新闻标题、新闻类别、新闻地区、新闻图片、新闻视频、发布日期、点击次数等信息,并可以进行点我收藏操作。程序效果图如下图5-10所示:
3.4用户功能模块
个人信息
用户进入个人信息可以填写用户名、姓名、性别、头像、手机、邮箱等信息进行修改。程序效果图如下图5-12所示:
用户分享管理
用户进入用户分享管理可以查看分享标题、分享类型、分享图片、分享视频、分享日期、用户名、邮箱、审核回复、审核状态并可以进行详情、修改、删除等操作。程序效果图如下图5-13所示:
四、部分核心代码
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.XinwenleibieEntity;
import com.entity.view.XinwenleibieView;
import com.service.XinwenleibieService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 新闻类别
* 后端接口
* @author
* @email
* @date 2021-04-21 18:11:26
*/
@RestController
@RequestMapping("/xinwenleibie")
public class XinwenleibieController {
@Autowired
private XinwenleibieService xinwenleibieService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,XinwenleibieEntity xinwenleibie,
HttpServletRequest request){
EntityWrapper<XinwenleibieEntity> ew = new EntityWrapper<XinwenleibieEntity>();
PageUtils page = xinwenleibieService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xinwenleibie), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,XinwenleibieEntity xinwenleibie,
HttpServletRequest request){
EntityWrapper<XinwenleibieEntity> ew = new EntityWrapper<XinwenleibieEntity>();
PageUtils page = xinwenleibieService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xinwenleibie), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XinwenleibieEntity xinwenleibie){
EntityWrapper<XinwenleibieEntity> ew = new EntityWrapper<XinwenleibieEntity>();
ew.allEq(MPUtil.allEQMapPre( xinwenleibie, "xinwenleibie"));
return R.ok().put("data", xinwenleibieService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XinwenleibieEntity xinwenleibie){
EntityWrapper< XinwenleibieEntity> ew = new EntityWrapper< XinwenleibieEntity>();
ew.allEq(MPUtil.allEQMapPre( xinwenleibie, "xinwenleibie"));
XinwenleibieView xinwenleibieView = xinwenleibieService.selectView(ew);
return R.ok("查询新闻类别成功").put("data", xinwenleibieView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XinwenleibieEntity xinwenleibie = xinwenleibieService.selectById(id);
return R.ok().put("data", xinwenleibie);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XinwenleibieEntity xinwenleibie = xinwenleibieService.selectById(id);
return R.ok().put("data", xinwenleibie);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XinwenleibieEntity xinwenleibie, HttpServletRequest request){
xinwenleibie.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xinwenleibie);
xinwenleibieService.insert(xinwenleibie);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XinwenleibieEntity xinwenleibie, HttpServletRequest request){
xinwenleibie.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xinwenleibie);
xinwenleibieService.insert(xinwenleibie);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody XinwenleibieEntity xinwenleibie, HttpServletRequest request){
//ValidatorUtils.validateEntity(xinwenleibie);
xinwenleibieService.updateById(xinwenleibie);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
xinwenleibieService.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<XinwenleibieEntity> wrapper = new EntityWrapper<XinwenleibieEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = xinwenleibieService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微信联系我。