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






基于javaweb的SpringBoot在线游戏商城系统(java+springboot+mybatis+mysql+maven+layui+thymeleaf+html)
一、项目简述功能包括: 用户管理,游戏商品管理,在线购买,上传,售卖记录,商品审核等等。
二、项目运行环境配置:
Jdk1.8 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
JSP +Spring + SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等
——————————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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| if (price != 0){ if (price == 1){ Collections.sort(commodityList, new Comparator<Commodity>() { int i; @Override public int compare(Commodity o1, Commodity o2) { if (o1.getThinkmoney().compareTo(o2.getThinkmoney()) > -1) { System.out.println("===o1大于等于o2==="); i = 1; } else if (o1.getThinkmoney().compareTo(o2.getThinkmoney()) < 1) { i = -1; System.out.println("===o1小于等于o2==="); } return i; } }); }else if (price == 2){ Collections.sort(commodityList, new Comparator<Commodity>() { int i; @Override public int compare(Commodity o1, Commodity o2) { if (o1.getThinkmoney().compareTo(o2.getThinkmoney()) > -1) { System.out.println("===o1大于等于o2==="); i = -1; } else if (o1.getThinkmoney().compareTo(o2.getThinkmoney()) < 1) { System.out.println("===o1小于等于o2==="); i = 1; } return i; } }); } } return new ResultVo(true,StatusCode.OK,"查询成功",commodityList); }
@GetMapping("/user/commodity/{commstatus}") @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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
@GetMapping("/echars/console") public String echars(){ return "/admin/echars/console"; }
@GetMapping("/app/message/index") public String appmessageindex(){ return "/admin/app/message/index"; }
@GetMapping("/user/collect") public String usercollect(){ return "/user/collect/collectlist"; }
@GetMapping("/user/sold") public String sold(){ return "/user/sold/soldrecord"; }
@GetMapping("/admin/sold") public String adminSold(){ return "/admin/sold/soldrecord"; }
@GetMapping("/user/newslist") public String userNews(){ return "/common/listnews"; }
@GetMapping("/admin/newslist") public String adminNews(){ return "/admin/news/newslist";
|
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
| return new LayuiPageVo("", 0,dataNumber,noticesList); }
}
package com.controller;
/** * <p> * 销售记录控制器 * </p> * */ @Controller public class SoldrecordController { @Autowired private SoldrecordService soldrecordService;
/** * 删除售出记录 * 1.前端传入需删除记录的id(id) * 2.判断是否是本人 * */ @ResponseBody @PutMapping("/soldrecord/delect/{id}") public ResultVo delectSold (@PathVariable("id") String id) { Integer i = soldrecordService.deleteSold(id); if (i == 1){ return new ResultVo(true, StatusCode.OK,"删除记录成功"); } return new ResultVo(false, StatusCode.ERROR,"删除记录失败");
|
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 41 42 43 44 45
| UserInfo userInfo = new UserInfo().setUserid(userid).setUimage(uimgUrl); userInfoService.UpdateUserInfo(userInfo); return res; }
@RequiresPermissions("user:userinfo") @GetMapping("/user/lookinfo") public String lookinfo(HttpSession session, ModelMap modelMap) { String userid = (String) session.getAttribute("userid"); UserInfo userInfo = userInfoService.LookUserinfo(userid); modelMap.put("userInfo",userInfo); return "/user/userinfo"; }
@GetMapping("/user/perfectinfo") public String perfectInfo(HttpSession session, ModelMap modelMap) { String userid = (String) session.getAttribute("userid"); UserInfo userInfo = userInfoService.LookUserinfo(userid); modelMap.put("perfectInfo",userInfo); return "/user/perfectinfo"; }
@ResponseBody @PostMapping("/user/updateinfo") public ResultVo updateInfo(@RequestBody UserInfo userInfo, HttpSession session) { String username = userInfo.getUsername();
String sessionname = (String) session.getAttribute("username"); String userid = (String) session.getAttribute("userid"); Login login = new Login(); if (!StringUtils.isEmpty(username)){
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
/** * <p> * 登录注册 控制器 * </p> * */ @Controller public class LoginController { @Autowired private LoginService loginService; @Autowired private UserInfoService userInfoService; @Autowired private UserRoleService userRoleService; /**手机号和注册验证码map集合*/ private static Map<String, String> phonecodemap1 = new HashMap<>(); /**手机号和重置密码验证码map集合*/ private static Map<String, String> phonecodemap2 = new HashMap<>(); /** *图片验证码 * */
|
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 41 42 43 44 45 46
| * 0:封号 1:解封 */ @PutMapping("/admin/user/forbid/{userid}/{userstatus}") @ResponseBody public ResultVo adminuserlist(@PathVariable("userid") String userid,@PathVariable("userstatus") Integer userstatus) { if (userstatus == 0){ Integer i = loginService.updateLogin(new Login().setUserid(userid).setUserstatus(userstatus)); Integer j = userInfoService.UpdateUserInfo(new UserInfo().setUserid(userid).setUserstatus(userstatus)); if (i ==1 && j == 1){ Notices notices = new Notices().setId(KeyUtil.genUniqueKey()).setUserid(userid).setTpname("系统通知") .setWhys("因为您的不良行为,您在该网站的账号已被封号。"); noticesService.insertNotices(notices); return new ResultVo(true, StatusCode.OK, "封号成功"); } return new ResultVo(true, StatusCode.ERROR, "封号失败"); }else if (userstatus == 1){ Integer i = loginService.updateLogin(new Login().setUserid(userid).setUserstatus(userstatus)); Integer j = userInfoService.UpdateUserInfo(new UserInfo().setUserid(userid).setUserstatus(userstatus)); if (i ==1 && j == 1){ Notices notices = new Notices().setId(KeyUtil.genUniqueKey()).setUserid(userid).setTpname("系统通知") .setWhys("您在该网站的账号已被解封,希望您保持良好的行为。"); noticesService.insertNotices(notices); return new ResultVo(true, StatusCode.OK, "解封成功"); } return new ResultVo(true, StatusCode.ERROR, "解封失败"); } return new ResultVo(false,StatusCode.ACCESSERROR,"违规操作"); }
@GetMapping("/admin/product") public String adminproduct(){ return "/admin/product/productlist"; }
@GetMapping("/admin/commodity/{commstatus}")
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=581422272105200ca
https://javayms.pages.dev?id=581422272105200ca