基于springboot篮球论坛系统源码和论文

首先,论文一开始便是清楚的论述了系统的研究内容。其次,剖析系统需求分析,弄明白“做什么”,分析包括业务分析和业务流程的分析以及用例分析,更进一步明确系统的需求。然后在明白了系统的需求基础上需要进一步地设计系统,主要包罗软件架构模式、整体功能模块、数据库设计。本项目软件架构选择B/S模式和java技术,总体功能模块运用自顶向下的分层思想。再然后就是实现系统并进行代码编写实现功能。论文的最后章节总结一下自己完成本论文和开发本项目的心得和总结。通过篮球论坛系统将会使篮球论坛各个方面的工作效率带来实质性的提升。

关键字:B/S模式 java技术 篮球论坛 软件架构

基于springboot篮球论坛系统源码和论文356

演示视频:

基于springboot篮球论坛系统源码和论文

Abstract

First of all, the thesis clearly discusses the systematic research content at the very beginning. Secondly, the analysis of system requirements analysis, understand "what to do", including business analysis and business process analysis and use case analysis, further clear system requirements. Then, on the basis of understanding the requirements of the system, we need to further design the system, mainly including software architecture pattern, overall functional modules and database design. The software architecture of the project chooses B/S mode and Java technology, and the overall functional modules adopt the top-down hierarchical idea. Then is the realization of the system and code writing to achieve the function. The last chapter of the paper summarizes the experience and summary of the completion of this paper and the development of this project. Through the basketball forum system will make the basketball forum in all aspects of work efficiency to bring substantial improvement.

Key words: B/S mode Java technology basketball forum software architecture

表4-1:用户表

字段名称

类型

长度

字段说明

主键

默认值

id

bigint

主键

主键

username

varchar

100

用户名

password

varchar

100

密码

role

varchar

100

角色

管理员

addtime

timestamp

新增时间

CURRENT_TIMESTAMP

表4-2:token表

字段名称

类型

长度

字段说明

主键

默认值

id

bigint

主键

主键

userid

bigint

用户id

username

varchar

100

用户名

tablename

varchar

100

表名

role

varchar

100

角色

token

varchar

200

密码

addtime

timestamp

新增时间

CURRENT_TIMESTAMP

expiratedtime

timestamp

过期时间

CURRENT_TIMESTAMP

表4-3:篮球资讯

字段名称

类型

长度

字段说明

主键

默认值

id

bigint

主键

主键

addtime

timestamp

创建时间

CURRENT_TIMESTAMP

title

varchar

200

标题

introduction

longtext

4294967295

简介

picture

varchar

200

图片

content

longtext

4294967295

内容

表4-4:篮球论坛

字段名称

类型

长度

字段说明

主键

默认值

id

bigint

主键

主键

addtime

timestamp

创建时间

CURRENT_TIMESTAMP


package com.controller;import java.util.List;
import java.util.Arrays;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import com.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.UsersEntity;
import com.service.TokenService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UsersController {@Autowiredprivate UsersService usersService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());R r = R.ok();r.put("token", token);r.put("role",user.getRole());r.put("userId",user.getId());return r;}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UsersEntity user){
//    	ValidatorUtils.validateEntity(user);if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}usersService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 修改密码*/@GetMapping(value = "/updatePassword")public R updatePassword(String  oldPassword, String  newPassword, HttpServletRequest request) {UsersEntity users = usersService.selectById((Integer)request.getSession().getAttribute("userId"));if(newPassword == null){return R.error("新密码不能为空") ;}if(!oldPassword.equals(users.getPassword())){return R.error("原密码输入错误");}if(newPassword.equals(users.getPassword())){return R.error("新密码不能和原密码一致") ;}users.setPassword(newPassword);usersService.updateById(users);return R.ok();}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");usersService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UsersEntity user){EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();PageUtils page = usersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UsersEntity user){EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", usersService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UsersEntity user = usersService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Integer id = (Integer)request.getSession().getAttribute("userId");UsersEntity user = usersService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UsersEntity user){
//    	ValidatorUtils.validateEntity(user);if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}usersService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UsersEntity user){
//        ValidatorUtils.validateEntity(user);usersService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){List<UsersEntity> user = usersService.selectList(null);if(user.size() > 1){usersService.deleteBatchIds(Arrays.asList(ids));}else{return R.error("管理员最少保留一个");}return R.ok();}
}

package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 字典* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);private static final String TABLE_NAME = "dictionary";@Autowiredprivate DictionaryService dictionaryService;@Autowiredprivate TokenService tokenService;@Autowiredprivate ForumService forumService;//论坛@Autowiredprivate HuodongService huodongService;//活动@Autowiredprivate HuodongCollectionService huodongCollectionService;//活动收藏@Autowiredprivate HuodongLiuyanService huodongLiuyanService;//活动留言@Autowiredprivate HuodongYuyueService huodongYuyueService;//活动报名@Autowiredprivate NewsService newsService;//公告资讯@Autowiredprivate SucaiService sucaiService;//图片素材@Autowiredprivate SucaiCollectionService sucaiCollectionService;//图片素材收藏@Autowiredprivate SucaiLiuyanService sucaiLiuyanService;//图片素材留言@Autowiredprivate SucaishipinService sucaishipinService;//视频素材@Autowiredprivate SucaishipinCollectionService sucaishipinCollectionService;//视频素材收藏@Autowiredprivate SucaishipinLiuyanService sucaishipinLiuyanService;//视频素材留言@Autowiredprivate YonghuService yonghuService;//用户@Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/@RequestMapping("/page")@IgnoreAuthpublic R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));CommonUtil.checkMap(params);PageUtils page = dictionaryService.queryPage(params);//字典表数据转换List<DictionaryView> list =(List<DictionaryView>)page.getList();for(DictionaryView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put("data", page);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);DictionaryEntity dictionary = dictionaryService.selectById(id);if(dictionary !=null){//entity转viewDictionaryView view = new DictionaryView();BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).eq("index_name", dictionary.getIndexName());if(dictionary.getDicCode().contains("_erji_types")){queryWrapper.eq("super_id",dictionary.getSuperId());}logger.info("sql语句:"+queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);if(dictionaryEntity==null){dictionary.setCreateTime(new Date());dictionaryService.insert(dictionary);//字典表新增数据,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());DictionaryEntity oldDictionaryEntity = dictionaryService.selectById(dictionary.getId());//查询原先数据String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");dictionaryService.updateById(dictionary);//根据id更新//如果字典表修改数据的话,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids, HttpServletRequest request){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());List<DictionaryEntity> oldDictionaryList =dictionaryService.selectBatchIds(Arrays.asList(ids));//要删除的数据dictionaryService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 最大值*/@RequestMapping("/maxCodeIndex")public R maxCodeIndex(@RequestBody DictionaryEntity dictionary){logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());List<String> descs = new ArrayList<>();descs.add("code_index");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).orderDesc(descs);logger.info("sql语句:"+queryWrapper.getSqlSegment());List<DictionaryEntity> dictionaryEntityList = dictionaryService.selectList(queryWrapper);if(dictionaryEntityList.size()>0 ){return R.ok().put("maxCodeIndex",dictionaryEntityList.get(0).getCodeIndex()+1);}else{return R.ok().put("maxCodeIndex",1);}}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");try {List<DictionaryEntity> dictionaryList = new ArrayList<>();//上传的东西Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段Date date = new Date();int lastIndexOf = fileName.lastIndexOf(".");if(lastIndexOf == -1){return R.error(511,"该文件没有后缀");}else{String suffix = fileName.substring(lastIndexOf);if(!".xls".equals(suffix)){return R.error(511,"只支持后缀为xls的excel文件");}else{URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径File file = new File(resource.getFile());if(!file.exists()){return R.error(511,"找不到上传文件,请联系管理员");}else{List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行,因为第一行是提示for(List<String> data:dataList){//循环DictionaryEntity dictionaryEntity = new DictionaryEntity();
//                            dictionaryEntity.setDicCode(data.get(0));                    //字段 要改的
//                            dictionaryEntity.setDicName(data.get(0));                    //字段名 要改的
//                            dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0)));   //编码 要改的
//                            dictionaryEntity.setIndexName(data.get(0));                    //编码名字 要改的
//                            dictionaryEntity.setSuperId(Integer.valueOf(data.get(0)));   //父字段id 要改的
//                            dictionaryEntity.setBeizhu(data.get(0));                    //备注 要改的
//                            dictionaryEntity.setCreateTime(date);//时间dictionaryList.add(dictionaryEntity);//把要查询是否重复的字段放入map中}//查询是否重复dictionaryService.insertBatch(dictionaryList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/449601.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux|Grep 命令的 12 个实用示例

您是否曾经遇到过在文件中查找特定字符串或模式的任务&#xff0c;但不知道从哪里开始查找&#xff1f;那么&#xff0c;grep 命令可以拯救你&#xff01; grep 是一个功能强大的文件模式搜索器&#xff0c;每个 Linux 发行版都配备了它。如果出于某种原因&#xff0c;它没有安…

一文速学-selenium高阶操作连接已存在浏览器

前言 不得不说selenium不仅在自动化测试作为不可或缺的工具&#xff0c;在数据获取方面也是十分好用&#xff0c;能够十分快速的见到效果&#xff0c;这都取决于selenium框架的足够的灵活性&#xff0c;甚至在一些基于web端的自动化办公都十分有效。 通过selenium连接已经存在…

SQL注入:sqli-labs靶场通关(1-37关)

SQL注入系列文章&#xff1a; 初识SQL注入-CSDN博客 SQL注入&#xff1a;联合查询的三个绕过技巧-CSDN博客 SQL注入&#xff1a;报错注入-CSDN博客 SQL注入&#xff1a;盲注-CSDN博客 SQL注入&#xff1a;二次注入-CSDN博客 ​SQL注入&#xff1a;order by注入-CSDN博客 …

大坑!react+thress.js

2. UI交互界面与Canvas画布叠加 | Three.js中文网 (webgl3d.cn) // canvas画布绝对定位 renderer.domElement.style.position absolute; renderer.domElement.style.top 0px; renderer.domElement.style.left 0px; renderer.domElement.style.zIndex -1; 我按照教程设置了…

vscode实时预览markdown效果

安装插件 Markdown Preview Enhanced 上面是搜索框 启动预览 右键->Open Preview On the Side 效果如下&#xff1a; 目录功能 目录功能还是使用gitee吧 push后使用gitee&#xff0c;gitee上markdown支持侧边生成目录

【数模百科】一文快速讲清楚层次分析法AHP(附python代码和参考美赛论文)

本文摘录自 层次分析法原理 - 数模百科&#xff0c;如果你想了解更多关于层次分析法的知识&#xff0c;请移步数模百科。 层次分析法&#xff08;Analytic Hierarchy Process&#xff0c;简称AHP&#xff09;是一种解决复杂决策问题的方法。这个方法是由美国运筹学家托马斯萨蒂…

12.scala下划线使用总结

目录 概述实践变量初始化导包引入方法转变为函数用户访问Tuple元素简化函数参数传递定义偏函数变长参数 结束 概述 实践 变量初始化 在Scala中&#xff0c;变量在声明时需要显式指定初始值。可以使用下划线为变量提供初始值&#xff0c;但这种语法仅限于成员变量&#xff0c;…

kubernetes基本概念和操作

基本概念和操作 1.Namespace1.1概述1.2应用示例 2.Pod2.1概述2.2语法及应用示例 3.Label3.1概述3.2语法及应用示例 4.Deployment4.1概述4.2语法及应用示例 5.Service5.1概述5.2语法及应用示例5.2.1创建集群内部可访问的Service5.2.2创建集群外部可访问的Service5.2.3删除服务5.…

XML详解

XML 简介 概述&#xff1a;Extensible Markup Language 可扩展标记语言 可扩展&#xff1a;标签都是自定义的。 功能 数据存储&#xff1a;XML 可以用来存储结构化数据&#xff0c;包括文本、数字、日期等各种类型的数据数据交换&#xff1a;XML 可以作为一种通用的数据交换格…

这种学习单片机的顺序是否合理?

这种学习单片机的顺序是否合理&#xff1f; 在开始前我有一些资料&#xff0c;是我根据网友给的问题精心整理了一份「单片机的资料从专业入门到高级教程」&#xff0c; 点个关注在评论区回复“888”之后私信回复“888”&#xff0c;全部无偿共享给大家&#xff01;&#xff01…

CSS 外边距合并、塌陷和BFC

外边距合并 CSS中的外边距合并指的是当两个相邻元素都设置了上下外边距时&#xff0c;它们之间会发生重叠。这种现象被称为"margin collapsing"&#xff08;外边距合并&#xff09;或者"margin collapse"&#xff08;外边距塌陷&#xff09;。 可以看出上…

大学生搜题神器app排名?有没有针对特定学习需求设计的大学搜题工具? #笔记#职场发展#媒体

大学生除了学习专业知识外&#xff0c;还应该关注和学习一些软技能&#xff0c;如沟通能力、团队合作和领导力等&#xff0c;以提升自己的综合素质。 1.三羊搜题 这是一个公众号 涵盖往年成人各类考试&#xff0c;题库有建筑类、金融类、医药卫生类、公考类、安全生产类、特…