Sheiy's Blog

SpringBoot自定义Parent及Maven父子项目deploy

sheiy/base-framework (github.com)

Sheiy Sheiy 发布于 2023-06-28

让Spring的HTTP文件服务接口在文件未改变时响应304状态码

如果有一个接口用来获取用户上传的图片用户网页展示类似下面这样: @GetMapping("/file/{filename}") public void getFile(@PathVariable String filename, HttpServletResponse respons

Sheiy Sheiy 发布于 2023-04-12

SpringAop编程式实现切面(Advisor)

定义切点(Pointcut) SpringAop提供了接口org.springframework.aop.Pointcut该接口用于描述接入点,SpringAop同时提供了一些抽象类,切入普通方法可实现org.spri

Sheiy Sheiy 发布于 2023-04-12

使自己的注解支持SpringEL表达式

注解支持SpringEL表达式的意义 如SpringSeuciry的@PreAuthorize("@hasAnyRole('ADMIN')")其中ADMIN可以使用方法参数上的变量也可以使用自己的bean来校验ʌ

Sheiy Sheiy 发布于 2023-04-12

Spring自定义注解,支持依赖注入

使用场景 假设有一个或多个类(Client),有N个类(Service(1-N)),在Service(1-N)中有属性client,现在需要不同的Service中使用的Clientį

Sheiy Sheiy 发布于 2023-04-12

Spring记录日志,非Aop和Filter版

代码如下: import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springframework.be

Sheiy Sheiy 发布于 2023-04-12

使用spring-boot-maven-plugin发布docker镜像

maven pom配置 <properties> <java.version>11</java.version> <docker-prefix>your.docker-repo.address:port</docker-prefix> </properties> <plugin>

Sheiy Sheiy 发布于 2023-04-12

SpringBoot配置记录

SpringBoot 优雅关闭 server.shutdown=graceful

Sheiy Sheiy 发布于 2023-04-12

Spring数字类型以字符串形式返回

添加配置项 spring.jackson.generator.write-numbers-as-strings=true spring.jackson.generator.write-bigdecimal-as-plain=true

Sheiy Sheiy 发布于 2023-04-12