Sprignboot 大文件切片上传服务器

大文件切片上传服务器 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

Sprignboot 小文件上传服务器

Java springboot实现 小文件上传本地服务器 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

Springboot 设置静态文件路径

springboot设置静态文件路径 1 2 3 4 5 6 7 8 9 spring: datasource: url: jdbc:mysql://localhost:3306/a?useUnicode=true&characterEncoding=UTF-8&useSSL=false driver-class-name: com.mysql.jdbc.Driver username: root password: root web: resources: static-locations: classpath:/static/,file:D:/ASUS/Desktop/app/ file:绝对路径目录地址

Springboot,Pageable api 使用方法

对 分页插件进一步封装 1 2 3 4 5 6 7 8 9 10 11 12 13 @GetMapping("/test/page") public Result testPage(@PageableDefault(page = 1,size = 5) Pageable page) { log.info("test-sort = {}",page.getSort()); Sort s = page.getSort(); List list = s.stream().map(order -> { Sort.Direction direction = order.getDirection(); String property = order.getProperty(); return property + " " + direction; }).collect(Collectors.toList()); return ResultUtil.mapOf("data",page,"sortList",list); } 1 2 3 4

Springboot,切面编程,从 token获取 userId

springboot 从 token中获取 userID 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package io.github.lyr2000.dissertation.components; import java.lang.annotation.*; /** * @author lyr * @description 获取用户的 ID * @create 2021-11-20 14:14 */ @Documented @Inherited @Retention(value = RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface UserId { } 1 2 3 4 5 6 7 8 9 10 11 12

springboot解决跨域设置

springboot解决跨域设置 前端设置每次请求携带 cookie【携带sessionid】 1 2 3 axios.defaults.headers.common['token'] = getToken(); // axios.defaults.headers.common['refreshToken'] = getRefreshToken(); axios.defaults.withCredentials=true 后端设置 跨域头 1 2 3 4 5 6 7

springboot判断测试环境

1 2 3 4 5 6 7 8 9 10 @Value("${spring.profiles.active}") private String profile; private boolean isDebug; @PostConstruct private void init() { isDebug = "dev".equalsIgnoreCase(profile); log.info("环境变量 {} {}",profile,isDebug); }

sula框架使用

sula框架使用总结 参考网站 sula 表单快速配置 1 sula 操作表格

Swagger2框架使用

寻找 swagger的依赖 1 2 3 4 5 6 <!-- https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter --> <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>knife4j-spring-boot-starter</artifactId> <version>3.0.3</version> </dependency> 这里 我使用 knife4j 其实是一样的。 官方文档 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

tarjan算法

tarjan 算法 原理: 向上标记法 o(N) 倍增算法 fa[i,j] 表示从i开始,向上走 $2^j$ 步, 能走到的节点, $0<=j <= logN$ $ depth[i] $ 表示深度 哨兵: 从i 开始跳 $2^j$ 步会跳到根节点,那么 $ fa[i,j] = 0
T