微信点餐系统01——环境搭建

一、创建数据库表

​ 微信点餐系统一共需要5个表。

  1. 商品表:商品编号、商品名称、商品价格、商品库存、商品描述、商品图片、商品情况(上架还是下架)、它属于哪个类目(热销?男生必备?减肥必备等等)、创建时间、更新时间。

  2. 类目表:类目id、类目名、类目类型、创建时间、更新时间。

  3. 订单表:订单编号、买家名字、买家电话、买家地址、买家微信id、订单总金额、订单状态、支付状态、创建时间、更新时间。

  4. 订单详表:信息编号、订单编号、商品编号、商品名、商品价格、商品数量、商品图片、创建时间、更新时间。

  5. 卖家表:卖家编号、卖家名称、卖家密码、卖家微信id、创建时间、更新时间。

    暂时需要这么多表,分别对商品、订单还有后台需要使用的卖家详细信息表。

-- 类目
create table `product_category` (`category_id` int not null auto_increment,`category_name` varchar(64) not null comment '类目名字',`category_type` int not null comment '类目编号',`create_time` timestamp not null default current_timestamp comment '创建时间',`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',primary key (`category_id`),UNIQUE KEY `uqe_category_type` (`category_type`)
);-- 商品
create table `product_info` (`product_id` varchar(32) not null,`product_name` varchar(64) not null comment '商品名称',`product_price` decimal(8,2) not null comment '单价',`product_stock` int not null comment '库存',`product_description` varchar(64) comment '描述',`product_icon` varchar(512) comment '小图',`product_status` tinyint(3) DEFAULT '0' COMMENT '商品状态,0正常1下架',`category_type` int not null comment '类目编号',`create_time` timestamp not null default current_timestamp comment '创建时间',`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',primary key (`product_id`)
);-- 订单
create table `order_master` (`order_id` varchar(32) not null,`buyer_name` varchar(32) not null comment '买家名字',`buyer_phone` varchar(32) not null comment '买家电话',`buyer_address` varchar(128) not null comment '买家地址',`buyer_openid` varchar(64) not null comment '买家微信openid',`order_amount` decimal(8,2) not null comment '订单总金额',`order_status` tinyint(3) not null default '0' comment '订单状态, 默认为新下单',`pay_status` tinyint(3) not null default '0' comment '支付状态, 默认未支付',`create_time` timestamp not null default current_timestamp comment '创建时间',`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',primary key (`order_id`),key `idx_buyer_openid` (`buyer_openid`)
);-- 订单商品
create table `order_detail` (`detail_id` varchar(32) not null,`order_id` varchar(32) not null,`product_id` varchar(32) not null,`product_name` varchar(64) not null comment '商品名称',`product_price` decimal(8,2) not null comment '当前价格,单位分',`product_quantity` int not null comment '数量',`product_icon` varchar(512) comment '小图',`create_time` timestamp not null default current_timestamp comment '创建时间',`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',primary key (`detail_id`),key `idx_order_id` (`order_id`)
);-- 卖家(登录后台使用, 卖家登录之后可能直接采用微信扫码登录,不使用账号密码)
create table `seller_info` (`seller_id` varchar(32) not null,`username` varchar(32) not null,`password` varchar(32) not null,`openid` varchar(64) not null comment '微信openid',`create_time` timestamp not null default current_timestamp comment '创建时间',`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',primary key (`seller_id`)
) comment '卖家信息表';

二、搭建运行的环境

1、进行环境的配置

​ 创建完表之后,需要使用Mysql、Idea、Nginx等等,这些都在Linux系统中使用。老师给了一个centos7,安装后即可使用。先下载一个VirtualBox,引入后使用centos7。使用IDEA创建项目。创建SpringBoot项目,选择web模块。

2、依赖配置

​ 这里先把相关依赖引入。使用jpa来操作数据。

<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-test</artifactId></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-test</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency>
</dependencies>
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins>
</build>

3、配置数据库的相关信息

spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverusername: rootpassword: 123456url: jdbc:mysql://192.168.1.11:3306/sell?characterEncoding=utf-8&userSSL=falsejpa:show-sql: true

​ 因为使用jpa,所以把show-sql打开,mysql引入的是8版本以后的,所以要使用cj下的Driver。

4、日志配置

​ 日志可以配在yaml或properties中,但是这样有个局限,只能配置一部分,当想配置更为复杂的日志配置,就没法满足要求。

​ 所以使用logback-spring.xml做日志配置。

<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender"><layout class="ch.qos.logback.classic.PatternLayout"><pattern>%d -%msg%n</pattern></layout></appender><!--因为这个日志要每天输出,所以是一个滚动的文件--><!--想让这里只输出正常的日志--><appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender"><filter class="ch.qos.logback.classic.filter.LevelFilter"><level>ERROR</level><level>WARN</level><onMatch>DENY</onMatch><onMismatch>ACCEPT</onMismatch></filter><encoder><pattern>%msg%n</pattern></encoder><!--配置滚动策略--><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><!--配置路径--><fileNamePattern>D:\LearningTest\mealOrderSystem\TestLog\info.%d.log</fileNamePattern></rollingPolicy></appender><!--这里输出错误的日志--><appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender"><filter class="ch.qos.logback.classic.filter.ThresholdFilter"><level>ERROR</level></filter><encoder><pattern>%msg%n</pattern></encoder><!--配置滚动策略--><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><!--配置路径--><fileNamePattern>D:\LearningTest\mealOrderSystem\TestLog\error.%d.log</fileNamePattern></rollingPolicy></appender><root level="info"><appender-ref ref="consoleLog"/><appender-ref  ref="fileInfoLog"/><appender-ref ref="fileErrorLog"/></root><?xml version="1.0" encoding="UTF-8" ?>
<configuration><appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender"><layout class="ch.qos.logback.classic.PatternLayout"><pattern>%d -%msg%n</pattern></layout></appender><!--因为这个日志要每天输出,所以是一个滚动的文件--><!--想让这里只输出正常的日志--><appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender"><filter class="ch.qos.logback.classic.filter.LevelFilter"><level>ERROR</level><level>WARN</level><onMatch>DENY</onMatch><onMismatch>ACCEPT</onMismatch></filter><encoder><pattern>%msg%n</pattern></encoder><!--配置滚动策略--><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><!--配置路径--><fileNamePattern>D:\LearningTest\mealOrderSystem\TestLog\info.%d.log</fileNamePattern></rollingPolicy></appender><!--这里输出错误的日志--><appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender"><filter class="ch.qos.logback.classic.filter.ThresholdFilter"><level>ERROR</level></filter><encoder><pattern>%msg%n</pattern></encoder><!--配置滚动策略--><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><!--配置路径--><fileNamePattern>D:\LearningTest\mealOrderSystem\TestLog\error.%d.log</fileNamePattern></rollingPolicy></appender><root level="info"><appender-ref ref="consoleLog"/><appender-ref  ref="fileInfoLog"/><appender-ref ref="fileErrorLog"/></root>
</configuration>

​ 这样就可以生成查看信息和错误报告的文件了。

微信点餐系统01——环境搭建相关推荐

  1. 使用Spring boot搭建Wechat(企业微信)Demo -图文教程 -01 环境搭建

    ** Spring Boot-Wachat Demo [1] 环境搭建[适用小白的哥哥大白,高手跳过本节,内容主要记录个人搭建所遇到的坑和分享过程] ** Spring boot简介.特点等这里就不过 ...

  2. 慕课网微信点餐系统之商品信息加载不出来解决方案

    在通过慕课网学习微信点餐系统的时候遇到 了一个比较奇葩的问题,数据能获取到,数据就是加载不出来 思考:数据能在浏览器显示出来字段也能一 一对应,但是为什么不能显示呢??????? 解决思路:在前端al ...

  3. 手机点餐系统概述_廖师兄 微信点餐系统 springcloud学习笔记

    概要:基于netflix的springcloud搭建微信点餐系统 目录 第一部分 项目概要 1.项目环境信息 2.介绍 第二部分 搭建Eureka Server 1.配置Eureka 的applica ...

  4. 微信点餐系统的开发与实现

    作者主页:编程指南针 作者简介:Java领域优质创作者.CSDN博客专家 .掘金特邀作者.多年架构师设计经验.腾讯课堂常驻讲师 主要内容:Java项目.毕业设计.简历模板.学习资料.面试题库.技术互助 ...

  5. 微信点餐系统java教程_构建微服务微信点餐系统教程

    凡是认购学员提供全部的问题解答,有问题请大家私信提出问题. 微服务是目前行业的热门技术架构,随着移动互联网愈演愈烈,微信支付和外卖成为人们的**,为了让广大技术爱好者学习微服务架构和业务结合,从而研发 ...

  6. 【附源码】Java计算机毕业设计微信点餐系统(程序+LW+部署)

    项目运行 环境配置: Jdk1.8 + Tomcat7.0 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclis ...

  7. [附源码]计算机毕业设计Python微信点餐系统(程序+源码+LW文档)

    该项目含有源码.文档.程序.数据库.配套开发软件.软件安装教程 项目运行 环境配置: Pychram社区版+ python3.7.7 + Mysql5.7 + HBuilderX+list pip+N ...

  8. [附源码]Python计算机毕业设计Django微信点餐系统

    项目运行 环境配置: Pychram社区版+ python3.7.7 + Mysql5.7 + HBuilderX+list pip+Navicat11+Django+nodejs. 项目技术: dj ...

  9. 计算机毕业设计PHP微信点餐系统(源码+程序+VUE+lw+部署)

    该项目含有源码.文档.程序.数据库.配套开发软件.软件安装教程.欢迎交流 项目运行 环境配置: phpStudy+ Vscode + Mysql5.7 + HBuilderX+Navicat11+Vu ...

最新文章

  1. Windows下MySQL安装
  2. Python-form表单标签
  3. 修改Centos7默认yum源为阿里云源
  4. R语言观察日志(part4)--paste函数
  5. 经验原石_行家第一次入手翡翠原石并不是为了一夜暴富
  6. Facebook合并WhatsApp和Instagram?德国:展开反垄断调查!
  7. 风变编程python笔记_自学Python和风变编程
  8. 4.SOA架构:服务和微服务分析及设计--- Web服务及微服务的分析与建模
  9. linux shell 随机字符生成单词
  10. 关于Xcode的Other Linker Flags
  11. 【产品经验谈】详解Axure中的默认元件库
  12. 一个正经的前端学习 开源 仓库(阶段二十六)
  13. matlab下载ar人脸库,AR ar人脸数据库,经典的 用于 检测与识别。 Graph Recognize 图形/文字 274万源代码下载- www.pudn.com...
  14. 成功解决pyinstaller打包时报错:lib not found的问题
  15. 微信小程序引入组件以及catchtouchmove实现拖动效果
  16. 日常积累6:提取并拟合图片中的曲线
  17. 智慧物联网的运用领域
  18. watershed(分水岭算法)
  19. 【推荐】VEX FUNCTIONS
  20. VVC 帧内预测代码 xPredIntraAng()函数

热门文章

  1. MQTT服务质量等级及抓包分析
  2. c语言电子时钟课程设计报告,电子时钟嵌入式课程设计报告
  3. 微信开放平台注册和添加应用操作指南
  4. JAVASE基础模块十五(StringBuffer类)
  5. 实战无成本搭建php社工库,简单、高效、几T数据随便查,高效社工库搭建与数据库整理–深夜福利...
  6. 求知方面无妨多一点,生活方面无妨省一点
  7. Linux内核之进程6: 深度睡眠
  8. MarkDown一些有用的小技巧
  9. 基于STM32的四足机器人
  10. import cv2 失败“找不到指定模块”解决办法