| | |
| | | package org.jeecg.modules.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.CommonUtils; |
| | | import org.jeecg.common.util.MinioUtil; |
| | | import org.jeecg.common.util.StrUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.oss.entity.OssFile; |
| | | import org.jeecg.modules.oss.service.IOssFileService; |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | | import org.jeecg.modules.system.service.IUploadService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/sys/upload") |
| | | public class SysUploadController { |
| | | @Autowired |
| | | private IOssFileService ossFileService; |
| | | |
| | | @Autowired |
| | | private IUploadService uploadService; |
| | |
| | | if(oConvertUtils.isEmpty(fileUrl)){ |
| | | return Result.error("上传失败,请检查配置信息是否正确!"); |
| | | } |
| | | //保存文件信息 |
| | | OssFile minioFile = new OssFile(); |
| | | minioFile.setFileName(orgName); |
| | | minioFile.setUrl(fileUrl); |
| | | ossFileService.save(minioFile); |
| | | |
| | | result.setMessage(fileUrl); |
| | | result.setSuccess(true); |
| | | return result; |