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






基于javaweb的SSM+Maven美食推荐管理系统(java+ssm+jsp+jquery+bootstrap+layui+mysql)
项目介绍
基于SSM的 美食推荐管理系统
角色:管理员、用户
美食推荐管理系统是基于java编程语言,ssm框架,mysql数据库开发,本系统主要分为用户和管理员两个角色,
其中用户注册登陆后可以查看美食,教程,社区,资讯公告,收藏,评论;
管理员对用户,美食,美食分类,店铺,社区等信息进行管理。本系统功能齐全,文档齐全。
后台: SSM(Spring+SpringMVC+Mybatis)
前台:JSP+jQuery+bootstrap+layui
——————————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
|
@RestController public class CommonController{ @Autowired private CommonService commonService; @Autowired private ConfigService configService; private static AipFace client = null; private static String BAIDU_DITU_AK = null; @RequestMapping("/location") public R location(String lng,String lat) { if(BAIDU_DITU_AK==null) { BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue(); if(BAIDU_DITU_AK==null) { return R.error("请在配置管理中正确配置baidu_ditu_ak"); } } Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat); return R.ok().put("data", map); }
@RequestMapping("/matchFace")
|
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
| PageUtils page = configService.queryPage(params); return R.ok().put("data", page); }
@RequestMapping("/info/{id}") public R info(@PathVariable("id") String id){ ConfigEntity config = configService.selectById(id); return R.ok().put("data", config); }
@IgnoreAuth @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") String id){ ConfigEntity config = configService.selectById(id); return R.ok().put("data", config); }
@RequestMapping("/info") public R infoByName(@RequestParam String name){ ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile")); return R.ok().put("data", config); }
@PostMapping("/save") public R save(@RequestBody ConfigEntity config){
configService.insert(config); return R.ok(); }
@RequestMapping("/update") public R update(@RequestBody ConfigEntity config){
configService.updateById(config); 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 44 45 46 47 48 49 50
| @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); }
@IgnoreAuth @RequestMapping(value = "/resetPass") public R resetPass(String username, HttpServletRequest request){ YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", username)); if(user==null) { return R.error("账号不存在"); } user.setMima("123456"); yonghuService.updateById(user); return R.ok("密码已重置为:123456"); }
|
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
|
@RequestMapping("/query") public R query(YonghuEntity yonghu){ EntityWrapper< YonghuEntity> ew = new EntityWrapper< YonghuEntity>(); ew.allEq(MPUtil.allEQMapPre( yonghu, "yonghu")); YonghuView yonghuView = yonghuService.selectView(ew); return R.ok("查询用户成功").put("data", yonghuView); }
@RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ YonghuEntity yonghu = yonghuService.selectById(id); return R.ok().put("data", yonghu); }
@RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ YonghuEntity yonghu = yonghuService.selectById(id); return R.ok().put("data", yonghu); }
@RequestMapping("/save") public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){ yonghu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming())); if(user!=null) { return R.error("用户已存在"); }
yonghu.setId(new Date().getTime()); yonghuService.insert(yonghu);
|
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
| * 修改table表的sfsh状态 * @param table * @param map * @return */ @RequestMapping("/sh/{tableName}") public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) { map.put("table", tableName); commonService.sh(map); return R.ok(); }
@RequestMapping("/remind/{tableName}/{columnName}/{type}") @IgnoreAuth public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @PathVariable("type") String type,@RequestParam Map<String, Object> map) { map.put("table", tableName); 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)); } }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=191524190701201kc
https://javayms.pages.dev?id=191524190701201kc