笔记
KVN_G
逼着自己优秀然后骄傲地生活!
展开
-
Linux下防火墙,开启/关闭对外开放端口
查看防火墙状态systemctl status firewalld开启防火墙systemctl start firewalld查看所有已开放的临时端口firewall-cmd --list-port查看所有永久开放的端口firewall-cmd --list-port --permanent添加临时开放端口,如80firewall-cmd --add-port=80/tcp添加永久开放端口,如80firewall-cmd --add-port=80/tcp --permanent.原创 2021-11-13 20:20:27 · 1522 阅读 · 0 评论 -
Restful返回结果工具RespUtil
Restful返回结果工具/** * Restful返回结果Util * 创建日期:2021-09-14 13:39 * @author kevin */public class RespUtil { public static <T> RestResp<T> success(T data) { RestResp<T> result = new RestResp<>(); result.setRespCod原创 2021-09-14 14:29:58 · 4440 阅读 · 0 评论 -
Spring Boot多环境配置
spring: application: name: application-name profiles: active: dev cloud: nacos: config: #共享配置文件 shared-dataids: db.properties,redis.properties,ysfYdd.properties---spring: profiles: dev #开发环境 cloud: nacos:原创 2021-09-14 10:27:09 · 195 阅读 · 0 评论 -
Cannot construct instance of `com.baomidou.mybatisplus.core.metadata.IPage` (no Creators, like defau
因为com.baomidou.mybatisplus.core.metadata.IPage是一个接口,所以不能构建实例。出现错误如下:在这里插入代码片我的解决办法:将服务端和客户端的返回值由IPage转为Page服务端controller@Slf4j@Api("员工管理")@RestController@RequestMapping("emp")public class EmpController { @Autowired EmployeeService empl原创 2021-07-19 14:24:05 · 4064 阅读 · 0 评论 -
解决eureka client出现“No instances available for eureka-server”的问题
我在使用eureka client消费者调用生产者的时候,出现以下问题:java.lang.IllegalStateException: No instances available for eureka-server就是 eureka-server服务不可用我的配置如下服务注册中心配置:server: port: 8760spring: application: name: eureka-servereureka: instance: hostname: .原创 2021-07-15 14:42:47 · 3104 阅读 · 0 评论 -
SpringBoot多模块使用Swagger2 3.0
在父项目里创建common模块本次使用的是swagger2 的3.9版本,创建common模块来配置swagger是为后续多模块用swagger准备的。pom.xml文件<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"原创 2021-07-09 17:11:59 · 1957 阅读 · 1 评论 -
框架设计--第五章 Spring的事务管理--习题答案
一、 填空题使用基于注解方式的事务管理需要在使用事务的Spring Bean类或者Bean类的方法上添加注解【 @Transactional】。Spring的声明式事务管理可以通过两种方式来实现,一种是基于XML的方式,另一种是基于【 Annotation】的方式。Spring2.0以后,提供了tx命名空间来配置事务,tx命名空间下提供了【 tx:advice】元素来配置事务的通知(增强处理)。在Spring的所有JAR包中,包含一个名为【 spring-tx.RELEASE.jar】的JAR包,原创 2021-02-20 23:13:09 · 2734 阅读 · 0 评论