package com.fdkankan.manage.controller;

import com.fdkankan.common.controller.BaseController;
import com.fdkankan.common.response.ResultData;
import com.fdkankan.manage.service.ICommonService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * TODO
 * </p>
 *
 * @author dengsixing
 * @since 2022/6/7
 **/
@RestController
@RequestMapping("/service/manage/common")
public class CommonController extends BaseController {

    @Autowired
    private ICommonService commonService;

    /**
     * 文件上传
     * @param file 文件
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/upload/files", method = RequestMethod.POST)
    public ResultData uploads(
        @RequestParam(value = "file") MultipartFile file) throws Exception {

        return commonService.uploadFile(file);

    }

}
