基于spring boot的按页面需求分模块的基本架构

基本架构图

这里写图片描述

代码结构图

这里写图片描述

说明

   soar-parent :soar项目的顶级包
      soar-common :soar项目的公共资源包
       soar-module :soar项目的前端模块包的父包
       soar-starter :soar项目的启动入口

重要点

## 在Application.java类中配置注解扫描

“` java
@SpringBootApplication(scanBasePackages= {“com.heng.soar”})
@MapperScan(basePackages = “com.heng.soar.*.mapper”)
public class Application {

public static void main(String[] args) {

    SpringApplication.run(Application.class, args);
}

}

soar-module中的包名需要是以`com.heng.soar`开头
mapper接口的包名需要符合`com.heng.soar.*.mapper的`格式
在soar-starter中的`application.propeties`文件中配置
`mybatis.mapper-locations=classpath*:mapper/*.xml`
`classpath*`表示会扫描当前项目及其引用jar包的classpath下的文件 


在soar-common的pom文件中加入
``` java    
    <dependency>
             <groupId>com.heng.soar</groupId>
             <artifactId>soar-module-core</artifactId>
             <version>${parent.version}</version>
    </dependency>

表示项目启动后加载soar-module-core模块的功能

代码下载
https://github.com/li2hengyuan/books

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值