|
@ -1,29 +1,28 @@
|
|
|
package cn.stylefeng.guns.zjxl.cnotroller;
|
|
|
|
|
|
import cn.stylefeng.guns.config.FastDFSConfig;
|
|
|
import cn.stylefeng.guns.zjxl.model.UploadModel;
|
|
|
import cn.stylefeng.guns.zjxl.model.ZjxlBanner;
|
|
|
import cn.stylefeng.guns.zjxl.model.ZjxlCompanyCase;
|
|
|
import cn.stylefeng.guns.zjxl.model.ret.BannerCompanyCaseRet;
|
|
|
import cn.stylefeng.guns.zjxl.model.ret.BaseResultModel;
|
|
|
import cn.stylefeng.guns.zjxl.model.ret.ResultOneModel;
|
|
|
import cn.stylefeng.guns.zjxl.service.ZjxlBannerService;
|
|
|
import cn.stylefeng.guns.zjxl.service.ZjxlCompanyCaseService;
|
|
|
import cn.stylefeng.guns.zjxlUtil.BaseController;
|
|
|
import cn.stylefeng.guns.zjxlUtil.FastDFSUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.ini4j.spi.RegEscapeTool;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
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;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
/***
|
|
|
* @ClassName: ZjxlBannerCnotroller
|
|
@ -39,8 +38,8 @@ public class ZjxlBannerCnotroller extends BaseController {
|
|
|
@Autowired
|
|
|
private ZjxlBannerService bannerService;
|
|
|
|
|
|
@Autowired(required = false)
|
|
|
FastDFSUtil fastDFSUtil;
|
|
|
@Autowired
|
|
|
FastDFSConfig fastDFSConfig;
|
|
|
@Value("${fastDFS.fastdfs_file_url}")
|
|
|
private String fastdfs_file_url;
|
|
|
|
|
@ -143,7 +142,7 @@ public class ZjxlBannerCnotroller extends BaseController {
|
|
|
String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
|
|
|
String fileName = fullName.substring(0, fullName.lastIndexOf("."));
|
|
|
//上传到fastdfs
|
|
|
ObjectNode objectNode = fastDFSUtil.upload(mf.getInputStream(), fileType, "");
|
|
|
ObjectNode objectNode = fastDFSConfig.fastDFSUtil().upload(mf.getInputStream(), fileType, "");
|
|
|
//解析返回的objectNode
|
|
|
uploadModel.setFileName(fileName);
|
|
|
uploadModel.setFileType(fileType);
|