88 lines
4.6 KiB
Markdown
88 lines
4.6 KiB
Markdown
# 1、项目启动类
|
||
|
||
无需再编写启动类
|
||
### 开发环境可使用
|
||
`com.css.txw.ytzx.app.DevAppStarter`
|
||
### 其他环境使用
|
||
`com.css.ggzc.framework.app.ApplicationStarter`
|
||
|
||
# 2、目录结构
|
||
|
||
```
|
||
│ .gitignore
|
||
│ pom.xml
|
||
│ README.md
|
||
├─txw-ytzx-service-api api包
|
||
│ │ pom.xml
|
||
│ └─src
|
||
│ └─main
|
||
│ ├─java
|
||
│ │ └─com.css.txw.ytzx 模块包
|
||
│ │ ├─api api接口
|
||
│ │ │ IYtzxApi.java
|
||
│ │ │
|
||
│ │ ├─configuration 模块自动装配配置 需要在org.springframework.boot.autoconfigure.AutoConfiguration.imports中配置,基于插件化开发,各模块在该类中可指定要扫描的包等配置,启动类不会自动扫描
|
||
│ │ │ YtzxApiConfiguration.java
|
||
│ │ │
|
||
│ │ ├─constants api常量
|
||
│ │ │ YtzxConstants.java
|
||
│ │ │
|
||
│ │ └─pojo api pojo
|
||
│ │
|
||
│ └─resources 模块相关的配置说明,注意使用config类
|
||
│ │ additional-spring-configuration-metadata.json
|
||
│ │
|
||
│ └─META-INF
|
||
│ └─spring 模块自动装配配置
|
||
│ org.springframework.boot.autoconfigure.AutoConfiguration.imports
|
||
│
|
||
└─txw-ytzx-service-biz service包
|
||
│ pom.xml
|
||
│
|
||
└─src
|
||
└─main
|
||
├─java
|
||
│ └─com.css.txw.ytzx 模块包
|
||
│ ├─configuration 本模块自动装配设置 需要在org.springframework.boot.autoconfigure.AutoConfiguration.imports中配置,基于插件化开发,各模块在该类中可指定要扫描的包等配置,启动类不会自动扫描
|
||
│ │ YtzxServiceConfiguration.java
|
||
│ │
|
||
│ ├─constants
|
||
│ │
|
||
│ ├─consumer kafaka消费服务
|
||
│ │
|
||
│ ├─controller controller 建议按业务分包 注意:禁止在controller中写跟sql相关的逻辑,一律写到mapper中
|
||
│ │
|
||
│ ├─job 定时任务
|
||
│ │
|
||
│ ├─mapper mapper 建议按业务分包
|
||
│ │
|
||
│ ├─pojo
|
||
│ │ ├─domain
|
||
│ │ │
|
||
│ │ ├─dto
|
||
│ │ │
|
||
│ │ └─vo
|
||
│ │
|
||
│ │-properties 配置类
|
||
│ │
|
||
│ ├─service service 建议按业务分包 注意:SQL相关内容写到mapper中,不要写在service中
|
||
│ │
|
||
│ └─util 本业务域工具类 跟业务相关的写在这里 公共类的请优先使用framework中有的,或者在framework中增加
|
||
│
|
||
└─resources
|
||
│ additional-spring-configuration-metadata.json 模块相关的配置说明,注意使用config类
|
||
│ application.yaml 模块主配置文件
|
||
│ bootstrap-env.yml 模块env环境配置文件
|
||
│ bootstrap-local.yml 模块开发环境配置文件
|
||
│ bootstrap-nacos.yml 模块nacos配置文件
|
||
│ bootstrap.yml 模块主配置文件
|
||
│ logback-spring.xml 模块日志配置文件
|
||
│
|
||
├─mapper 模块mapper
|
||
└─META-INF
|
||
└─spring 模块自动装配配置
|
||
org.springframework.boot.autoconfigure.AutoConfiguration.imports
|
||
|
||
```
|
||
|