maven+springboot+mybatis快速搭建简单使用

时间:2020-07-19 12:01:29   收藏:0   阅读:42

传送门https://www.cnblogs.com/ljsh/p/10928106.html

总结

maven的依赖

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.7.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

<dependencies>
        <!-- 数据库连接池 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.0.25</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.16</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

  会简单使用到的注解

@SpringBootApplication
@Service
@Autowired
@Mapper
@Controller
@RequestMapping
项目扔到github上https://github.com/shenshaonian/loveMoocLearn
下一步,加个插曲,明天把对dao层的本地单元测试弄出来。
然后在做,额看公司代码,赶紧学习,希望试用期可以通过,好难,以后没机会混日子了。
通过阿里服务器,用appolo配置,springboot管理数据连接,快速简单实现后端系统。

原文:https://www.cnblogs.com/woainixxx/p/13338498.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!