![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux
再见小的时候
这个作者很懒,什么都没留下…
展开
-
数据库设计:邻接表、路径枚举、嵌套集、闭包表
邻接表通用设计父级id字段路径枚举设计祖级列表字段,所谓祖级列表就是当前节点的所有父级节点的id集路径枚举实现递归查询当前节点下所有字节点方案:1:MySQL find_in_set函数 与 in 结合使用2:若做数据库兼容则可使用like替代find_in_set嵌套集嵌套集解决方案是存储子孙节点的相关信息,而不是节点的直接祖先。我们使用两个数字来编码每个节点,从而表示这一信息,可以将这两个数字称为nsleft 和 nsright。每个节点通过如下的方式确定nsleft 和nsrigh原创 2022-05-24 10:55:21 · 666 阅读 · 0 评论 -
SpringBoot 多线程事务回滚问题处理
@Slf4j@RequiredArgsConstructorpublic class MultiThreadTransaction { private final PlatformTransactionManager transactionManager; private void asyncSaveBatch() { // 线程个数 final int SIZE = 6; // 交给单个线程处理,失败则加1 final原创 2022-03-04 10:34:32 · 2311 阅读 · 2 评论 -
SpringBoot之RestTemplate上传文件
@Resource(name = "restTemplate")private RestTemplate restTemplate;private JSONObject upload(String url, String fileDisplayName) throws Exception { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA);原创 2022-03-03 14:09:30 · 1057 阅读 · 2 评论 -
SpringBoot调用webService及踩坑经历
<dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-spring-boot-starter-jaxws</artifactId> <version>3.2.5</version> </dependency>private String...原创 2022-03-02 15:43:14 · 735 阅读 · 0 评论 -
Java读取Word关键字工具类
public static List<String> getWordKey(String templateUri) { String buffer = ""; List<String> keyListFromString = null; String localPath = RuoYiConfig.getProfile() + StringUtils.substringAfter(templateUri, "/profile"); try {原创 2022-02-10 14:49:27 · 827 阅读 · 0 评论 -
Word填充并转为PDFWindows、Linux兼容
package com.norm.common.util;import cn.afterturn.easypoi.cache.manager.FileLoaderImpl;import cn.afterturn.easypoi.word.WordExportUtil;import com.aspose.words.Document;import com.aspose.words.FontSettings;import com.aspose.words.License;import com.as原创 2021-11-08 11:38:23 · 529 阅读 · 0 评论 -
Centos 7.x安装 SpringBoot运行环境
安装MySQL8.0wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpmrpm -ivh mysql80-community-release-el7-3.noarch.rpmyum install -y mysql mysql-servervi /etc/my.cnflower_case_table_names=1systemctl restart mysqldgrep password /原创 2021-09-10 15:46:20 · 289 阅读 · 0 评论 -
Centos 7 FastDFS安装配置
Centos 7 FastDFS安装配置环境配置libfastcommon 安装fastdfs 安装tracker 配置storage 配置client 配置Nginx 安装nginx 安装FastDFS 测试环境配置yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -ylibfastcommon 安装libfastcom原创 2021-08-23 14:45:35 · 152 阅读 · 0 评论 -
Springboot多线程异步批量添加/导入大数据到数据库
启动类添加 @EnableAsync 注解 开启线程池(多线程)新增异步添加接口package com.chalk.service;import com.chalk.model.Student;import com.chalk.model.Teacher;import com.chalk.model.UserDeviceRel;import java.util.List;/** * 异步服务接口 * * @author gluoh * @since 2020-12-..原创 2021-02-26 15:14:39 · 6158 阅读 · 6 评论 -
Springboot整合MQTT
=============== 发布端================发布端连接得到sampleClient实例package com.chalk.mqtt.publish;import com.chalk.common.constant.MqttConstants;import org.eclipse.paho.client.mqttv3.MqttClient;import org.eclipse.paho.client.mqttv3.MqttConnectOptions;import or原创 2021-02-26 14:59:28 · 560 阅读 · 2 评论 -
Springboot整合Netty
配置Netty服务端package com.chalk.netty.server;import io.netty.bootstrap.ServerBootstrap;import io.netty.channel.ChannelFuture;import io.netty.channel.ChannelOption;import io.netty.channel.EventLoopGroup;import io.netty.channel.nio.NioEventLoopGroup;impo原创 2021-02-24 17:06:14 · 338 阅读 · 0 评论 -
五分钟搞懂什么是红黑树(全程图解)
http://www.360doc.com/content/18/0904/19/25944647_783893127.shtml原创 2021-02-24 15:19:46 · 98 阅读 · 0 评论 -
Ubuntu docker配置镜像加速器
配置阿里镜像加速器进入网址:https://cr.console.aliyun.com/cn-hangzhou/mirrors登录阿里云【点击镜像加速器,查看自己的加速器地址:https://xxxxx.mirror.aliyuncs.com】【复制加速器地址最后添加到registry-mirrors": [“你自己的加速器地址”] 】具体操作:【先去/etc/目录下查看是否有docker目录如果没有则执行下面操作,有的话就不执行】sudo mkdir -p /etc/docker原创 2020-07-11 23:03:29 · 490 阅读 · 0 评论 -
Ubuntu 安装docker-compose
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-composechmod +x /usr/local/bin/docker-compose原创 2020-07-11 22:27:15 · 195 阅读 · 0 评论 -
Git创建分支切换分支
管理分支1、查看分支2、查看本地分支使用 git branch命令,如下:$ git branchmaster标识的是你当前所在的分支。2、查看远程分支命令如下:git branch -r3、查看所有分支命令如下:git branch -a2、本地创建新的分支命令如下:git branch [branch name]例如:git branch develop3、切换到新的分支命令如下:git checkout [branch name]例如:$ g原创 2020-07-11 16:18:37 · 391 阅读 · 0 评论 -
GitHub/码云新建仓库并上传项目
我的远程仓库设置叫 test,我的本地项目放在E:\test 的目录下【创建仓库时尽量远程仓库名和本地项目存放的目录名字一样,因为远程仓库和本地项目要做一个连接】1.先到你的本地项目目录下 比如我的在 E:\test2.右击GitBashHere git init // 初始化仓库【想当于新建本地仓库】 git add . // 把所有文件提交到暂存区 git commit -m ‘first commit’ // 提交到本地仓库 git remote add origin原创 2020-07-11 14:41:16 · 362 阅读 · 0 评论 -
Maven 打包Springboot项目并部署
1.基本打包清理(删除target目录下编译内容)mvn clean编译项目mvn compile打包发布mvn package打包时跳过测试mvn package -Dmaven.test.skip=true仅打包Web页面文件mvn war:exploded==============================================================================2.终极版一行命令实现打包【终极版】mvn clean packa原创 2020-07-06 19:30:45 · 180 阅读 · 0 评论 -
Java Zip工具类
Java Zip工具类package com.qinji.common.utils.file;import java.io.*;import java.util.ArrayList;import java.util.List;import java.util.zip.ZipEntry;import java.util.zip.ZipOutputStream;public class ZipUtils {private static final int BUFFER_SIZE = 2 * 1原创 2020-07-06 19:22:52 · 875 阅读 · 0 评论 -
Ubuntu apt安装Nginx
sudo apt install nginx/usr/sbin/nginx:主程序/etc/nginx:存放配置文件/usr/share/nginx:存放静态文件/var/log/nginx:存放日志service nginx status 查看运行状态service nginx start 启动nginxservice nginx reload 重新加载nginx配置文件vim /etc/nginx 配置代理...原创 2020-05-27 17:40:11 · 147 阅读 · 0 评论 -
Ubuntu18.04安装Docker
1、更新Ubuntu的apt源索引sudo apt-get update2、安装包允许apt通过HTTPS使用仓库sudo apt install apt-transport-https ca-certificates curl software-properties-common3、添加Docker官方GPG key(添加Dokcer官方密钥到系统中)curl -fsSL http...原创 2020-03-16 15:37:52 · 139 阅读 · 0 评论 -
JDK
二、安装Java环境1、下载安装包 这里只是二进制安装下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html我这边是下载的jdk-8u231-linux-x64.tar.gz2、解压安装包将我们下载好的JDK安装包上传到/usr/local,进行解压连接终端 切换换...原创 2020-02-16 20:50:42 · 278 阅读 · 0 评论 -
Ubuntu - apt安装Redis
需要连接互联网,然后执行sudo apt-get update更新软件包二、执行安装命令sudo apt-get install redis-server执行后如下图所示,我们输入y 确认安装并使用空间接下来会执行完成,我们可以看到包括redis的版本信息等,执行service redis status 可以查看redis服务的状态为running,说明安装完成系统自动启动了服务三、配...原创 2020-02-16 10:28:39 · 1718 阅读 · 0 评论 -
Java媒体类型工具类
package com.qinji.common.utils.file;/**媒体类型工具类@author hbt*/public class MimeTypeUtils{public static final String IMAGE_PNG = “image/png”;public static final String IMAGE_JPG = “image/jpg”...原创 2020-01-17 15:22:07 · 457 阅读 · 0 评论 -
Java文件上传工具类
/**文件上传工具类@author hbt/public class FileUploadUtils {/*默认大小 50M*/public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;/**默认的文件名最大长度 100*/public static final int DEFAULT_FILE...原创 2020-01-17 15:20:36 · 387 阅读 · 0 评论 -
Excel工具类
/**Excel相关处理@author hbt*/public class ExcelUtil extends DataDictConverUtil {private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);/** * Excel sheet最大行数,默认65536 */publi...原创 2020-01-02 11:17:20 · 1045 阅读 · 0 评论 -
Git
原创 2020-01-02 09:39:52 · 102 阅读 · 0 评论 -
Java自定义注解
1|0前言随着springboot的流行,以前基于XML的spring配置用的越来越少,JavaConfig形式使用的越来越多,类似于:@Configurationpublic class AppConfig {@Bean(name=“helloBean”)public HelloWorld helloWorld() {return new HelloWorldImpl();}}...原创 2020-01-02 09:35:57 · 119 阅读 · 0 评论 -
Linux(Ubuntu)
Unable to locate package zliblg-devUnable to locate package错误,解决方法非常简单,终端输入以下命令即可:sudo apt-get update究其原因,应该是刚安装,软件源还来不及更新,所以才会无法找到包。sudo apt-get install zlib1g.dev使用 Ctrl+a 组合键,我们就不需要使用方向键来移动光标,...原创 2020-01-02 09:33:33 · 904 阅读 · 0 评论 -
Mysql基本异常以及基本操作
MySQLIntegrityConstraintViolationException: Duplicate entry ‘admin-2’ for key ‘idx_unq_usercode_usertype’原因就是插入数据时,具有唯一约束条件的列的值有重复。 违反唯一约束条件务必确认插入数据主键或者具有唯一性约束的列不要有重复数据!!!MysqlDataTruncation: Data...原创 2020-01-02 09:30:06 · 322 阅读 · 1 评论 -
前后端数据格式的区别
postman中 form-data、x-www-form-urlencoded、raw、binary的区别大家在使用postman向后端接口发送数据的时候,会发现有四个选项供大家选择,如图:这四种格式有什么不同呢?1、form-data:就是http请求中的multipart/form-data,它会将表单的数据处理为一条消息,以标签为单元,用分隔符分开。既可以上传键值对,也可以上传文件...原创 2020-01-02 09:28:51 · 616 阅读 · 0 评论 -
Spring核心思想
Spring 2.5 中除了提供 @Component 注释外,还定义了几个拥有特殊语义的注释,它们分别是:@Repository、@Service 和 @Controller。在目前的 Spring 版本中,这 3 个注释和 @Component 是等效的,但是从注释类的命名上,很容易看出这 3 个注释分别和持久层、业务层和控制层(Web 层)相对应。1、@Component@Compon...原创 2020-01-02 09:26:34 · 112 阅读 · 0 评论 -
Nginx配置文件
server {listen 8846;server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html/dist; index index.html index.htm;...原创 2020-01-02 09:24:45 · 89 阅读 · 0 评论 -
Linux安装Node(Ubuntu)
看版本号下载node 下载地址:https://nodejs.org/dist/xftp 上传到 /usr/local[root@xxx /]cd /usr/local/安装与配置下载完成后解压[root@xxx /usr/local]tar zxvf node-v8.1.4-linux-x64.tar.gz重命名为node[root@xxx /usr/local]mv no...原创 2019-12-15 15:31:39 · 138 阅读 · 0 评论 -
Linux安装MySQL(Ubuntu)
官网下载Linux的版的MYSQL 下载地址: https://dev.mysql.com/downloads/mysql/5.7.html首先准备好mysql-5.7.28的安装包,使用xftp把安装包放在/usr/local目录下连接终端 切换换到/usr/local目录[root@xxx /]cd /usr/local解压[root@xxx /usr/local]tar -zx...原创 2019-12-15 15:27:18 · 149 阅读 · 0 评论 -
Linux安装JDK、Tomcat(Ubuntu)
安装Tomcat前首先要安装对应的JDK并配置Java环境。一、环境准备JDK版本:1.8工具:xShell xftp二、安装Java环境1、下载安装包 这里只是二进制安装下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html我这边是下载的jdk-8u231-l...原创 2019-12-14 21:15:25 · 106 阅读 · 0 评论 -
Linux安装Redis(Ubuntu)压缩包安装
第一步:下载新版本redis-5.0.5.tar.gz 下载地址 http://download.redis.io第二步:XFTP上传到Linux /usr/local 下第三步:进行解压、编译、安装[root@xxx ~]# cd /usr/local/1.使用 tar 命令解压[root@xxx redis]# tar -zxvf redis-5.0.5.tar.gz重命名...原创 2019-12-14 18:44:19 · 703 阅读 · 0 评论