本项目是专门为餐饮企业(餐厅,饭店)定制的一款软件产品,包括系统管理后台和移动端应用两个部分。其中系统管理后台主要提供给餐饮企业内部员工使用,可以对餐厅的菜品,套餐,订单等进行管理维护。移动端应用是提供给消费者使用,可以在线浏览菜品,添加购物车,下单等
本项目共分为3期进行开发:
【资料图】
第一期主要实现基本需求,其中移动端应用通过H5实现,用户可以通过手机浏览器访问
第二期主要针对移动端应用进行改进,使用微信小程序实现,用户使用起来更加方便
第三期主要针对系统进行优化升级,提高系统的访问性能
产品原型,就是一款产品成型之前的一个简单的框架,就是将页面的排版布局展现出来,使产品的初步构思有一个可视化的展示。通过原型展示,可以更加直观地了解项目的需求和提供的功能。
产品原型主要用于展示项目的功能,并不是最终的页面功能
后台登录
订单明细
套餐管理
地址管理
点餐页面&购物车
订单查询
sql文件见项目文件夹
| 序号 | 表名 | 说明 |
|---|---|---|
| 1 | employee | 员工表 |
| 2 | category | 菜品和套餐分类表 |
| 3 | dish | 菜品表 |
| 4 | setmeal | 套餐表 |
| 5 | setmeal_dish | 套餐菜品关系表 |
| 6 | dish_flavor | 菜品口味关系表 |
| 7 | user | 用户表(C端) |
| 8 | address_book | 地址簿表 |
| 9 | shopping_cart | 购物车表 |
| 10 | orders | 订单表 |
| 11 | order_detail | 订单明细表 |
(1)File-New-Project-Maven-不用选择模板直接Next-输入项目名,坐标-Finish
(2)导入pom.xml文件
4.0.0 com.li reggie-take-out 1.0-SNAPSHOT 8 8 org.springframework.boot spring-boot-starter-parent 2.5.3 org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-starter-web compile com.baomidou mybatis-plus-boot-starter 3.4.2 org.projectlombok lombok 1.18.20 com.alibaba fastjson 1.2.76 commons-lang commons-lang 2.6 mysql mysql-connector-java runtime com.alibaba druid-spring-boot-starter 1.1.23 org.springframework.boot spring-boot-maven-plugin 2.5.3 (3)配置文件application.yml
server: port: 8080 #端口号spring: application: #应用名称 name: reggie-take-out datasource: druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/reggie?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456mybatis-plus: configuration: #在映射实体或者属性时,将数据库中表名和表的字段名中的下划线去掉,然后按照驼峰命名法映射 # 如 address_book-->addressBook user_name-->userName map-underscore-to-camel-case: true # 默认就是开启的 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: id-type: ASSIGN_ID(4)编写启动类
package com.li.reggie;import lombok.extern.slf4j.Slf4j;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;/** * @author 李 * @version 1.0 */@Slf4j@SpringBootApplicationpublic class ReggieApplication { public static void main(String[] args) { SpringApplication.run(ReggieApplication.class, args); log.info("项目启动成功..."); }}运行测试:
(5)导入前端的代码资源
resources||-------backend 资源目录||-------front 资源目录(6)配置静态资源映射路径
package com.li.reggie.config;import lombok.extern.slf4j.Slf4j;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;/** * @author 李 * @version 1.0 */@Slf4j@Configurationpublic class WebMvcConfig extends WebMvcConfigurationSupport { /** * 进行静态资源映射,也可以直接在配置文件中配置 * * @param registry */ @Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { log.info("开始进行静态资源映射..."); //将接收到的 http://ip+port/backend/** 请求,映射到路径的 /backend/ 目录下 registry.addResourceHandler("/backend/**") .addResourceLocations("classpath:/backend/"); //将接收到的 http://ip+port/front/** 请求,映射到路径的 /front/ 目录下 registry.addResourceHandler("/front/**") .addResourceLocations("classpath:/front/"); }} 关键词: