首先拉取最新的FastDFS代码
GitHub - wangwei216/fastdfs-client-java-master
打包到本地
mvn clean install
更换jdk版本

创建一个controller用来进行测试
- @RestController
- @RequestMapping("/fdfs")
- public class FdfsController {
- @GetMapping(value = "/hello")
- public String hello(){
- return "桃李不言下";
- }
-
- }
配置文件启动端口修改一下
server.port=8090
pom.xml文件
- <properties>
- <java.version>1.8java.version>
- <fastjson.version>1.2.75fastjson.version>
- <hutool.version>5.5.2hutool.version>
- <generator.version>1.1.2generator.version>
- <commons-io.version>2.8.0commons-io.version>
- <commons-lang3.version>3.11commons-lang3.version>
- properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webfluxartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.sessiongroupId>
- <artifactId>spring-session-coreartifactId>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-devtoolsartifactId>
- <scope>runtimescope>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-configuration-processorartifactId>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-tomcatartifactId>
- <scope>providedscope>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-testartifactId>
- <scope>testscope>
- dependency>
- <dependency>
- <groupId>io.projectreactorgroupId>
- <artifactId>reactor-testartifactId>
- <scope>testscope>
- dependency>
-
- <dependency>
- <groupId>cn.hutoolgroupId>
- <artifactId>hutool-allartifactId>
- <version>${hutool.version}version>
- dependency>
-
- <dependency>
- <groupId>com.github.binarywanggroupId>
- <artifactId>java-testdata-generatorartifactId>
- <version>${generator.version}version>
- dependency>
-
- <dependency>
- <groupId>commons-iogroupId>
- <artifactId>commons-ioartifactId>
- <version>${commons-io.version}version>
- dependency>
-
- <dependency>
- <groupId>com.alibabagroupId>
- <artifactId>fastjsonartifactId>
- <version>${fastjson.version}version>
- dependency>
-
- <dependency>
- <groupId>org.apache.commonsgroupId>
- <artifactId>commons-lang3artifactId>
- <version>${commons-lang3.version}version>
- dependency>
-
-
- <dependency>
- <groupId>org.csourcegroupId>
- <artifactId>fastdfs-client-javaartifactId>
- <version>1.29-SNAPSHOTversion>
- dependency>
- <exclusions>
- <exclusion>
- <groupId>org.slf4jgroupId>
- <artifactId>slf4j-log4j12artifactId>
- exclusion>
- exclusions>
- dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-maven-pluginartifactId>
- <version>2.5.10version>
- plugin>
- plugins>
- build>
resources下fastdfs-client.properties
- #连接超时时间,单位为秒。
- fastdfs.connect_timeout_in_seconds = 5
- #通信超时时间,单位为秒。发送或接收数据时。假设在超时时间后还不能发送或接收数据,则本次网络通信失败
- fastdfs.network_timeout_in_seconds = 30
- #charset: 字符集
- fastdfs.charset = UTF-8
- fastdfs.http_anti_steal_token = false
- fastdfs.http_secret_key = FastDFS1234567890
- #tracker的http端口
- fastdfs.http_tracker_http_port = 28083
- #tracker服务器IP和端口设置
- fastdfs.tracker_servers = 39.97.100.141:22122
-
- fastdfs.connection_pool.enabled = true
- fastdfs.connection_pool.max_count_per_entry = 500
- fastdfs.connection_pool.max_idle_time = 3600
- fastdfs.connection_pool.max_wait_time_in_ms = 1000
application.yml
- server:
- port: 8090
- spring:
- servlet:
- multipart:
- max-file-size: 50MB #文件上传大小限制为
- max-request-size: 200MB #请求大小限制为
- #查看图片的端口号
-
- fdfs_storage_proxy:
- protocol: http://
- domain: 192.168.178.130
- port: 8888
测试
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
-
- @RestController
- @RequestMapping("/fdfs")
- public class FdfsController {
- @Value("${fdfs_storage_proxy.protocol}")
- private String fdfs_storage_proxy_protocol;
- @Value("${fdfs_storage_proxy.domain}")
- private String fdfs_storage_proxy_domain;
- @Value("${fdfs_storage_proxy.port}")
- private String fdfs_storage_proxy_port;
-
- @GetMapping("/proxy")
- public String proxy(){
- return fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;
- }
-
- @GetMapping(value = "/hello")
- public String hello(){
- return "桃李不言下";
- }
- }
返回值状态枚举
ResultCode.enum
- /*
- * 返回值状态枚举
- * */
- public enum ResultCode {
- /*
- * 操作成功 请求成功
- * */
- SUCCESS("200","操作成功","请求成功"),
- /*
- * 上传失败
- * */
- UPLOAD_FAILED("700","上传失败","上传失败");
-
- /*
- * 状态码
- * */
- private String code;
- /*
- * 状态码含义
- * */
- private String msg;
- /*
- * 状态码含义描述
- * */
- private String desc;
-
- ResultCode(String code,String msg,String desc){
- this.code=code;
- this.msg=msg;
- this.desc=desc;
- }
-
- public String getCode() {
- return code;
- }
-
- public String getMsg() {
- return msg;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- public void setMsg(String msg) {
- this.msg = msg;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
- }
R.java
- /*
- * 统一返回数据格式
- * */
- @NoArgsConstructor
- @AllArgsConstructor
- @Getter
- @Setter
- public class R
{ - /*
- * 状态码
- * */
- private String code;
- /*
- * 状态码含义
- * */
- private String msg;
- /*
- * 状态码含义描述
- * */
- private T data;
- }
FdfsController.java
- @RestController
- @RequestMapping("/fdfs")
- public class FdfsController {
- @Value("${fdfs_storage_proxy.protocol}")
- private String fdfs_storage_proxy_protocol;
- @Value("${fdfs_storage_proxy.domain}")
- private String fdfs_storage_proxy_domain;
- @Value("${fdfs_storage_proxy.port}")
- private String fdfs_storage_proxy_port;
-
- @GetMapping("/proxy")
- public String proxy(){
- return fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;
- }
-
- @GetMapping(value = "/hello")
- public String hello(){
- return "桃李不言下";
- }
-
-
- @RequestMapping("/upload1")
- public R<String>update01(@RequestParam("header")MultipartFile multipartFile){
- //封装返回数据 默认为上传失败
- R<String> response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null);
- //获取原文件的名字
- String originalFilename = multipartFile.getOriginalFilename();
- //获取源文件后缀名
- String suffix = FilenameUtils.getExtension(originalFilename);
- //文件上传
- try {
- //加载fastdfs-client.properties配置文件
- ClientGlobal.initByProperties("fastdfs-client.properties");
- //获取tracker和storage客户端对象
- TrackerClient client = new TrackerClient();
- //获取tracker地址
- TrackerServer trackerServer = client.getTrackerServer();
- StorageServer storageServer=null;
- //获取storage地址
- StorageClient storageClient = new StorageClient(trackerServer, storageServer);
- //文件上传字节数组
- InputStream inputStream = multipartFile.getInputStream();
- int length = inputStream.available();
- byte[] bytes = new byte[length];
- //文件上传成功后重新封装返回数据
- inputStream.read(bytes);
- String[] result = storageClient.upload_file(bytes, suffix, null);
- System.out.println(JSON.toJSONString(result));
- //文件上传后,重新封装返回数据
- response.setCode(ResultCode.SUCCESS.getCode());
- response.setMsg(ResultCode.SUCCESS.getMsg());
- String url =fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port+"/" +result[0]+"/"+result[1];
- response.setData(url);
- } finally {
- //向用户响应上传成功的访问地址
- return response;
- }
- }
-
- }
封装成Utils工具类
BaseFastDFSUtil.java
- /*
- * FastDFS工具类
- * */
- public class BaseFastDFSUtil {
- /*
- * 配置文件
- * */
- private final static String propFilePath="fastdfs-client.properties";
-
- static {
- //加载fastdfs-client.properties配置文件
- try {
- ClientGlobal.initByProperties(propFilePath);
- } catch (IOException | MyException e) {
- e.printStackTrace();
- }
- }
-
- /*
- *文件上传到fastdfs
- *fdfs_storage_proxy_url storage web服务地址
- * inputStream 上传文件的自己输入流
- * file_etx_name 上传文件的后缀名
- * 上传成功后的web地址
- * */
- public static String upload(String fdfs_storage_proxy_url, InputStream inputStream,String file_ext_name) throws Exception {
- //获取tracker和storage客户端对象
- TrackerClient client = new TrackerClient();
- //获取tracker地址
- TrackerServer trackerServer = client.getTrackerServer();
- StorageServer storageServer=null;
- //获取storage地址
- StorageClient storageClient = new StorageClient(trackerServer, storageServer);
- int length = inputStream.available();
- byte[] bytes = new byte[length];
- //文件上传成功后重新封装返回数据
- inputStream.read(bytes);
- String[] result = storageClient.upload_file(bytes, file_ext_name, null);
- System.out.println(JSON.toJSONString(result));
- //断开连接
- storageClient.close();
- return fdfs_storage_proxy_url+"/" +result[0]+"/"+result[1];
- }
- }
FdfsController.java
- @RestController
- @RequestMapping("/fdfs")
- public class FdfsController {
- @Value("${fdfs_storage_proxy.protocol}")
- private String fdfs_storage_proxy_protocol;
- @Value("${fdfs_storage_proxy.domain}")
- private String fdfs_storage_proxy_domain;
- @Value("${fdfs_storage_proxy.port}")
- private String fdfs_storage_proxy_port;
-
- @GetMapping("/proxy")
- public String proxy(){
- return fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;
- }
-
- @GetMapping(value = "/hello")
- public String hello(){
- return "桃李不言下";
- }
-
- @RequestMapping("/upload1")
- public R<String>update01(@RequestParam("header")MultipartFile multipartFile){
- //封装返回数据 默认为上传失败
- R<String> response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null);
- //获取原文件的名字
- String originalFilename = multipartFile.getOriginalFilename();
- //获取源文件后缀名
- String suffix = FilenameUtils.getExtension(originalFilename);
- //文件上传
- try {
- //加载fastdfs-client.properties配置文件
- ClientGlobal.initByProperties("fastdfs-client.properties");
- //获取tracker和storage客户端对象
- TrackerClient client = new TrackerClient();
- //获取tracker地址
- TrackerServer trackerServer = client.getTrackerServer();
- StorageServer storageServer=null;
- //获取storage地址
- StorageClient storageClient = new StorageClient(trackerServer, storageServer);
- //文件上传字节数组
- InputStream inputStream = multipartFile.getInputStream();
- int length = inputStream.available();
- byte[] bytes = new byte[length];
- //文件上传成功后重新封装返回数据
- inputStream.read(bytes);
- String[] result = storageClient.upload_file(bytes, suffix, null);
- System.out.println(JSON.toJSONString(result));
- //文件上传后,重新封装返回数据
- response.setCode(ResultCode.SUCCESS.getCode());
- response.setMsg(ResultCode.SUCCESS.getMsg());
- //断开连接
- storageClient.close();
- String url =fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port+"/" +result[0]+"/"+result[1];
- response.setData(url);
- } finally {
- //向用户响应上传成功的访问地址
- return response;
- }
- }
-
- @RequestMapping("/upload2")
- public R<String>update02(@RequestParam("header")MultipartFile multipartFile){
- //封装返回数据 默认为上传失败
- R<String> response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null);
- //获取原文件的名字
- String originalFilename = multipartFile.getOriginalFilename();
- //获取源文件后缀名
- String suffix = FilenameUtils.getExtension(originalFilename);
- //文件上传
- try {
- String proxy=fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;
- String url = BaseFastDFSUtil.upload(proxy, multipartFile.getInputStream(), suffix);
- //文件上传后,重新封装返回数据
- response.setCode(ResultCode.SUCCESS.getCode());
- response.setMsg(ResultCode.SUCCESS.getMsg());
- response.setData(url);
- } finally {
- //向用户响应上传成功的访问地址
- return response;
- }
- }
- }
utils层
- /**
- * 文件下载
- *
- * @param groupName 组/卷名,默认值:group1
- * @param remoteFileName 文件名,例如:"M00/00/00/wKgKZl9tkTCAJAanAADhaCZ_RF0495.jpg"
- * @return 文件的字节输入流
- */
- public static InputStream downloadFile(String groupName, String remoteFileName) {
- try {
- // 链接FastDFS服务器,创建tracker和Stroage
- TrackerClient trackerClient = new TrackerClient();
- TrackerServer trackerServer = trackerClient.getTrackerServer();
- StorageServer storageServer=trackerClient.getStoreStorage(trackerServer);
- //定义Stroage客户端对象,需要使用这个对象来完成具体的文件上传,下载和删除操作
- StorageClient storageClient = new StorageClient(trackerServer,storageServer);
- // 根据组名和文件名通过 Storage 客户端获取文件的字节数组
- byte[] bytes = storageClient.download_file(groupName == null ? "group1" : groupName, remoteFileName);
- // 返回字节流对象
- InputStream inputStream = new ByteArrayInputStream(bytes);
- return inputStream;
- } catch (IOException e) {
- e.printStackTrace();
- } catch (MyException e) {
- e.printStackTrace();
- }
- return null;
- }
Controller层
- /**
- * 文件下载
- */
- @PostMapping("/downloadFile")
- public R
downloadFile(@RequestParam("groupName")String groupName,@RequestParam("remoteFileName") String remoteFileName) throws Exception { -
- //封装返回数据 默认为上传失败
- R
response = new R<>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMsg(), "下载成功"); - //调用下载接口
- InputStream is = BaseFastDFSUtil
- .downloadFile(groupName, remoteFileName);
-
- File file = new File("D:/" + remoteFileName);
- //判断目录是否存在如果不存在则存在
- //getParent()——得到路径的父级及以上的目录,String类型。
- //getParentFile()——得到路径的父级及以上的目录实例化的File对象。
- //createNewFile()创建文件
- //mkdir()——仅创建一层目录,返回true或false.
- //mkdirs()——创建一层或多层目录,返回true或false.
- if (!file.exists()){
- boolean dr = file.getParentFile().mkdirs(); //创建目录
- }
- OutputStream os = new FileOutputStream(new File("D:/" + remoteFileName));
-
- int index = 0 ;
- while((index = is.read())!=-1){
- os.write(index);
- }
- os.flush();
- os.close();
- is.close();
- return response;
- }
Utils层
- /**
- * 文件删除
- *
- * @param groupName 组/卷名,默认值:group1
- * @param remoteFileName 文件名,例如:"M00/00/00/wKgKZl9tkTCAJAanAADhaCZ_RF0495.jpg"
- * @return 0为成功,非0为失败
- */
- public static int deleteFile(String groupName, String remoteFileName) {
- int result = -1;
- try {
- // 链接FastDFS服务器,创建tracker和Stroage
- TrackerClient trackerClient = new TrackerClient();
- TrackerServer trackerServer = trackerClient.getTrackerServer();
- StorageServer storageServer=trackerClient.getStoreStorage(trackerServer);
- //定义Stroage客户端对象,需要使用这个对象来完成具体的文件上传,下载和删除操作
- StorageClient storageClient = new StorageClient(trackerServer,storageServer);
- // 根据组名和文件名通过 Storage 客户端删除文件
- result = storageClient.delete_file(groupName == null ? "group1" : groupName, remoteFileName);
- } catch (IOException e) {
- e.printStackTrace();
- } catch (MyException e) {
- e.printStackTrace();
- }
- return result;
- }
Controller层
- // 文件删除
- @PostMapping("/testDeleteFile")
- public void testDeleteFile(@RequestParam("groupName")String groupName,@RequestParam("remoteFileName") String remoteFileName) {
- int result = BaseFastDFSUtil.deleteFile(groupName, remoteFileName);
- System.out.println("result = " + result);
- }
Utils工具类层
- /**
- * 修改一个已经存在的文件
- *
- * @param oldGroupName 旧组名
- * @param oldFileName 旧文件名
- * @param file 新文件
- * @param fileName 新文件名
- * @return
- */
- public static String modifyFile(String oldGroupName, String oldFileName, MultipartFile file) throws Exception {
- // 先上传
- String stringR = update01(file);
- // 再删除
- int delResult = deleteFile(oldGroupName, oldFileName);
- if (delResult != 0) {
- return null;
- }
- return stringR;
- }
-
- /*
- *文件上传到fastdfs
- *fdfs_storage_proxy_url storage web服务地址
- * inputStream 上传文件的自己输入流
- * file_etx_name 上传文件的后缀名
- * 上传成功后的web地址
- * */
- public static String update01(MultipartFile multipartFile) throws Exception {
- //获取原文件的名字
- String originalFilename = multipartFile.getOriginalFilename();
- //获取源文件后缀名
- String suffix = FilenameUtils.getExtension(originalFilename);
- //文件上传
- //加载fastdfs-client.properties配置文件
- ClientGlobal.initByProperties("fastdfs-client.properties");
- //获取tracker和storage客户端对象
- TrackerClient client = new TrackerClient();
- //获取tracker地址
- TrackerServer trackerServer = client.getTrackerServer();
- StorageServer storageServer = null;
- //获取storage地址
- StorageClient storageClient = new StorageClient(trackerServer, storageServer);
- //文件上传字节数组
- InputStream inputStream = multipartFile.getInputStream();
- int length = inputStream.available();
- byte[] bytes = new byte[length];
- //文件上传成功后重新封装返回数据
- inputStream.read(bytes);
- String[] result = storageClient.upload_file(bytes, suffix, null);
- System.out.println(JSON.toJSONString(result));
- String url = "http://" + "39.97.100.141" + ":" + "8888" + "/" + result[0] + "/" + result[1];
- return url;
- }
- /*
- *文件上传到fastdfs
- *fdfs_storage_proxy_url storage web服务地址
- * inputStream 上传文件的自己输入流
- * file_etx_name 上传文件的后缀名
- * 上传成功后的web地址
- * */
- public static String upload(String fdfs_storage_proxy_url, InputStream inputStream, String file_ext_name) throws Exception {
- //获取tracker和storage客户端对象
- TrackerClient client = new TrackerClient();
- //获取tracker地址
- TrackerServer trackerServer = client.getTrackerServer();
- StorageServer storageServer=null;
- //获取storage地址
- StorageClient storageClient = new StorageClient(trackerServer, storageServer);
- int length = inputStream.available();
- byte[] bytes = new byte[length];
- //文件上传成功后重新封装返回数据
- inputStream.read(bytes);
- String[] result = storageClient.upload_file(bytes, file_ext_name, null);
- System.out.println(JSON.toJSONString(result));
- //断开连接
- storageClient.close();
- return fdfs_storage_proxy_url+"/" +result[0]+"/"+result[1];
- }
Controller层
- // 文件替换
- @PostMapping("/testModifyFile")
- public String testModifyFile(@RequestParam("groupName")String groupName,@RequestParam("remoteFileName") String remoteFileName,@RequestParam("header")MultipartFile file) throws Exception {
- //封装返回数据 默认为上传失败
- String fileids = BaseFastDFSUtil.modifyFile(groupName, remoteFileName,file);
- return fileids;
- }
配置yaml
- upload:
- base-url: http://116.62.44.5/
- allow-types:
- - image/jpeg
- - image/png
- - image/bmp
- - image/gif
创建配置类UploadProperties
- package com.coydone.config;
-
- import org.springframework.boot.context.properties.ConfigurationProperties;
-
- import java.util.List;
-
- @ConfigurationProperties(prefix = "upload")
- public class UploadProperties {
-
- private String baseUrl;
-
- private List<String> allowTypes;
-
- public String getBaseUrl() {
- return baseUrl;
- }
-
- public void setBaseUrl(String baseUrl) {
- this.baseUrl = baseUrl;
- }
-
- public List<String> getAllowTypes() {
- return allowTypes;
- }
-
- public void setAllowTypes(List<String> allowTypes) {
- this.allowTypes = allowTypes;
- }
- }
在Controller使用
-
- @RestController
- @Component
- @EnableConfigurationProperties(UploadProperties.class)
- @RequestMapping("/fdfs")
- public class FdfsController {
-
- @Autowired
- private UploadProperties prop;
- @RequestMapping("/upload1")
- public R
update01(@RequestParam("header") MultipartFile multipartFile){ - //封装返回数据 默认为上传失败
- R
response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null); -
- //获取原文件的名字
- String originalFilename = multipartFile.getOriginalFilename();
- //获取源文件后缀名
- String suffix = FilenameUtils.getExtension(originalFilename);
- System.out.println("获取源文件后缀名"+suffix);
- // 1、校验文件类型
- String contentType = multipartFile.getContentType();
- if (!prop.getAllowTypes().contains(contentType)) {
- throw new RuntimeException("文件类型不支持");
- }
- // 2、校验文件内容
- try {
- BufferedImage image = ImageIO.read(multipartFile.getInputStream());
- if (image == null || image.getWidth() == 0 || image.getHeight() == 0) {
- throw new RuntimeException("上传文件有问题");
- }
- } catch (IOException e) {
- throw new RuntimeException("校验文件内容失败"+e.getMessage());
- }
- try {
- //加载fastdfs-client.properties配置文件
- ClientGlobal.initByProperties("fastdfs-client.properties");
- //获取tracker和storage客户端对象
- TrackerClient client = new TrackerClient();
- //获取tracker地址
- TrackerServer trackerServer = client.getTrackerServer();
- StorageServer storageServer=null;
- //获取storage地址
- StorageClient storageClient = new StorageClient(trackerServer, storageServer);
- //文件上传字节数组
- InputStream inputStream = multipartFile.getInputStream();
- int length = inputStream.available();
- byte[] bytes = new byte[length];
- //文件上传成功后重新封装返回数据
- inputStream.read(bytes);
- String[] result = storageClient.upload_file(bytes, suffix, null);
- System.out.println(JSON.toJSONString(result));
- //文件上传后,重新封装返回数据
- response.setCode(ResultCode.SUCCESS.getCode());
- response.setMsg(ResultCode.SUCCESS.getMsg());
- String url =fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port+"/" +result[0]+"/"+result[1];
- response.setData(url);
- } finally {
- //向用户响应上传成功的访问地址
- return response;
- }
- }
- }