spring boot框架入门实例 笔记
2017-07-12 17:01
477 查看
spring boot框架入门实例笔记
一、文件说明1、assemble项目配置
1)application.properties公共配置
2)application-dev.properties开发环境配置
3)application-online.properties线上环境配置
4)Main类
Apps.setProfileIfNotExists("dev");表示运行dev和公共配置环境
2、biz所有业务逻辑实现的地方
1)appservice 对service的保装,供外部、包的调用
2)domain
a、dao数据库连接层
b、entity实体
@Entity表示实体类
@Table再数据库中建立一张与此类相对应的表的结构,name=‘表名’,indexes='索引'
c、event事件
d、service服务层
真正实现业务逻辑的代码
3、facade项目集对外的入口和出口(借口)
dto前后台数据交换暂存层(中间层)
4、test测试用例,每写一个业务逻辑的方法都有一个相应测试用例
5、web前台页面交互的地方
二、命名规范
1、类里面的字段名用驼峰式,首字母小写;数据库的字段用下划线
2、包名不要驼峰式
3、类名驼峰式,首字母大写
三、请求处理流程
页面请求---->web模块下的cotroller---->dto----->业务模块下的AppService----->dto---->domainService中处理具体业务逻辑(entity,repository)------>将结果一层一层的反向传回controller
四、get/post
除查询以外的都用post
五、外部模拟界面
(火狐游览器)restclient
六、网页
使用freemarker模版语言引擎,尤其是处理对象图很方便,处理xml也很方便,还支持xpath
@Autowired//自动装配,省略entity的geter,seter
讲解笔记:
@NotNull(groups = AppService.ValidationGroup.Update.class)更新时才进行不为空验证
/*********************************************************************************/
/***************************主子表********************************************/
/********************************************************************************/
1.主表entity继承AggEntity,子表继承AbstractEntity;
2.主表要有子表的集合,子表要有主表的id;transient关键字标记的成员变量不参与序列化过程。
相关文章推荐
- Spring boot入门实例 简易登录(精通Spring+4.x++企业应用开发实战 学习笔记二)
- struct hibernate spring 经典框架 搭建 入门实例
- struct hibernate spring 经典框架 搭建 入门实例
- SpringBoot 入门教程实例详解(一) 开发第一个SpringBoot应用程序实例
- Spring Boot 集成Dubbo框架实例
- Spring Boot 学习笔记(一)——入门
- struct hibernate spring 经典框架 搭建 入门实例
- 使用 Spring Boot 快速构建 Spring 框架应用---学习笔记
- Spring-boot 入门实例+mybatis
- Spring Boot 入门笔记
- (小白学习笔记)Springboot入门(一):Specification
- spring mvc+ibatis+mysql的组合框架入门实例demo源码下载
- Spring学习笔记:2-Spring中IoC的入门实例
- 【Spring】Spring学习笔记-01-入门级实例
- Spring Boot快速入门及实例
- struct hibernate spring 经典框架 搭建 入门实例
- Spring学习笔记:第二章 Spring中IoC的入门实例
- Spring boot 入门 实例
- spring-boot入门学习笔记
- Spring boot 入门实例