copy from aps-modules/aps-file/src/main/java/com/aps/file/controller/SysFileController.java
copy to aps-modules/aps-core/src/main/java/com/aps/core/controller/CoreController.java
Îļþ´Ó aps-modules/aps-file/src/main/java/com/aps/file/controller/SysFileController.java ¸´ÖÆ |
| | |
| | | package com.aps.file.controller; |
| | | package com.aps.core.controller; |
| | | |
| | | import com.aps.core.service.ICoreService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.common.core.utils.file.FileUtils; |
| | | import com.aps.file.service.ISysFileService; |
| | | import com.aps.system.api.domain.SysFile; |
| | | |
| | | /** |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysFileController |
| | | public class CoreController |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(SysFileController.class); |
| | | private static final Logger log = LoggerFactory.getLogger(CoreController.class); |
| | | |
| | | @Autowired |
| | | private ISysFileService sysFileService; |
| | | private ICoreService coreService; |
| | | |
| | | /** |
| | | * æä»¶ä¸ä¼ è¯·æ± |
| | |
| | | try |
| | | { |
| | | // ä¸ä¼ å¹¶è¿å访é®å°å |
| | | String url = sysFileService.uploadFile(file); |
| | | String url = coreService.uploadFile(file); |
| | | SysFile sysFile = new SysFile(); |
| | | sysFile.setName(FileUtils.getName(url)); |
| | | sysFile.setUrl(url); |