Commit 6ccb5007 by yao.xiao

暂存-富文本上传初始化

parent a9bc0382
package com.yd.api.agms; package com.yd.api.agms;
import com.yd.api.agms.service.AgmsDashboardService; import com.yd.api.agms.service.*;
import com.yd.api.agms.service.AgmsFortuneService;
import com.yd.api.agms.service.AgmsHiringService;
import com.yd.api.agms.vo.dashboard.*; import com.yd.api.agms.vo.dashboard.*;
import com.yd.api.agms.service.AgmsStatisticsService;
import com.yd.api.agms.vo.fortune.*; import com.yd.api.agms.vo.fortune.*;
import com.yd.api.agms.vo.hiring.*; import com.yd.api.agms.vo.hiring.*;
import com.yd.api.agms.vo.sharing.ControllerResponseVO;
import com.yd.api.agms.vo.statistics.FinancialStatisticsRequestVO; import com.yd.api.agms.vo.statistics.FinancialStatisticsRequestVO;
import com.yd.api.agms.vo.statistics.FinancialStatisticsResponseVO; import com.yd.api.agms.vo.statistics.FinancialStatisticsResponseVO;
import com.yd.api.agms.vo.statistics.LeadsStatisticsRequestVO; import com.yd.api.agms.vo.statistics.LeadsStatisticsRequestVO;
import com.yd.api.agms.vo.statistics.LeadsStatisticsResponseVO; import com.yd.api.agms.vo.statistics.LeadsStatisticsResponseVO;
import com.yd.api.practitioner.vo.hiring.HiringApproveRequestVO;
import com.yd.api.practitioner.vo.hiring.HiringApproveResponseVO;
import com.yd.api.result.JsonResult; import com.yd.api.result.JsonResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -35,6 +29,8 @@ public class AgmsController { ...@@ -35,6 +29,8 @@ public class AgmsController {
private AgmsFortuneService agmsFortuneService; private AgmsFortuneService agmsFortuneService;
@Autowired @Autowired
private AgmsHiringService agmsHiringService; private AgmsHiringService agmsHiringService;
@Autowired
private AgmsSharingService agmsSharingService;
/** /**
* AGMS -- 财务管理报表 * AGMS -- 财务管理报表
...@@ -286,4 +282,10 @@ public class AgmsController { ...@@ -286,4 +282,10 @@ public class AgmsController {
result.addResult(responseVO); result.addResult(responseVO);
return result; return result;
} }
@RequestMapping(value="/controller")
public Object controller(@RequestParam String action,@RequestParam(value = "upfile",required = false) MultipartFile upfile) {
ControllerResponseVO responseVO = agmsSharingService.controller(action,upfile);
return responseVO;
}
} }
package com.yd.api.agms.service;
import com.yd.api.agms.vo.sharing.ControllerResponseVO;
import org.springframework.web.multipart.MultipartFile;
/**
* @author xxy
*/
public interface AgmsSharingService {
/**
*
* @param action
* @param upfile
* @return
*/
ControllerResponseVO controller(String action, MultipartFile upfile);
}
package com.yd.api.agms.service.impl;
import com.google.common.collect.Lists;
import com.yd.api.agms.service.AgmsSharingService;
import com.yd.api.agms.vo.sharing.ControllerResponseVO;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.util.Arrays;
/**
* @author xxy
*/
@Service("agmsSharingService")
public class AgmsSharingServiceImpl implements AgmsSharingService {
@Override
public ControllerResponseVO controller(String action, MultipartFile upfile) {
ControllerResponseVO responseVO = new ControllerResponseVO();
if ("uploadimage".equals(action)) {
responseVO.setImageActionName("uploadimage");
responseVO.setImageFieldName("upfile");
responseVO.setImageMaxSize(2048000);
String[] imageAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp"};
responseVO.setImageAllowFiles(Arrays.asList(imageAllowFiles.clone()));
responseVO.setImageCompressEnable(true);
responseVO.setImageCompressBorder(1600);
responseVO.setImageInsertAlign("none");
responseVO.setImageUrlPrefix("");
responseVO.setImagePathFormat("/sharing/image/{time}{rand:6}");
responseVO.setScrawlActionName("uploadscrawl");
responseVO.setScrawlFieldName("upfile");
responseVO.setScrawlPathFormat("/sharing/image/{time}{rand:6}");
responseVO.setScrawlMaxSize(2048000);
responseVO.setScrawlUrlPrefix("");
responseVO.setScrawlInsertAlign("none");
responseVO.setSnapscreenActionName("uploadimage");
responseVO.setSnapscreenPathFormat("/sharing/image/{time}{rand:6}");
responseVO.setSnapscreenUrlPrefix("");
responseVO.setSnapscreenInsertAlign("none");
String[] catcherLocalDomain = new String[]{"127.0.0.1", "localhost", "img.baidu.com"};
responseVO.setCatcherLocalDomain(Arrays.asList(catcherLocalDomain.clone()));
responseVO.setCatcherActionName("catchimage");
responseVO.setCatcherFieldName("source");
responseVO.setCatcherPathFormat("/sharing/image/{time}{rand:6}");
responseVO.setCatcherUrlPrefix("");
responseVO.setCatcherMaxSize(2048000);
String[] catcherAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp"};
responseVO.setCatcherAllowFiles(Arrays.asList(catcherAllowFiles.clone()));
responseVO.setVideoActionName("uploadvideo");
responseVO.setVideoFieldName("upfile");
responseVO.setVideoPathFormat("/sharing/video/{time}{rand:6}");
responseVO.setVideoUrlPrefix("");
responseVO.setVideoMaxSize(102400000);
String[] videoAllowFiles = new String[]{".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"};
responseVO.setVideoAllowFiles(Arrays.asList(videoAllowFiles.clone()));
responseVO.setFileActionName("uploadfile");
responseVO.setFileFieldName("upfile");
responseVO.setFilePathFormat("/sharing/file/{time}{rand:6}");
responseVO.setFileUrlPrefix("");
responseVO.setFileMaxSize(51200000);
String[] fileAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp",
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"};
responseVO.setFileAllowFiles(Arrays.asList(fileAllowFiles.clone()));
responseVO.setImageManagerActionName("listimage");
responseVO.setImageManagerListPath("/sharing/image/");
responseVO.setImageManagerListSize(20);
responseVO.setImageManagerUrlPrefix("");
responseVO.setImageManagerInsertAlign("none");
String[] imageManagerAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp"};
responseVO.setImageManagerAllowFiles(Arrays.asList(imageManagerAllowFiles.clone()));
responseVO.setFileManagerActionName("listfile");
responseVO.setFileManagerListPath("/sharing/file/");
responseVO.setFileManagerUrlPrefix("");
responseVO.setFileManagerListSize(20);
String[] fileManagerAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp",
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"};
responseVO.setFileManagerAllowFiles(Arrays.asList(fileManagerAllowFiles.clone()));
} else if ("config".equals(action)){
responseVO.setState("");
responseVO.setUrl("");
responseVO.setTitle("");
responseVO.setOriginal("");
responseVO.setType("");
responseVO.setSize(0L);
}
return responseVO;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment