基于spring boot以及mybatis等技术框架实现一个外卖项目 | 您所在的位置:网站首页 › 外卖配送流程和管理规定是什么 › 基于spring boot以及mybatis等技术框架实现一个外卖项目 |
数据库创建
创建如下表 注:spring boot 3.0以上版本需要jdk17 选中的五个删除 此处发现pom.xml右侧没有maven窗口,点击帮助,查找操作,搜索maven,添加maven项目,把pom.xml路径导入即可 在pom.xml文件中添加如下依赖 将application.properties文件改写为application.yml文件并添加如下配置 #tomcat端口号 server: port: 8080 spring: application: #应用名称 name: takeout datasource: druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/food?useSSL=false password: 123456 username: root mybatis-plus: configuration: #在映射实体或者属性时,将数据库的表名和字段名的下划线去掉,按驼峰命名 map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: id-type: ASSIGN_ID在spring boot启动类上添加注解@Slf4j 后台登陆功能创建实体类Employee,和employee表进行映射 package com.mjk.takeout.pojo; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; @Data public class Employee implements Serializable { private static final long serialVersionUID = 1L; private Long id; private String username; private String name; private String password; private String phone; private String sex; private String idNumber; private Integer status; private LocalDateTime createTime; private LocalDateTime updateTime; @TableField(fill = FieldFill.INSERT) private Long createUser; @TableField(fill = FieldFill.INSERT_UPDATE) private Long updateUser; } |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |