摘要: 来源:https://thatamazingprogrammer.com/posts/stop-naming-your-variables-flag-the-art-of-boolean-prefixes/ IS:身份与状态使用,用于描述某事物当前的状态。通常与形容词搭配使用。 好: isActiv 阅读全文
posted @ 2026-07-23 13:59 Joeyin 阅读(7) 评论(0) 推荐(0)
摘要: 如果在表映射对象中使用@TableLogic,MyBatisPlus 会在查询时自动添加del = 0,但是在关联表查询时会出现问题。 比较 select a.* from A a left join B b on b.id = a.b_id where a.del = 0 and b.del = 阅读全文
posted @ 2026-07-16 10:17 Joeyin 阅读(9) 评论(0) 推荐(0)
摘要: 1. 锁必须有TTL // 错误 redis.Set("lock", 1) // 永远不能释放 // 正确 redis.SetNX("lock", uuid, 5 * time.Minute) 2. 长时间任务必须续期 go refreshLock(ctx, lock, 1 * time.Minut 阅读全文
posted @ 2026-07-16 09:54 Joeyin 阅读(102) 评论(0) 推荐(0)
摘要: import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.w 阅读全文
posted @ 2026-06-17 19:54 Joeyin 阅读(10) 评论(0) 推荐(0)
摘要: import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; import com.baomidou.mybatisplus.core.MybatisConfiguration; import org.apache.ibatis.bui 阅读全文
posted @ 2026-01-16 20:12 Joeyin 阅读(24) 评论(0) 推荐(0)
摘要: 对于请求 192.168.1.1:80/static/a.html: Path1(location路径): /static 或 /static/(取决于配置) Path2(请求路径): a.html 如果proxy_pass以斜杠(/)结尾: Nginx认为proxy_pass指定的是一个目录。 转 阅读全文
posted @ 2025-12-25 17:02 Joeyin 阅读(12) 评论(0) 推荐(0)
摘要: 在不启动SpringBoot容器时 注入被测试类使用@InjectMocks 模拟被测试类依赖使用@Mock 部分模拟被测试类依赖类方法使用@Spy 启动SpringBoot容器时 注入被测试类使用@Autowired 模拟被测试类依赖使用@MockBean 部分模拟被测试类依赖类方法使用@SpyB 阅读全文
posted @ 2025-12-18 19:29 Joeyin 阅读(12) 评论(0) 推荐(0)
摘要: 参考:https://thenonfunctionaldev.com/tutorial-async-tdd-with-pytest-asyncio/ https://pytest-with-eric.com/pytest-advanced/pytest-asyncio/ 测试 async for r 阅读全文
posted @ 2025-12-11 15:23 Joeyin 阅读(20) 评论(0) 推荐(0)
摘要: 使用 SpringBoot + LogBack 的项目在程序启动之后总是在项目根目录产生一个 LOG_PATH_IS_UNDEFINED 的文件夹,原因是 Spring 容器在 Logback 初始化之后设置 LOG_PATH ,所以在 logback-spring.xml 找不到 LOG_PATH 阅读全文
posted @ 2022-08-22 21:25 Joeyin 阅读(2110) 评论(1) 推荐(0)