摘要: 项目原结构如下图: 拆分后结构如图: 在idea中打开项目, 选中项目右键选择 创建两个maven项目,起名model-code,model-web。 把原项目的entity,mapper,vo,resources下面的myBatis的文件放到model-code项目下,结构如图: 原来项目剩下的文 阅读全文
posted @ 2023-02-21 15:08 音Duang 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 责任链模式介绍 责任链模式是一种行为型模式。责任链模式里,很多对象由每一个对象对其下家的引用而连接起来形成一条链。请求在这个链上传递,直到链上的某一个对象决定处理此请求。发出这个请求的客户端并不知道链上的哪一个对象最终处理这个请求。 比如:员工请假3天以下,直属组长就能批。一个星期的假期,需要走到总 阅读全文
posted @ 2022-07-18 15:35 音Duang 阅读(1497) 评论(0) 推荐(0) 编辑
摘要: pom文件引用redis <!-- redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </depende 阅读全文
posted @ 2021-07-27 11:03 音Duang 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 在项目里面加入统一的返回信息和异常处理 新建 文件如下 public interface BaseErrorInfoInterface { /** * 错误码 */ String getResultCode(); /** * 错误描述 */ String getResultMsg(); } publ 阅读全文
posted @ 2021-07-14 15:36 音Duang 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 项目路径如下 pom.xml添加 <!-- logback --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> <versi 阅读全文
posted @ 2021-06-04 11:57 音Duang 阅读(52) 评论(0) 推荐(0) 编辑
摘要: CREATE TABLE `user` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `name` varchar(30) DEFAULT NULL COMMENT '姓名', `age` int(11) DEFAULT NULL COMMENT '年龄', 阅读全文
posted @ 2021-06-04 11:09 音Duang 阅读(47) 评论(0) 推荐(0) 编辑
摘要: Feign 采用的是基于接口的注解 Feign 整合了ribbon 创建一个名为eureka_feign的项目。 application.properties文件 server.port=10004 spring.application.name=eureka-feign #注册的eureka.Se 阅读全文
posted @ 2021-01-24 18:01 音Duang 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 按照 EurekaClient 项目创建流程再创建一个 ribbon 项目 application.properties文件和pom文件配置相同 修改配置文件application.properties端口为10002 启动class中添加如下代码 @RestController @EnableEu 阅读全文
posted @ 2021-01-21 18:30 音Duang 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Logback 日志输出 SpringBoot中默认使用logback 引用: 直接引入: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifa 阅读全文
posted @ 2020-06-19 17:45 音Duang 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 在EurekaClient篇中已经创建好了项目,接着就是将mybatis整合进来 创建user表: CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(50) DEFAULT 阅读全文
posted @ 2020-06-03 17:17 音Duang 阅读(236) 评论(0) 推荐(0) 编辑