摘要: 获取自增主键 实体对象设置主键自增,插入到数据库后拿到主键ID。 数据库使用的是mysql。 useGeneratedKeys 非常简单的实现: mapper接口 public interface UserMapper extends BaseMapper<User> { int insertUse 阅读全文
posted @ 2024-05-07 18:41 OraCat 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 问题产生 设计一个程序,统计服务器接口的访问次数,有可能会这样写: public class AccessCounter { private int accessCount; public void access() { accessCount++; } } 上面的代码没有考虑JMM,在并发环境统计 阅读全文
posted @ 2023-11-14 21:28 OraCat 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1. 新建线程组 右键test plan -> 添加 -> 线程(用户) -> 线程组 2. 新建http请求 右键接口压力测试 -> 添加 -> 取样器 -> http请求 3. 添加请求头 右键接口压力测试 -> 添加 -> 配置元件 -> http消息头管理器 4. 命令行执行 保存为jmx文 阅读全文
posted @ 2023-10-19 14:51 OraCat 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 使用泛型时,类型参数不允许为静态(static)。由于静态变量在对象之间共享,因此编译器无法确定要使用的类型。 阅读全文
posted @ 2023-09-26 15:11 OraCat 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 作用 在application.yml或者application.properties内配置自定义属性,将显示补全信息和提示: 实现 1)引入依赖 pom.xml文件 <dependency> <groupId>org.springframework.boot</groupId> <artifact 阅读全文
posted @ 2023-08-08 15:14 OraCat 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1.antdv table 组件展开 如下图,点击+号展开数据时,所有的行数据都被展开了。 解决:添加row-id。在antdv文档中的说明如下 在 Table 中,dataSource 和 columns 里的数据值都需要指定 key 值。对于 dataSource 默认将每列数据的 key 属性 阅读全文
posted @ 2023-07-11 15:11 OraCat 阅读(6) 评论(0) 推荐(0) 编辑
摘要: ## Git 提交规约 ### 格式 ```text [scope]: // 空一行 [body] // 空一行 [footer] ``` **注:[]代表可选,代表必选。** ### type 必填,用于指定 commit 的类型。 ```text feat:增加新功能 fix:修复 bug do 阅读全文
posted @ 2023-06-06 22:30 OraCat 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 转载: [GitHub如何选择合适的license(许可证)](https://segmentfault.com/a/1190000041599305) 阅读全文
posted @ 2023-05-25 21:26 OraCat 阅读(6) 评论(0) 推荐(0) 编辑
摘要: ##1. 端口 ```JAVASCRIPT // vue.config.js const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: tru 阅读全文
posted @ 2023-05-24 18:15 OraCat 阅读(29) 评论(0) 推荐(0) 编辑
摘要: ### 1. 漏洞检测-默认文件(中风险) tomcat默认的错误页、索引页等页面会暴露tomcat或者主机的信息, 应删除或修改这些文件。 解决: - 删除docs、examples目录,一般情况下host-manager、manager、ROOT目录根据情况也可以直接删除。[目录解释传送门](h 阅读全文
posted @ 2023-05-19 16:21 OraCat 阅读(46) 评论(0) 推荐(0) 编辑