随笔分类 -  Java

摘要:1、生成方式(验证码字符串、图片验证码、base64验证码图片) /** * @description: 使用方式1: 直接获取验证码字符串,前端进行自定义渲染 * @date: 2024/12/16 11:37 * @param * @return java.lang.String */ @Get 阅读全文
posted @ 2025-01-01 14:01 bug毁灭者 阅读(83) 评论(0) 推荐(0) 编辑
摘要:1、控制器代码 @PostMapping('/clientDownload') public void clientDownload(HttpServletResponse response){ try { return FileUtils.downloadFile(filePath,downloa 阅读全文
posted @ 2024-11-30 17:24 bug毁灭者 阅读(57) 评论(0) 推荐(0) 编辑
摘要:1、安装Mongodb 参考链接:https://www.cnblogs.com/lveyHang/p/16866309.html 2、进行配置 找到mongodb的安装位置、找到如下文件进行配置 Mongodb\bin\mongod.cfg # 配置数据存储目录,没有则创建. storage: d 阅读全文
posted @ 2024-11-23 19:48 bug毁灭者 阅读(353) 评论(0) 推荐(0) 编辑
摘要:直接上代码 import org.springframework.web.multipart.MultipartFile; import java.util.concurrent.CompletableFuture; import org.apache.commons.lang3.StringUti 阅读全文
posted @ 2024-03-17 09:02 bug毁灭者 阅读(188) 评论(0) 推荐(0) 编辑
摘要:代码示例如下: import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ReUtil; import cn.hutool.core.util.StrUtil; import com.google.common.col 阅读全文
posted @ 2024-03-09 18:53 bug毁灭者 阅读(621) 评论(0) 推荐(0) 编辑
摘要:1、工具类RSAUtils.java import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; import java.io.ByteArrayOutputStream; 阅读全文
posted @ 2024-01-19 19:12 bug毁灭者 阅读(4450) 评论(0) 推荐(1) 编辑
摘要:1、启动类增加@EnableAsync注解 2、yml增加配置 spring: task: execution: pool: max-size: 8 core-size: 8 keep-alive: 60 queue-capacity: 1000 thread-name-prefix: Asnyc- 阅读全文
posted @ 2023-12-15 19:25 bug毁灭者 阅读(137) 评论(0) 推荐(0) 编辑
摘要:1、环境说明 JDK1.8 + SpringBoot2.7 2、添加pom依赖 <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> < 阅读全文
posted @ 2023-12-06 20:39 bug毁灭者 阅读(546) 评论(0) 推荐(0) 编辑
摘要:import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTempl 阅读全文
posted @ 2023-12-06 20:03 bug毁灭者 阅读(642) 评论(0) 推荐(0) 编辑
摘要:1、添加pom依赖 <!-- tar解压依赖 --> <dependency > <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>1.20</version> </dep 阅读全文
posted @ 2023-07-02 16:38 bug毁灭者 阅读(1916) 评论(0) 推荐(1) 编辑
摘要:环境springboot2.7 +kafka3.0。kafka安装请自行百度,话不多说直接上代码。 1、添加maven依赖 <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</arti 阅读全文
posted @ 2023-06-15 19:38 bug毁灭者 阅读(226) 评论(0) 推荐(0) 编辑
摘要:import com.alibaba.fastjson.JSONObject; import org.apache.http.Consts; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import 阅读全文
posted @ 2023-04-15 18:33 bug毁灭者 阅读(57) 评论(0) 推荐(0) 编辑
摘要:背景说明:要对服务器上一个目录进行全量文件读取 1、多线程执行类--FileThreadUtils.java import cn.hutool.core.collection.CollUtil; import cn.hutool.core.io.FileUtil; import com.alibab 阅读全文
posted @ 2023-03-10 19:19 bug毁灭者 阅读(680) 评论(0) 推荐(0) 编辑
摘要:背景说明:要对服务器上一个目录进行全量文件读取,采用传统的单线程性能较差,耗时严重。 1、多线程执行类--FileThreadUtils.java import cn.hutool.core.collection.CollUtil; import cn.hutool.core.io.FileUtil 阅读全文
posted @ 2023-03-08 20:11 bug毁灭者 阅读(2158) 评论(0) 推荐(0) 编辑
摘要:/** * @description: 将文本文件另存为UTF8格式 * @author: bug * @date: 2022/11/8 19:22 * @param file * @param srcFilePath * @return java.lang.String */ private St 阅读全文
posted @ 2022-11-09 08:42 bug毁灭者 阅读(682) 评论(0) 推荐(0) 编辑
摘要:1、pom配置 <!--锁定对象存储版本--> <dependencyManagement> <dependencies> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>bom</artifactId> <ver 阅读全文
posted @ 2022-06-23 19:49 bug毁灭者 阅读(2694) 评论(1) 推荐(2) 编辑
摘要:环境配置:SpringBoot:2.6.0 ,Elasticsearch:7.16.2 1、pom配置 <properties> <elasticsearch.version>7.16.2</elasticsearch.version> </properties> <dependency> <gro 阅读全文
posted @ 2022-06-23 19:16 bug毁灭者 阅读(326) 评论(0) 推荐(0) 编辑
摘要:1、pom添加依赖 <!-- xxl-job-core --> <dependency> <groupId>com.xuxueli</groupId> <artifactId>xxl-job-core</artifactId> <version>2.2.0</version> </dependenc 阅读全文
posted @ 2022-05-17 19:39 bug毁灭者 阅读(745) 评论(0) 推荐(0) 编辑
摘要:1、pom引入依赖 <!--邮件发送--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> <!--邮件模 阅读全文
posted @ 2022-05-17 19:12 bug毁灭者 阅读(82) 评论(0) 推荐(0) 编辑
摘要:用意:判断某个进程是否正常运行,如果进程挂了,自动重启该进程 sh如下: #!/bin/sh java_id=(psef|greplogtest|grepvgrep|awkprint$2)echojava_id if [ ! $java_id ] ; t 阅读全文
posted @ 2022-03-28 09:20 bug毁灭者 阅读(517) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示