【2024】基于springboot的美食推荐小程序系统设计(源码+文档+指导)

发布时间:2024-12-01 21:42

个性化推荐算法:基于阅读历史和兴趣的推荐系统 #生活乐趣# #阅读乐趣# #电子书推荐#

该项目含有源码、文档、PPT、配套开发软件、软件安装教程、项目发布教程等学习内容。

目录

一、项目介绍:

二、文档学习资料:

三、模块截图:

四、开发技术与运行环境:

五、代码展示:

六、数据库表截图:

一、项目介绍:

课题背景、研究思路

背景:

随着移动互联网的普及,人们越来越依赖手机应用程序来完成日常生活中的各种需求,包括寻找美食。美食推荐小程序可以为消费者提供一个方便快捷的美食发现和推荐平台,同时为商家提供更广阔的宣传和销售渠道。基于Spring Boot的美食推荐小程序系统可以更好地满足现代消费者的需求,为商家提供更高效的管理方式。

目的:

本课题旨在设计和开发一个基于Spring Boot的美食推荐小程序系统,旨在满足消费者对美食的发现和推荐需求,并为商家提供更好的宣传和销售支持。

研究意义:

消费者可以通过该系统方便地浏览和发现各类美食,提高生活品质。商家可以通过该系统实现商品的在线宣传、销售和库存管理等功能,提高销售效率和管理水平。系统可以收集消费者数据和购买行为,为商家提供市场分析和营销策略的依据,促进业务的发展。

研究思路:

系统需求分析:深入了解消费者和商家的需求,明确系统的功能模块和性能要求。技术选型:选择Spring Boot作为后端框架,并结合其他相关技术进行系统开发。系统设计:设计系统的数据库结构、界面布局、业务逻辑等,确保系统的稳定性和可扩展性。系统实现:按照设计文档进行编码,实现各个功能模块,并进行单元测试和集成测试。系统部署与维护:将系统部署到服务器,进行压力测试和性能优化,并根据实际运行情况进行必要的维护和升级。效果评估与反馈:通过实际使用情况对系统进行效果评估,收集用户反馈,持续优化和改进系统。

二、文档学习资料:

三、模块截图:

四、开发技术与运行环境

后端技术栈:

Spring Boot:使用Spring Boot作为后端框架,简化开发流程,提供快速开发的能力。Spring Security:用于实现用户认证和授权功能,保护系统的安全性。Spring Data JPA:用于简化对数据库的操作,提供CRUD功能。MySQL:作为数据库存储管理平台的数据。 MyBatis-Plus:MyBatis-Plus 主要负责处理数据库操作,提高数据库操作的便捷性和效率。

前端技术栈:

Vue.js:使用Vue.js作为前端框架,实现组件化开发,提高开发效率。Vue Router:用于实现前端路由功能,实现单页应用的页面跳转。Vuex:用于实现前端状态管理,统一管理应用的状态。Element UI:使用Element UI作为UI组件库,提供丰富的UI组件,加快开发速度。Axios:用于发送HTTP请求,与后端进行数据交互。HTML/CSS/JavaScript:用于构建系统的用户界面。HTML 负责网页的结构布局,CSS 负责样式设计,JavaScript 负责交互逻辑的实现。在系统中,这些技术用于实现前端页面的展示和交互功能,提高用户体验。

其他技术:

Maven:用于项目构建和依赖管理,简化项目的管理和部署。

运行环境:

1. 开发环境:

   IDE:如IDEA或eclipse,用于编码和调试。

   本地数据库:如MySQL,用于数据存储和查询。

   本地服务器:如Tomcat7.0,用于部署和运行Web应用。

五、代码展示(示范代码注释):

@RestController

@Controller

@RequestMapping("/yonghu")

public class YonghuController {

private static final Logger logger = LoggerFactory.getLogger(YonghuController.class);

private static final String TABLE_NAME = "yonghu";

@Autowired

private YonghuService yonghuService;

@Autowired

private TokenService tokenService;

@Autowired

private DictionaryService dictionaryService;

@Autowired

private GonggaoService gonggaoService;

@Autowired

private GuwenService guwenService;

@Autowired

private GuwenChatService guwenChatService;

@Autowired

private GuwenYuyueService guwenYuyueService;

@Autowired

private JiankangzhishiService jiankangzhishiService;

@Autowired

private JiankangzhishiCollectionService jiankangzhishiCollectionService;

@Autowired

private JiankangzhishiLiuyanService jiankangzhishiLiuyanService;

@Autowired

private UsersService usersService;

@RequestMapping("/page")

public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){

logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

String role = String.valueOf(request.getSession().getAttribute("role"));

if(false)

return R.error(511,"永不会进入");

else if("用户".equals(role))

params.put("yonghuId",request.getSession().getAttribute("userId"));

else if("顾问".equals(role))

params.put("guwenId",request.getSession().getAttribute("userId"));

CommonUtil.checkMap(params);

PageUtils page = yonghuService.queryPage(params);

List<YonghuView> list =(List<YonghuView>)page.getList();

for(YonghuView c:list){

dictionaryService.dictionaryConvert(c, request);

}

return R.ok().put("data", page);

}

@RequestMapping("/info/{id}")

public R info(@PathVariable("id") Long id, HttpServletRequest request){

logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

YonghuEntity yonghu = yonghuService.selectById(id);

if(yonghu !=null){

YonghuView view = new YonghuView();

BeanUtils.copyProperties( yonghu , view );

dictionaryService.dictionaryConvert(view, request);

return R.ok().put("data", view);

}else {

return R.error(511,"查不到数据");

}

}

@RequestMapping("/save")

public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){

logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());

String role = String.valueOf(request.getSession().getAttribute("role"));

if(false)

return R.error(511,"永远不会进入");

Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()

.eq("username", yonghu.getUsername())

.or()

.eq("yonghu_phone", yonghu.getYonghuPhone())

.or()

.eq("yonghu_id_number", yonghu.getYonghuIdNumber())

;

logger.info("sql语句:"+queryWrapper.getSqlSegment());

YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);

if(yonghuEntity==null){

yonghu.setCreateTime(new Date());

yonghu.setPassword("123456");

yonghuService.insert(yonghu);

return R.ok();

}else {

return R.error(511,"账户或者用户手机号或者用户身份证号已经被使用");

}

}

@RequestMapping("/update")

public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {

logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());

YonghuEntity oldYonghuEntity = yonghuService.selectById(yonghu.getId());

String role = String.valueOf(request.getSession().getAttribute("role"));

if("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())){

yonghu.setYonghuPhoto(null);

}

yonghuService.updateById(yonghu);

return R.ok();

}

@RequestMapping("/delete")

public R delete(@RequestBody Integer[] ids, HttpServletRequest request){

logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());

List<YonghuEntity> oldYonghuList =yonghuService.selectBatchIds(Arrays.asList(ids));

yonghuService.deleteBatchIds(Arrays.asList(ids));

return R.ok();

}

@RequestMapping("/batchInsert")

public R save( String fileName, HttpServletRequest request){

logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);

Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

try {

List<YonghuEntity> yonghuList = new ArrayList<>();

Map<String, List<String>> seachFields= new HashMap<>();

Date date = new Date();

int lastIndexOf = fileName.lastIndexOf(".");

if(lastIndexOf == -1){

return R.error(511,"该文件没有后缀");

}else{

String suffix = fileName.substring(lastIndexOf);

if(!".xls".equals(suffix)){

return R.error(511,"只支持后缀为xls的excel文件");

}else{

URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);

File file = new File(resource.getFile());

if(!file.exists()){

return R.error(511,"找不到上传文件,请联系管理员");

}else{

List<List<String>> dataList = PoiUtil.poiImport(file.getPath());

dataList.remove(0);

for(List<String> data:dataList){

YonghuEntity yonghuEntity = new YonghuEntity();

yonghuList.add(yonghuEntity);

if(seachFields.containsKey("username")){

List<String> username = seachFields.get("username");

username.add(data.get(0));

}else{

List<String> username = new ArrayList<>();

username.add(data.get(0));

seachFields.put("username",username);

}

if(seachFields.containsKey("yonghuPhone")){

List<String> yonghuPhone = seachFields.get("yonghuPhone");

yonghuPhone.add(data.get(0));

}else{

List<String> yonghuPhone = new ArrayList<>();

yonghuPhone.add(data.get(0));

seachFields.put("yonghuPhone",yonghuPhone);

}

if(seachFields.containsKey("yonghuIdNumber")){

List<String> yonghuIdNumber = seachFields.get("yonghuIdNumber");

yonghuIdNumber.add(data.get(0));

}else{

List<String> yonghuIdNumber = new ArrayList<>();

yonghuIdNumber.add(data.get(0));

seachFields.put("yonghuIdNumber",yonghuIdNumber);

}

}

List<YonghuEntity> yonghuEntities_username = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("username", seachFields.get("username")));

if(yonghuEntities_username.size() >0 ){

ArrayList<String> repeatFields = new ArrayList<>();

for(YonghuEntity s:yonghuEntities_username){

repeatFields.add(s.getUsername());

}

return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());

}

List<YonghuEntity> yonghuEntities_yonghuPhone = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_phone", seachFields.get("yonghuPhone")));

if(yonghuEntities_yonghuPhone.size() >0 ){

ArrayList<String> repeatFields = new ArrayList<>();

for(YonghuEntity s:yonghuEntities_yonghuPhone){

repeatFields.add(s.getYonghuPhone());

}

return R.error(511,"数据库的该表中的 [用户手机号] 字段已经存在 存在数据为:"+repeatFields.toString());

}

List<YonghuEntity> yonghuEntities_yonghuIdNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_id_number", seachFields.get("yonghuIdNumber")));

if(yonghuEntities_yonghuIdNumber.size() >0 ){

ArrayList<String> repeatFields = new ArrayList<>();

for(YonghuEntity s:yonghuEntities_yonghuIdNumber){

repeatFields.add(s.getYonghuIdNumber());

}

return R.error(511,"数据库的该表中的 [用户身份证号] 字段已经存在 存在数据为:"+repeatFields.toString());

}

yonghuService.insertBatch(yonghuList);

return R.ok();

}

}

}

}catch (Exception e){

e.printStackTrace();

return R.error(511,"批量插入数据异常,请联系管理员");

}

}

@IgnoreAuth

@RequestMapping(value = "/login")

public R login(String username, String password, String captcha, HttpServletRequest request) {

YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));

if(yonghu==null || !yonghu.getPassword().equals(password))

return R.error("账号或密码不正确");

String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "用户");

R r = R.ok();

r.put("token", token);

r.put("role","用户");

r.put("username",yonghu.getYonghuName());

r.put("tableName","yonghu");

r.put("userId",yonghu.getId());

return r;

}

@IgnoreAuth

@PostMapping(value = "/register")

public R register(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {

Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()

.eq("username", yonghu.getUsername())

.or()

.eq("yonghu_phone", yonghu.getYonghuPhone())

.or()

.eq("yonghu_id_number", yonghu.getYonghuIdNumber())

;

YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);

if(yonghuEntity != null)

return R.error("账户或者用户手机号或者用户身份证号已经被使用");

yonghu.setCreateTime(new Date());

yonghuService.insert(yonghu);

return R.ok();

}

@GetMapping(value = "/resetPassword")

public R resetPassword(Integer id, HttpServletRequest request) {

YonghuEntity yonghu = yonghuService.selectById(id);

yonghu.setPassword("123456");

yonghuService.updateById(yonghu);

return R.ok();

}

@GetMapping(value = "/updatePassword")

public R updatePassword(String oldPassword, String newPassword, HttpServletRequest request) {

YonghuEntity yonghu = yonghuService.selectById((Integer)request.getSession().getAttribute("userId"));

if(newPassword == null){

return R.error("新密码不能为空") ;

}

if(!oldPassword.equals(yonghu.getPassword())){

return R.error("原密码输入错误");

}

if(newPassword.equals(yonghu.getPassword())){

return R.error("新密码不能和原密码一致") ;

}

yonghu.setPassword(newPassword);

yonghuService.updateById(yonghu);

return R.ok();

}

@IgnoreAuth

@RequestMapping(value = "/resetPass")

public R resetPass(String username, HttpServletRequest request) {

YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));

if(yonghu!=null){

yonghu.setPassword("123456");

yonghuService.updateById(yonghu);

return R.ok();

}else{

return R.error("账号不存在");

}

}

@RequestMapping("/session")

public R getCurrYonghu(HttpServletRequest request){

Integer id = (Integer)request.getSession().getAttribute("userId");

YonghuEntity yonghu = yonghuService.selectById(id);

if(yonghu !=null){

YonghuView view = new YonghuView();

BeanUtils.copyProperties( yonghu , view );

dictionaryService.dictionaryConvert(view, request);

return R.ok().put("data", view);

}else {

return R.error(511,"查不到数据");

}

}

@GetMapping(value = "logout")

public R logout(HttpServletRequest request) {

request.getSession().invalidate();

return R.ok("退出成功");

}

@IgnoreAuth

@RequestMapping("/list")

public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){

logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

CommonUtil.checkMap(params);

PageUtils page = yonghuService.queryPage(params);

List<YonghuView> list =(List<YonghuView>)page.getList();

for(YonghuView c:list)

dictionaryService.dictionaryConvert(c, request);

return R.ok().put("data", page);

}

@RequestMapping("/detail/{id}")

public R detail(@PathVariable("id") Long id, HttpServletRequest request){

logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

YonghuEntity yonghu = yonghuService.selectById(id);

if(yonghu !=null){

YonghuView view = new YonghuView();

BeanUtils.copyProperties( yonghu , view );

dictionaryService.dictionaryConvert(view, request);

return R.ok().put("data", view);

}else {

return R.error(511,"查不到数据");

}

}

@RequestMapping("/add")

public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){

logger.debug("add方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());

Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()

.eq("username", yonghu.getUsername())

.or()

.eq("yonghu_phone", yonghu.getYonghuPhone())

.or()

.eq("yonghu_id_number", yonghu.getYonghuIdNumber())

;

logger.info("sql语句:"+queryWrapper.getSqlSegment());

YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);

if(yonghuEntity==null){

yonghu.setCreateTime(new Date());

yonghu.setPassword("123456");

yonghuService.insert(yonghu);

return R.ok();

}else {

return R.error(511,"账户或者用户手机号或者用户身份证号已经被使用");

}

}

}

六、数据库表截图(示范表注释):

七、配套学习资料

网址:【2024】基于springboot的美食推荐小程序系统设计(源码+文档+指导) https://www.yuejiaxmz.com/news/view/338853

相关内容

基于小程序的健康食谱推荐系统设计与实现(源码+文档+指导)
基于微信小程序的设计—美食推荐系统设计(附论文+源码)
基于SpringBoot+微信小程序的美食推荐系统(协同过滤算法)
基于SpringBoot + Vue的儿童图书推荐系统设计与实现(源码+文档+部署)
JAVA计算机毕业设计基于SpringBoot的个人健康管理系统(附源码+springboot+开题+论文)
基于nodejs+vue基于springboot的小区旧物交易系统的设计与实现[开题+源码+程序+论文]计算机毕业设计
springboot毕设基于JavaWeb的菜谱推荐系统源码+论文+部署
基于SpringBoot大学校园旧物捐赠系统的设计与实现(源码+LW+调试文档)
java基于springboot美食推荐管理系统附源码风格
【开题报告】基于Springboot+vue中华美食菜谱系统设计与实现(程序+源码+论文) 计算机毕业设计

随便看看