基于ssm+vue学习交流论坛系统源码和论文169
开发工具:idea 或eclipse
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
技术:ssm
- 选题依据(简述国内外研究现状、生产需求状况, 说明选题目的、意义,列出主要参考文献):
- 国内外研究现状:
我们在网络中浏览到的信息当中,很多时候我们都能看到网友在各个方面的见解,从中能获取到有用的知识,在阅读和理解中得到教诲和启发。尤其是在一些政府网站上,群众可以就城市发展建设等方面发表自己的见解,将自己目前遇到的困难进行表达,其中不乏有用且结合实际的观点,由相关机关采纳后运用在城市管理中。网络在获取群众民意以及意见等方面得到了良好的运用。一些观点想法具备多角度思考,极具参考价值,对网络参与者的思想想法都有很好的影响。即使有不少网络用户在网络中发泄情绪,发表毫无价值的评论意见,自怨自艾,但是瑕不掩瑜,论坛平台的搭建依然做出了极大的贡献。在网络当中的讨论应该充满知识、趣味,公平,和谐的色彩,在这样比较自由的交流平台上,每个网民都有义务来维护整个网络环境的健康和可持续发展。在网络论坛的世界中,网民们拥有了方便且便捷的交流方式,更加易于表达自己内心中的观点和想法,并且所发表出来的信息,都是以固定且易于吸纳的文字的形式来进行记录,极大的减少了一些闪光信息的流逝。在网络论坛中寻求自己需要的资料,具备极高的效率性以及时效性,同时也节约了物质资源。虚拟网络的沟通中,无论在网友以什么的情绪发表观点,都可以避免在现实生活中容易出现的现实冲突,这一特性就导致各种思想想法进行更高频率的碰撞。网络论坛的种种优点让人们更多的选择在网络中进行交流以及互动。
论坛存在一些缺点也不能被忽视,所有的论坛的运行都需要进行网络连接,因此它也有着网络的缺点,比如司空见惯的网络暴力、网络诈骗事件。在虚拟的世界当中,网民较难控制自己的情绪欲望,也更容易把最不具备防御力的一面展示在网络世界中,导致在经济情感等方面遭受损失。此外论坛当中的使用者鱼龙混杂,同时存在的信息也良莠不齐,在网络中获取的知识、观点,不一定是正确的,更有甚者,存在着明显的错误。在论坛当中获取知识虽然极具经济性和即时性,但是这些知识的正确与否也要有赖于参与者的判断能力。另一方面,在习惯于在网络世界中交流后,也直接导致人与人当面进行交流的减少,淡化了人与人之间的感情,影响了人们社交能力。此外,管理者拥有极大的权限,在论坛的环境中,管理者不费吹灰之力就可以轻松的掌握到用户在论坛当中保存的所有数据,这也对用户的资料安全造成了不小的影响。论坛的良好的成长需要多方面的约束,在这其中,管理员担任着重要的角色,现实中他们不具备任何管理的权利,这与他们在网络中担当的角色的反差,导致管理者同用户中间容易产生各种各样的矛盾。与此同时,网络当中信息为了更加具备趣味性和聚焦性,也形成一种流行文化。比如近年来,层出不穷的网络专属的戏谑的新词汇,这也导致一些不正规的词语以极快的速度传播。还有一点不得不提及,论坛的魅力吸引了众多的网民沉迷其中,在这样的平台当中疯狂刷“存在感”,无休止的进行“灌水”。倘若论坛以这样的形式被运用,那么也就完全失去了它应该具备的获取知识,互相帮助解决问题的意义。
在国内主要的论坛有天涯、猫扑、各个高校论坛,这些论坛经过多年的发展已经不只是一个发帖交流的BBS,而是向多元综合的方向发展,随着web2.0的时代到来,BBS与SNS越来越紧密的结合在一起,如百度的贴吧就是集BBS、交友、分享于一体的新型论坛。
在国外,BBS经过多年的发展,也逐步衍生出诸如twitter、微博等,发布信息互动的新型BBS模式,BBS在一个网站建设中也变成了不可缺少的一部分,如电商平台、新闻发布平台、公司、校园等,论坛几乎成为网站建设必有的一部分。
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.BokewenzhangEntity;
import com.entity.view.BokewenzhangView;
import com.service.BokewenzhangService;
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-02 08:48:56
*/
@RestController
@RequestMapping("/bokewenzhang")
public class BokewenzhangController {
@Autowired
private BokewenzhangService bokewenzhangService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,BokewenzhangEntity bokewenzhang,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
bokewenzhang.setYonghuming((String)request.getSession().getAttribute("username"));
}
EntityWrapper<BokewenzhangEntity> ew = new EntityWrapper<BokewenzhangEntity>();
PageUtils page = bokewenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bokewenzhang), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,BokewenzhangEntity bokewenzhang, HttpServletRequest request){
EntityWrapper<BokewenzhangEntity> ew = new EntityWrapper<BokewenzhangEntity>();
PageUtils page = bokewenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bokewenzhang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( BokewenzhangEntity bokewenzhang){
EntityWrapper<BokewenzhangEntity> ew = new EntityWrapper<BokewenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( bokewenzhang, "bokewenzhang"));
return R.ok().put("data", bokewenzhangService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(BokewenzhangEntity bokewenzhang){
EntityWrapper< BokewenzhangEntity> ew = new EntityWrapper< BokewenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( bokewenzhang, "bokewenzhang"));
BokewenzhangView bokewenzhangView = bokewenzhangService.selectView(ew);
return R.ok("查询博客文章成功").put("data", bokewenzhangView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
BokewenzhangEntity bokewenzhang = bokewenzhangService.selectById(id);
bokewenzhang.setClicknum(bokewenzhang.getClicknum()+1);
bokewenzhang.setClicktime(new Date());
bokewenzhangService.updateById(bokewenzhang);
return R.ok().put("data", bokewenzhang);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
BokewenzhangEntity bokewenzhang = bokewenzhangService.selectById(id);
bokewenzhang.setClicknum(bokewenzhang.getClicknum()+1);
bokewenzhang.setClicktime(new Date());
bokewenzhangService.updateById(bokewenzhang);
return R.ok().put("data", bokewenzhang);
}
/**
* 赞或踩
*/
@RequestMapping("/thumbsup/{id}")
public R thumbsup(@PathVariable("id") String id,String type){
BokewenzhangEntity bokewenzhang = bokewenzhangService.selectById(id);
if(type.equals("1")) {
bokewenzhang.setThumbsupnum(bokewenzhang.getThumbsupnum()+1);
} else {
bokewenzhang.setCrazilynum(bokewenzhang.getCrazilynum()+1);
}
bokewenzhangService.updateById(bokewenzhang);
return R.ok();
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody BokewenzhangEntity bokewenzhang, HttpServletRequest request){
bokewenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(bokewenzhang);
bokewenzhangService.insert(bokewenzhang);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody BokewenzhangEntity bokewenzhang, HttpServletRequest request){
bokewenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(bokewenzhang);
bokewenzhangService.insert(bokewenzhang);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody BokewenzhangEntity bokewenzhang, HttpServletRequest request){
//ValidatorUtils.validateEntity(bokewenzhang);
bokewenzhangService.updateById(bokewenzhang);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
bokewenzhangService.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<BokewenzhangEntity> wrapper = new EntityWrapper<BokewenzhangEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
}
int count = bokewenzhangService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,BokewenzhangEntity bokewenzhang, HttpServletRequest request,String pre){
EntityWrapper<BokewenzhangEntity> ew = new EntityWrapper<BokewenzhangEntity>();
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", "clicknum");
params.put("order", "desc");
PageUtils page = bokewenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bokewenzhang), params), params));
return R.ok().put("data", page);
}
}
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.DiscussbokewenzhangEntity;
import com.entity.view.DiscussbokewenzhangView;
import com.service.DiscussbokewenzhangService;
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-02 08:48:56
*/
@RestController
@RequestMapping("/discussbokewenzhang")
public class DiscussbokewenzhangController {
@Autowired
private DiscussbokewenzhangService discussbokewenzhangService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,DiscussbokewenzhangEntity discussbokewenzhang,
HttpServletRequest request){
EntityWrapper<DiscussbokewenzhangEntity> ew = new EntityWrapper<DiscussbokewenzhangEntity>();
PageUtils page = discussbokewenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussbokewenzhang), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,DiscussbokewenzhangEntity discussbokewenzhang, HttpServletRequest request){
EntityWrapper<DiscussbokewenzhangEntity> ew = new EntityWrapper<DiscussbokewenzhangEntity>();
PageUtils page = discussbokewenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussbokewenzhang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( DiscussbokewenzhangEntity discussbokewenzhang){
EntityWrapper<DiscussbokewenzhangEntity> ew = new EntityWrapper<DiscussbokewenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( discussbokewenzhang, "discussbokewenzhang"));
return R.ok().put("data", discussbokewenzhangService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(DiscussbokewenzhangEntity discussbokewenzhang){
EntityWrapper< DiscussbokewenzhangEntity> ew = new EntityWrapper< DiscussbokewenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( discussbokewenzhang, "discussbokewenzhang"));
DiscussbokewenzhangView discussbokewenzhangView = discussbokewenzhangService.selectView(ew);
return R.ok("查询博客文章评论表成功").put("data", discussbokewenzhangView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
DiscussbokewenzhangEntity discussbokewenzhang = discussbokewenzhangService.selectById(id);
return R.ok().put("data", discussbokewenzhang);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DiscussbokewenzhangEntity discussbokewenzhang = discussbokewenzhangService.selectById(id);
return R.ok().put("data", discussbokewenzhang);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DiscussbokewenzhangEntity discussbokewenzhang, HttpServletRequest request){
discussbokewenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussbokewenzhang);
discussbokewenzhangService.insert(discussbokewenzhang);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DiscussbokewenzhangEntity discussbokewenzhang, HttpServletRequest request){
discussbokewenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussbokewenzhang);
discussbokewenzhangService.insert(discussbokewenzhang);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody DiscussbokewenzhangEntity discussbokewenzhang, HttpServletRequest request){
//ValidatorUtils.validateEntity(discussbokewenzhang);
discussbokewenzhangService.updateById(discussbokewenzhang);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
discussbokewenzhangService.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<DiscussbokewenzhangEntity> wrapper = new EntityWrapper<DiscussbokewenzhangEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = discussbokewenzhangService.selectCount(wrapper);
return R.ok().put("count", count);
}
}