Skip to content

FastDFS Spring Boot Starter, 实现连接池功能,帮助你在Spring-boot中快速集成FastDfs开发

Notifications You must be signed in to change notification settings

bokire/fastdfs-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fastdfs-spring-boot-starter

===================================

FastDfs 是一个开源的轻量级分布式文件系统. FastDfs Spring Boot Starter, 实现连接池功能, 帮助你在Spring-boot快速集成FastDfs开发

如何使用

  • 下载代码:
git clone https://github.com/bokire/fastdfs-spring-boot-starter.git
  • 安装至本地仓库:
mvn clean install
  • 添加依赖:
<dependency>
	<groupId>com.github.bokire</groupId>
	<artifactId>fastdfs-spring-boot-starter</artifactId>
	<version>1.0.0-SNAPSHOT</version>
</dependency>
  • 在application.properties添加fastdfs和连接池的相关配置信息,样例配置如下:
spring.fastdfs.client.charset=UTF-8
spring.fastdfs.client.trackerServer=127.0.0.1:22122

spring.fastdfs.pool.testOnBorrow=true

更多配置

  • 接下来在Spring Boot 工程中使用fastdfs
@Autowired
private FastDfsTemplate fastDfsTemplate;

@Test
public void testUpload() throws Exception {
    String fileId = fastDfsTemplate.upload_file("D:\\fastdfs.tex", null, null);
    System.out.println(fileId);
}

About

FastDFS Spring Boot Starter, 实现连接池功能,帮助你在Spring-boot中快速集成FastDfs开发

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages