springboot校园周边美食探索及分享平台源码和论文

springboot校园周边美食探索及分享平台源码和论文021

美食一直是与人们日常生活息息相关的产业。传统的电话订餐或者到店消费已经不能适应市场发展的需求。随着网络的迅速崛起,互联网日益成为提供信息的最佳俱渠道和逐步走向传统的流通领域,传统的美食业进而也面临着巨大的挑战,此时推出网络订餐非常适时。

与传统的电话订餐以及去店里订餐的方式相比,网络订餐有着自己独特的优点——直观、互动性强、成本低、方便快捷。顾客可以及时了解到最新商品,及时反馈商家的服务;也能在商家营业的任何时候下单,并且自由决定送餐时间,这对于消费者也是更好的服务。对于商家来说,也可以更方便地留住有价值的客户,挖掘潜在客户等本论文系统地描绘了整个网上校园周边美食探索及分享平台的设计与实现,主要实现的功能有以下几点:管理员;首页、个人中心、用户管理、美食鉴赏管理、我的好友管理、我的收藏管理、系统管理,前台首页;首页、美食鉴赏、我的好友、个人中心、后台管理,用户后台;首页、个人中心、美食鉴赏管理、我的好友管理、我的收藏管理等功能,其具有简单的接口,方便的应用,强大的互动,完全基于互联网的特点。

现代社会的网络和信息技术不断提高,人们的生活水平达到一个新的层次。这篇文章研究了基于Spring Boot框架的校园周边美食探索及分享平台的开发和实现,从需求分析、总体设计到具体实现,最终完成了整个在线校园周边美食探索及分享平台,从而方便了用户和提高了管理员的管理水平。

关键词:校园周边美食探索及分享平台,Spring Boot框架,数据库MYSQL,Java语言

Abstract:

    Catering industry has always been closely related to people's daily life. The traditional telephone ordering or store consumption can not meet the needs of market development. With the rapid rise of the Internet, the Internet is becoming the best channel to provide information and gradually moving towards the traditional circulation field. The traditional catering industry is also facing great challenges. At this time, it is very timely to launch online ordering.

Compared with the traditional way of telephone ordering and ordering in the store, online ordering has its own unique advantages - intuitive, interactive, low cost, convenient and fast. Customers can know the latest products in time and feed back the service of the business in time; they can also place orders at any time when the business is open and freely decide the meal delivery time, which is also a better service for consumers. For businesses, it is more convenient to retain valuable customers and tap potential customers. This paper systematically describes the design and implementation of the food exploration and sharing platform around the campus. The main functions are as follows: administrator; home page, personal center, user management, food appreciation management, my friends management, my collection management, system management Management, front page; home page, food appreciation, my friends, personal center, background management, user background; home page, personal center, food appreciation management, my friends management, my collection management and other functions, it has a simple interface, convenient application, powerful interaction, completely based on the characteristics of the Internet.

With the continuous improvement of network and information technology in modern society, people's living standard has reached a new level. This paper studies the development and implementation of campus food exploration and sharing platform based on spring boot framework, from demand analysis, overall design to specific implementation, and finally completes the whole online campus food exploration and sharing platform, so as to facilitate users and improve the management level of administrators.

Key words: campus food exploration and sharing platform, spring boot framework, database mysql, Java language

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.DefaultuserEntity;
import com.entity.view.DefaultuserView;

import com.service.DefaultuserService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 注册用户
 * 后端接口
 * @author 
 * @email 
 * @date 2021-03-12 20:57:00
 */
@RestController
@RequestMapping("/defaultuser")
public class DefaultuserController {
    @Autowired
    private DefaultuserService defaultuserService;
    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		DefaultuserEntity user = defaultuserService.selectOne(new EntityWrapper<DefaultuserEntity>().eq("username", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		
		String token = tokenService.generateToken(user.getId(), username,"defaultuser",  "注册用户" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody DefaultuserEntity defaultuser){
    	//ValidatorUtils.validateEntity(defaultuser);
    	DefaultuserEntity user = defaultuserService.selectOne(new EntityWrapper<DefaultuserEntity>().eq("username", defaultuser.getUsername()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		defaultuser.setId(uId);
        defaultuserService.insert(defaultuser);
        return R.ok();
    }
	
	/**
	 * 退出
	 */
	@RequestMapping("/logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        DefaultuserEntity user = defaultuserService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	DefaultuserEntity user = defaultuserService.selectOne(new EntityWrapper<DefaultuserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
        user.setMima("123456");
        defaultuserService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,DefaultuserEntity defaultuser,
		HttpServletRequest request){
        EntityWrapper<DefaultuserEntity> ew = new EntityWrapper<DefaultuserEntity>();
		PageUtils page = defaultuserService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, defaultuser), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,DefaultuserEntity defaultuser, HttpServletRequest request){
        EntityWrapper<DefaultuserEntity> ew = new EntityWrapper<DefaultuserEntity>();
		PageUtils page = defaultuserService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, defaultuser), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( DefaultuserEntity defaultuser){
       	EntityWrapper<DefaultuserEntity> ew = new EntityWrapper<DefaultuserEntity>();
      	ew.allEq(MPUtil.allEQMapPre( defaultuser, "defaultuser")); 
        return R.ok().put("data", defaultuserService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(DefaultuserEntity defaultuser){
        EntityWrapper< DefaultuserEntity> ew = new EntityWrapper< DefaultuserEntity>();
 		ew.allEq(MPUtil.allEQMapPre( defaultuser, "defaultuser")); 
		DefaultuserView defaultuserView =  defaultuserService.selectView(ew);
		return R.ok("查询注册用户成功").put("data", defaultuserView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        DefaultuserEntity defaultuser = defaultuserService.selectById(id);
        return R.ok().put("data", defaultuser);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        DefaultuserEntity defaultuser = defaultuserService.selectById(id);
        return R.ok().put("data", defaultuser);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody DefaultuserEntity defaultuser, HttpServletRequest request){
    	defaultuser.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(defaultuser);
    	DefaultuserEntity user = defaultuserService.selectOne(new EntityWrapper<DefaultuserEntity>().eq("username", defaultuser.getUsername()));
		if(user!=null) {
			return R.error("用户已存在");
		}
		defaultuser.setId(new Date().getTime());
        defaultuserService.insert(defaultuser);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody DefaultuserEntity defaultuser, HttpServletRequest request){
    	defaultuser.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(defaultuser);
    	DefaultuserEntity user = defaultuserService.selectOne(new EntityWrapper<DefaultuserEntity>().eq("username", defaultuser.getUsername()));
		if(user!=null) {
			return R.error("用户已存在");
		}
		defaultuser.setId(new Date().getTime());
        defaultuserService.insert(defaultuser);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody DefaultuserEntity defaultuser, HttpServletRequest request){
        //ValidatorUtils.validateEntity(defaultuser);
        defaultuserService.updateById(defaultuser);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        defaultuserService.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());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<DefaultuserEntity> wrapper = new EntityWrapper<DefaultuserEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = defaultuserService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

 

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.DiscussmeishijianshangEntity;
import com.entity.view.DiscussmeishijianshangView;

import com.service.DiscussmeishijianshangService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 美食鉴赏评论表
 * 后端接口
 * @author 
 * @email 
 * @date 2021-03-12 20:57:00
 */
@RestController
@RequestMapping("/discussmeishijianshang")
public class DiscussmeishijianshangController {
    @Autowired
    private DiscussmeishijianshangService discussmeishijianshangService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,DiscussmeishijianshangEntity discussmeishijianshang,
		HttpServletRequest request){
        EntityWrapper<DiscussmeishijianshangEntity> ew = new EntityWrapper<DiscussmeishijianshangEntity>();
		PageUtils page = discussmeishijianshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussmeishijianshang), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,DiscussmeishijianshangEntity discussmeishijianshang, HttpServletRequest request){
        EntityWrapper<DiscussmeishijianshangEntity> ew = new EntityWrapper<DiscussmeishijianshangEntity>();
		PageUtils page = discussmeishijianshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussmeishijianshang), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( DiscussmeishijianshangEntity discussmeishijianshang){
       	EntityWrapper<DiscussmeishijianshangEntity> ew = new EntityWrapper<DiscussmeishijianshangEntity>();
      	ew.allEq(MPUtil.allEQMapPre( discussmeishijianshang, "discussmeishijianshang")); 
        return R.ok().put("data", discussmeishijianshangService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(DiscussmeishijianshangEntity discussmeishijianshang){
        EntityWrapper< DiscussmeishijianshangEntity> ew = new EntityWrapper< DiscussmeishijianshangEntity>();
 		ew.allEq(MPUtil.allEQMapPre( discussmeishijianshang, "discussmeishijianshang")); 
		DiscussmeishijianshangView discussmeishijianshangView =  discussmeishijianshangService.selectView(ew);
		return R.ok("查询美食鉴赏评论表成功").put("data", discussmeishijianshangView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        DiscussmeishijianshangEntity discussmeishijianshang = discussmeishijianshangService.selectById(id);
        return R.ok().put("data", discussmeishijianshang);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        DiscussmeishijianshangEntity discussmeishijianshang = discussmeishijianshangService.selectById(id);
        return R.ok().put("data", discussmeishijianshang);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody DiscussmeishijianshangEntity discussmeishijianshang, HttpServletRequest request){
    	discussmeishijianshang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(discussmeishijianshang);
        discussmeishijianshangService.insert(discussmeishijianshang);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody DiscussmeishijianshangEntity discussmeishijianshang, HttpServletRequest request){
    	discussmeishijianshang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(discussmeishijianshang);
        discussmeishijianshangService.insert(discussmeishijianshang);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody DiscussmeishijianshangEntity discussmeishijianshang, HttpServletRequest request){
        //ValidatorUtils.validateEntity(discussmeishijianshang);
        discussmeishijianshangService.updateById(discussmeishijianshang);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        discussmeishijianshangService.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());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<DiscussmeishijianshangEntity> wrapper = new EntityWrapper<DiscussmeishijianshangEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = discussmeishijianshangService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值