package com.ruoyi.cms.controller.app;

import com.ruoyi.cms.service.IFileService;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/app/file")
public class AppFileController {
    @Autowired
    private IFileService fileService;
    @BussinessLog(title = "上传文件")
    @PostMapping("/upload")
    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "bussinessId",required = false) Long bussinessId) {
       return fileService.uploadFile(file,bussinessId);
    }
}
