——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明












基于javaweb的SSM+Maven论坛交友BBS交流留言发帖系统平台(java+ssm+html+thymeleaf+mysql+bootstrap+layui)
/ForumSystem
项目描述
基于SSM实现的社区论坛系统
还可以来发布一些“学院专区”“社团专区” 、“校园趣事” 、“学习资源共享” 、“告白墙”等;
更可以召集亲朋好友到聊天室内畅所欲言…..
前台:
http://localhost:8080/ForumSystem/index.html
用户:user/123456
后台:
http://localhost:8080/ForumSystem/stair/admin/login
管理员:admin/123456
运行环境
jdk8+tomcat9+mysql5.7+IntelliJ IDEA+maven
项目技术
服务端技术:Spring+SpringMvc+Mybatis+Shiro+Websocket
前端技术:html+css+Jquery+layui+bootstrap
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| return "0"; }
}
@Controller @RequestMapping("bbs/postBrowse") public class PostBrowseCommentController {
@Resource private IPostBrowseCommentService postBrowseService; @Resource private IUserCollectService userCollectService; @Resource private IPlateService plateService; @Resource private IPostShareService postShareService;
@RequestMapping("/findNewestPost") @ResponseBody public Map findNewestPost(){ Map<String,String> map = new HashMap<>(); map.put("orderBy","post_heat");
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
@Controller @RequestMapping("bbs/notification") public class NotificationController {
@Resource private INotificationService notificationService;
@RequestMapping("/selectNewestReply") @ResponseBody public Map selectNewestReply(@RequestBody Map map){ int total = notificationService.getCount(map); List<Post> lists = notificationService.paging(map); map.put("total",total); map.put("data",lists); return map; }
@RequestMapping(value = "/alterReply",method = RequestMethod.POST) @ResponseBody public ApiResult alterReply(@RequestBody List<Integer> ids){ notificationService.alterPostDetails(ids); return ApiResult.of(ResultCode.SUCCESS); }
@RequestMapping(value = "/listFriendApply",method = RequestMethod.POST) @ResponseBody public Map listFriendApply(@RequestBody Map map){ int total = notificationService.getApplyCount(map); List<UserFriend> lists = notificationService.selectFriendApply(map); map.put("total",total); map.put("lists",lists); return map; }
@RequestMapping(value = "/alterApply",method = RequestMethod.POST) @ResponseBody public ApiResult alterApply(@RequestBody List<Integer> ids){ notificationService.alterUserFriend(ids);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
@Controller @RequestMapping("stair/datum") public class AdminDatumController {
@Resource private IUserService userService; @Resource private IPlateService plateService; @Resource private ILeadPostService iLeadPostService;
@RequestMapping("getUserInfo") @ResponseBody public User getUserInfo(String username){ return userService.findByName(username); }
@RequestMapping("alterUser") @ResponseBody public ApiResult alterUser(@RequestBody Map map){ String old_password = (String) map.get("old_password"); if (old_password != null){ User user = userService.getPwdSalt((String) map.get("username")); String oldPwd = MD5.getMd5String(old_password,user.getSalt()); if (!oldPwd.equals(user.getPassword())){ throw new CustomException(ResultCode.PASSWORD_FAILED); } String new_salt = MD5.getSalt(); map.put("salt",new_salt); String DBPassword = MD5.getMd5String((String) map.get("new_password"),new_salt);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| }
@RequestMapping("/findUserStatus") @ResponseBody public String findUser(String uid){
if (userMap.get(uid) != null){ System.out.println("====该用户在线...."); return "1"; }else { System.out.println("====该用户不在线...."); } return "0"; }
}
@Controller @RequestMapping("bbs/postBrowse") public class PostBrowseCommentController {
@Resource
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| map.put("plateInfo", plateService.getPlateById(pl_type)); map.put("plateRanking", plateService.plateRanking()); map.put("list", list); map.put("list2", istopPostlist); return map; }
@RequestMapping("/getTodayPostNum") @ResponseBody public Integer getTodayPostNum(@RequestBody Map map) { System.out.println("今日发表数量:" + plateService.getCount(map)); return plateService.getCount(map); }
@RequestMapping("selectNotice") @ResponseBody public Notice findNotice(Integer id) { Notice notices = plateService.selectNotice(id); return notices; } }
@Controller public class LoginController {
@RequestMapping(value="/loginAction", method = RequestMethod.POST) @ResponseBody
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| User byNameUser = userService.findByName((String)map.get("username")); if (byNameUser != null){ throw new CustomException(ResultCode.USER_EXIST); } String ip = IPUtils.getIpAddr(request); System.out.println(ip); String salt = MD5.getSalt(); String passwordDB = MD5.getMd5String((String)map.get("password"),salt); map.put("password",passwordDB); map.put("salt",salt); map.put("register_ip",ip); userService.register(map); return ApiResult.of(ResultCode.SUCCESS); }
@RequestMapping("/resetPassword") @ResponseBody public ApiResult addUser(@RequestParam("id") Integer id) { Map map = new HashMap(); String salt = MD5.getSalt(); String passwordDB = MD5.getMd5String("000000",salt); map.put("id",id); map.put("password",passwordDB); map.put("salt",salt); userService.updateUser(map); return ApiResult.of(ResultCode.SUCCESS); } }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=582124492208201mk
https://javayms.pages.dev?id=582124492208201mk