线偶

线偶的IT笔记

Sso 登录流程

先介绍 OAuth2 的授权码,然后再介绍 SSO 的流程。这里的代码来自 Sa-Token。 OAuth2 授权码模式 授权码模式,涉及到两个接口,获取 code和获取 access

Mybatis-Plus 打印日志

在 spring boot 打印日志 application.yaml: 1 2 3 4 5 6 7 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl logging: level: com.ooooo.dao.mapper: debug 参考 spring boot logging 原理 源码位置: org.apache.ibatis.mapping.MappedStatement.Builder#Builder 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 public Builder(Configuration configuration, String id, SqlSource sqlSource, SqlCommandType sqlCommandType) { mappedStatement.configuration = configuration; mappedStatement.id =

11 ArrayBlockingQueue

jdk 基于 8 版本 在平时的开发中,我们可能会用到 ArrayBlockingQueue, 它是基于循环数组来实现的,是并发安全的。 使用方式 1 2 3 4 5 6 7 8 9 public class ArrayBlockingQueueTest { @Test void test() { BlockingQueue<String> queue = new ArrayBlockingQueue<>(10); queue.offer("1"); assertThat(queue.poll()).isEqualTo("1");

Rust Axum 测试类

multipart 测试类 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 const BOUNDARY: &str = "BOUNDARY"; #[tokio::test] async fn test_import_proc_def() -> anyhow::Result<()> { let bytes = fs::read("./examples/test01.xml").await?; let request = Request::builder() .header( CONTENT_TYPE, format!("multipart/form-data; boundary={}", BOUNDARY), ) .body::<Body>(generate_multipart_data("file", &bytes)?.into()) .unwrap(); let multipart = Multipart::from_request(request, &State(())).await?;
0%