/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ifish.action;

import com.ifish.helper.FastDFSClientI;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 *
 * @author Administrator
 */
@RestController
@RequestMapping("/file")
public class FileAction {

    @Autowired
    private FastDFSClientI fastDFSClientI;

    @RequestMapping(value = "/fileupload", method = RequestMethod.POST)
    public Object testfile(MultipartFile uploadFile, HttpServletRequest request) throws IOException {
        return fastDFSClientI.uploadFileToFastDFS(uploadFile);
    }
}
