——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8、Node.js≥14
开发工具 后端:eclipse/idea/myeclipse/sts等均可配置运行 前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven电影购票微信小程序(java+ssm++mysql+vue+小程序)
前端启动命令:npm run serve 小程序端启动:微信开发者工具
web端管理员登录: admin 123456
小程序端用户登录: 用户1 123456 用户2 123456 用户3 123456 用户4 123456 用户5 123456 用户6 123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 @RestController
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 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<NewsEntity> wrapper = new EntityWrapper<NewsEntity>(); if (map.get("remindstart" )!=null ) { wrapper.ge(columnName, map.get("remindstart" )); } if (map.get("remindend" )!=null ) { wrapper.le(columnName, map.get("remindend" )); } int count = newsService.selectCount(wrapper); return R.ok().put("count" , count); } }
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 public R update (@RequestBody YonghuEntity yonghu, HttpServletRequest request) { yonghuService.updateById(yonghu); return R.ok(); } @RequestMapping("/delete") public R delete (@RequestBody Long[] ids) { yonghuService.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());
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 FangyingtingEntity fangyingting = fangyingtingService.selectById(id); return R.ok().put("data" , fangyingting); } @RequestMapping("/save") public R save (@RequestBody FangyingtingEntity fangyingting, HttpServletRequest request) { fangyingting.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000 )).longValue()); fangyingtingService.insert(fangyingting); return R.ok(); } @RequestMapping("/add") public R add (@RequestBody FangyingtingEntity fangyingting, HttpServletRequest request) { fangyingting.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000 )).longValue()); fangyingtingService.insert(fangyingting); return R.ok(); } @RequestMapping("/update") public R update (@RequestBody FangyingtingEntity fangyingting, HttpServletRequest request) { fangyingtingService.updateById(fangyingting); return R.ok(); } @RequestMapping("/delete") public R delete (@RequestBody Long[] ids) { fangyingtingService.deleteBatchIds(Arrays.asList(ids)); return R.ok();
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 return R.error("账号或密码不正确" ); } String token = tokenService.generateToken(user.getId(), username,"yonghu" , "用户" ); return R.ok().put("token" , token); } @IgnoreAuth @RequestMapping("/register") public R register (@RequestBody YonghuEntity yonghu) { YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming" , yonghu.getYonghuming())); if (user!=null ) { return R.error("注册用户已存在" ); } Long uId = new Date().getTime(); yonghu.setId(uId); yonghuService.insert(yonghu); return R.ok(); } @RequestMapping("/logout") public R logout (HttpServletRequest request) { request.getSession().invalidate(); return R.ok("退出成功" ); } @RequestMapping("/session") public R getCurrUser (HttpServletRequest request) { Long id = (Long)request.getSession().getAttribute("userId" ); YonghuEntity user = yonghuService.selectById(id); return R.ok().put("data" , user); }
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 NewsEntity news = newsService.selectById(id); return R.ok().put("data" , news); } @RequestMapping("/save") public R save (@RequestBody NewsEntity news, HttpServletRequest request) { news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000 )).longValue()); newsService.insert(news); return R.ok(); } @RequestMapping("/add") public R add (@RequestBody NewsEntity news, HttpServletRequest request) { news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000 )).longValue()); newsService.insert(news); return R.ok(); } @RequestMapping("/update") public R update (@RequestBody NewsEntity news, HttpServletRequest request) { newsService.updateById(news); return R.ok(); }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=151424432906201lx https://javayms.pages.dev?id=151424432906201lx