——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明










基于javaweb的SpringBoot导师双选系统(java+springboot+maven+mybaits+vue+elementui+mysql)
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:Vue + elementui
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| 管理员: admin 123456
学员: 学员1 123456 学员2 123456 学员3 123456 学员4 123456 学员5 123456 学员6 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 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
|
@RequestMapping("users") @RestController public class UserController{ @Autowired private UserService userService; @Autowired private TokenService tokenService;
@IgnoreAuth @PostMapping(value = "/login") public R login(String username, String password, String captcha, HttpServletRequest request) { UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username)); if(user==null || !user.getPassword().equals(password)) { return R.error("账号或密码不正确"); } String token = tokenService.generateToken(user.getId(),username, "users", user.getRole()); return R.ok().put("token", token); }
@IgnoreAuth @PostMapping(value = "/register") public R register(@RequestBody UserEntity 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 46 47 48
| EntityWrapper< DaoshiEntity> ew = new EntityWrapper< DaoshiEntity>(); ew.allEq(MPUtil.allEQMapPre( daoshi, "daoshi")); DaoshiView daoshiView = daoshiService.selectView(ew); return R.ok("查询导师成功").put("data", daoshiView); }
@RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ DaoshiEntity daoshi = daoshiService.selectById(id); return R.ok().put("data", daoshi); }
@RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ DaoshiEntity daoshi = daoshiService.selectById(id); return R.ok().put("data", daoshi); }
@RequestMapping("/save") public R save(@RequestBody DaoshiEntity daoshi, HttpServletRequest request){ daoshi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); DaoshiEntity user = daoshiService.selectOne(new EntityWrapper<DaoshiEntity>().eq("gonghao", daoshi.getGonghao())); if(user!=null) { return R.error("用户已存在"); } daoshi.setId(new Date().getTime()); daoshiService.insert(daoshi); return R.ok(); }
@RequestMapping("/add") public R add(@RequestBody DaoshiEntity daoshi, HttpServletRequest request){
|
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
|
@RequestMapping("users") @RestController public class UserController{ @Autowired private UserService userService; @Autowired private TokenService tokenService;
@IgnoreAuth @PostMapping(value = "/login") public R login(String username, String password, String captcha, HttpServletRequest request) { UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username)); if(user==null || !user.getPassword().equals(password)) { return R.error("账号或密码不正确"); } String token = tokenService.generateToken(user.getId(),username, "users", user.getRole()); return R.ok().put("token", token); }
|
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
| 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<DaoshixinxiEntity> wrapper = new EntityWrapper<DaoshixinxiEntity>(); if(map.get("remindstart")!=null) { wrapper.ge(columnName, map.get("remindstart")); } if(map.get("remindend")!=null) { wrapper.le(columnName, map.get("remindend")); }
int count = daoshixinxiService.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 41 42 43
| * 列表 */ @RequestMapping("/lists") public R list( XiangmuxinxiEntity xiangmuxinxi){ EntityWrapper<XiangmuxinxiEntity> ew = new EntityWrapper<XiangmuxinxiEntity>(); ew.allEq(MPUtil.allEQMapPre( xiangmuxinxi, "xiangmuxinxi")); return R.ok().put("data", xiangmuxinxiService.selectListView(ew)); }
@RequestMapping("/query") public R query(XiangmuxinxiEntity xiangmuxinxi){ EntityWrapper< XiangmuxinxiEntity> ew = new EntityWrapper< XiangmuxinxiEntity>(); ew.allEq(MPUtil.allEQMapPre( xiangmuxinxi, "xiangmuxinxi")); XiangmuxinxiView xiangmuxinxiView = xiangmuxinxiService.selectView(ew); return R.ok("查询项目信息成功").put("data", xiangmuxinxiView); }
@RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ XiangmuxinxiEntity xiangmuxinxi = xiangmuxinxiService.selectById(id); return R.ok().put("data", xiangmuxinxi); }
@RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ XiangmuxinxiEntity xiangmuxinxi = xiangmuxinxiService.selectById(id); return R.ok().put("data", xiangmuxinxi); }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=142325042508201td
https://javayms.pages.dev?id=142325042508201td