当前位置:网站首页>Establishment of Ruiji takeout development environment
Establishment of Ruiji takeout development environment
2022-07-28 22:19:00 【ajjjjjjjjjtty】
One 、 Database environment construction
Create a database through a graphical interface , take sql The statement is imported into the database

Two 、maven Environment building
Import various maven To configure stay pom.xml Import coordinates from file
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.itheima</groupId>
<artifactId>reggie_take_out</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</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-starter-web</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.76</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.23</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.5</version>
</plugin>
</plugins>
</build>Write yml
server:
port: 8080
spring:
application:
name: reggie_take_out
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:13306/reggie?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Zz.123456
mybatis-plus:
configuration:
# When mapping entities or attributes , Remove the underscores from the table names and field names in the database , Map according to the hump nomenclature
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: ASSIGN_IDCreate a project The project can be successfully started Then import the code of the front page into the project
Start class
@Slf4j
@SpringBootApplication
public class ReggieApplication {
public static void main(String[] args) {
SpringApplication.run(ReggieApplication.class);
log.info(" The project started successfully ...");
}
}Put front-end resources into resources, But there is an inaccessible problem , By default, only static、template Static resources under the static directory , At this time, we need to set the mapping of static resources by configuring classes
The configuration class sets the mapping of static resources
@Slf4j
// This is a configuration class So add configuration
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
/**
* Rewriting methods :registry
* Method function : Configure the mapping of static resources
*/
@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
// Resource processor Map the front page
log.info(" Start static resource mapping ...");
registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/backend/");
registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/");
}
}Restart the project
边栏推荐
- 第三方软件测试机构提供哪些测试服务?软件测试报告收费标准
- Hcip seventh experiment
- Ukrainian officials: half of Ukrainian agricultural products are exported through the Danube port
- HCIP(9)
- 阿里云CDN实践
- 为什么 0.1 + 0.2 不等于0.3?如何解决这个问题?
- Oracle database objects
- Differences of display values
- Jmeter 安装第三方插件 Plugins Manager
- Lotus 1.16.0 extend sector expiration time
猜你喜欢

C语言编程规范学习笔记和总结

【CVPR 2021】Cylinder3D:用于LiDAR点云分割的圆柱体非对称3D卷积网络

In Kingbase, the user is specified to search the schema by default, or the user cannot use the function under the public schema

Jmeter 安装第三方插件 Plugins Manager

【机器学习】朴素贝叶斯对文本分类--对人名国别分类

Desai wisdom number - line chart (stacking area chart): ranking of deposits of different occupational groups in the proportion of monthly income in 2022

局域网添加DNS服务器进行域名解析

迪赛智慧数——折线图(堆叠面积图):2022年不同职业人群存款额占月收入比例排名

阿里云CDN实践

罗克韦尔AB PLC RSLogix数字量IO模块基本介绍
随机推荐
KubeVela 1.4.x 官方文档
ESP8266-Arduino编程实例-定时器与中断
Oracle, SQL Foundation
SQL注入 Less42(POST型堆叠注入)
hcip实验(12)
Oracle triggers
2021年数学建模B组代码
如何在 Web3中建立一个去中心化社区
ssh 免密码登录
Necessary for in-depth learning: split the data set, split the labels according to the split pictures, and check the interval of all marked labels
hcip实验(14)
Using Baidu easydl to realize chef hat recognition of bright kitchen and stove
ESP8266-Arduino编程实例-深度休眠与唤醒
System Analyst
什么是质因数,质因数(素因数或质因子)在数论里是指能整除给定正整数的质数
Data visualization news, different forms of news reports
第三方软件测试机构提供哪些测试服务?软件测试报告收费标准
LVS+KeepAlived高可用部署实战应用
【云原生之kubernetes】在kubernetes集群下的映射外部服务—Eendpoint
Small program canvas generates posters