springboot专区--- 第1集springboot基本概念和简单搭建

1 springboot 特性

  • 创建独立的Spring应用程序

  • 直接嵌入Tomcat,Jetty或Undertow(无需部署WAR文件)

  • 提供自以为是的“入门”依赖项以简化构建配置

  • 尽可能自动配置Spring和第三方库

  • 提供生产就绪功能,例如指标,运行状况检查和外部化配置

  • 绝对没有代码生成,也不需要XML配置

2 springboot 框架搭建

  1. maven 远程仓库地址:https://mvnrepository.com/search?q=spring-boot-starter-parent

在pom.xml 中配置maven 依赖
 

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>2.0.3.RELEASE</version>
  <relativePath/>
</parent>
<!-- Add typical dependencies for a web application -->
<dependencies>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
  </dependency>
</dependencies>

2 在代码最外层所在包的同文件夹目录下创建启动类

@RestController
@EnableAutoConfiguration
public class SpringbootdemoApplication {
    @RequestMapping("/")
    String home() {
        return "Hello World!";
    }
    public static void main(String[] args) {
        SpringApplication.run(SpringbootdemoApplication.class, args);
    }
}

3 启动项目

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Spring Boot中使用Mybatis-Plus自动生成代码的步骤如下: 1. 首先,在pom.xml文件中添加Mybatis-Plus的依赖项。这包括mybatis-plus-generator、velocity-engine-core和lombok等依赖项。\[1\] 2. 创建一个Mapper接口,继承自BaseMapper,并指定实体类的泛型。在这个接口中,你可以定义自己的查询方法。\[3\] 3. 配置Mybatis-Plus的代码生成器。你可以使用代码生成器来生成Mapper、Model、Service和Controller层的代码。你可以使用代码或者Maven插件来快速生成代码。\[2\] 4. 运行代码生成器,生成所需的代码文件。 5. 在Spring Boot的配置文件中配置数据库连接信息和Mybatis-Plus的相关配置。 6. 在Service层中使用生成的Mapper接口进行数据库操作。 通过以上步骤,你可以在Spring Boot中使用Mybatis-Plus自动生成代码。这样可以大大减少手动编写重复的CRUD操作的工作量,并提高开发效率。 #### 引用[.reference_title] - *1* [SpringBoot中的自动代码生成 - 基于Mybatis-Plus](https://blog.csdn.net/Jalon2015/article/details/116026730)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [springboot整合mybatis-plus,代码自动生成](https://blog.csdn.net/qq_32784303/article/details/82964168)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值