package com.tanpu.community.controller; import com.tanpu.common.api.CommonResp; import com.tanpu.common.constant.ErrorCodeConstant; import com.tanpu.common.exception.BizException; import com.tanpu.community.dao.entity.community.FileRecordEntity; import com.tanpu.community.manager.FileManager; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.Date; @RestController @Slf4j @RequestMapping(value = "/api/file") public class FileController { @Autowired private FileManager fileManager; @PostMapping("/uploadFile") @ResponseBody public CommonResp<FileRecordEntity> uploadToRemote(@RequestParam(value = "file") MultipartFile file) { return CommonResp.success(fileManager.uploadFile(file)); } }