SprinnBoot 项目目录结构

代码层结构

根目录:com.example.myproject

  • 配置类config:com.example.myproject.config
  • 常量类constant:com.example.myproject.constant
  • 前端控制器层controller:com.example.myproject.controller
  • 数据传输对象dto:com.example.myproject.dto
  • 异常类层exception:com.example.myproject.exception
  • 过滤器类层filter:com.example.myproject.filter
  • 安全类层security:com.example.myproject.security
  • 数据服务接口层service:com.example.myproject.service
  • 数据服务接口实现层Service Implements:com.example.myproject.service.impl
  • 工具类库utils:com.example.myproject.utils
  • 视图包装对象vo:com.example.myproject.vo
  • 数据实体类domain
    • jpa项目: com.example.myproject.domain
    • mybatis项目: com.example.myproject.entity
  • 数据接口访问层dao
    • jpa项目: com.example.myproject.repository
    • mybatis项目: com.example.myproject.mapper
  • 启动类JavaProjectApplication.java,直接放在该根目录下

项目结构示例

在这里插入图片描述

资源目录结构

根目录:resources

  • mybatis映射文件:resources/mappers/
  • 静态资源目录:resources/static/
  • 视图模板目录:resources/templates/
  • 项目配置文件:resources/application.properties
  • mybatis配置文件:resources/spring-mybatis.xml

项目结构示例

在这里插入图片描述

原创文章 69 获赞 52 访问量 29万+

猜你喜欢

转载自blog.csdn.net/qq_22136439/article/details/106145088