SpringBoot项目目录结构

    技术2023-06-19  65

    SpringBoot项目基础结构示例

    JAP和Mybatis混合项目目录结构 catelog ├─.gitignore ├─pom.xml ├─README.md └─src ├─main │ ├─java │ │ └─com │ │ └─springboot │ │ └─catelog │ │ ├─commons # 公共目录 │ │ │ ├─config # 配置类 │ │ │ ├─consts # 常量类 │ │ │ └─enmus # 枚举类 │ │ ├─controller # 前端控制器层 │ │ ├─domain # 数据实体类 │ │ ├─pojo │ │ │ ├─dao # 数据接口访问层 │ │ │ ├─dto # 数据传输对象 │ │ │ └─vo # 视图包装对象 │ │ ├─service # 数据服务接口层 │ │ │ └─impl # 数据服务接口实现层 │ │ ├─utils # 工具类库 │ │ └─CatelogApplication.java │ └─resources │ ├─mapper # Mybatis 映射文件 │ └─application.properties # 配置文件 └─test └─java └─com └─springboot └─catelog

    代码层目录结构注意点

    根目录:com.springboot.catelog

    CatelogApplication.java:启动类,推荐放到代码根目录下,例如:com.springboot.catelog下domain:数据实体类 JPA项目:com.springboot.catelog.domainMybatis项目:com.springboot.catelog.entity dao:数据接口访问层 jpa项目: com.springboot.catelog.repositoryMybatis项目: com.springboot.catelog.mapper
    Processed: 0.016, SQL: 9