新建SpringBoot项目
项目依赖
<dependencies>
<!-- fastDFS-client -->
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
<version>1.26.4</version>
</dependency>
<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
配置文件
fdfs:
so-timeout: 3000
connect-timeout: 1000
thumb-image:
width: 60
height: 60
tracker-list:
- 121.199.58.42:22122
文件服务配置类
package zw.springboot.config;
import com.github.tobato.fastdfs.FdfsClientConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.Import;
import org.springframework.jmx.support.RegistrationPolicy;
/**
* @ClassName FastDFSClientConfig
* @Description 文件服务器配置类
* @Author 周威
* @