Commit dee9925a by yao.xiao

测试-富文本初始化

parent 85d35831
...@@ -8,6 +8,7 @@ import com.yd.rmi.ali.oss.service.OssService; ...@@ -8,6 +8,7 @@ import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.ali.oss.vo.OssOperateTypeEnum; import com.yd.rmi.ali.oss.vo.OssOperateTypeEnum;
import com.yd.rmi.ali.oss.vo.OssRequestVO; import com.yd.rmi.ali.oss.vo.OssRequestVO;
import com.yd.rmi.ali.oss.vo.OssResponseVO; import com.yd.rmi.ali.oss.vo.OssResponseVO;
import com.yd.rmi.ali.ossinterf.service.AliOssInterfService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -29,11 +30,12 @@ public class AgmsSharingServiceImpl implements AgmsSharingService { ...@@ -29,11 +30,12 @@ public class AgmsSharingServiceImpl implements AgmsSharingService {
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
@Autowired @Autowired
private OssService ossService; private OssService ossService;
@Autowired
private AliOssInterfService aliOssInterfService;
@Override @Override
public ControllerResponseVO controller(String action, MultipartFile upfile) { public ControllerResponseVO controller(String action, MultipartFile upfile) {
ControllerResponseVO responseVO = new ControllerResponseVO(); ControllerResponseVO responseVO = new ControllerResponseVO();
String aliOssBucketName = systemConfigService.getSingleConfigValue("ALI_OSS_BUCKET_NAME");
String[] imageAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp"}; String[] imageAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp"};
String[] videoAllowFiles = new String[]{".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", String[] videoAllowFiles = new String[]{".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"}; ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"};
...@@ -43,6 +45,8 @@ public class AgmsSharingServiceImpl implements AgmsSharingService { ...@@ -43,6 +45,8 @@ public class AgmsSharingServiceImpl implements AgmsSharingService {
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"}; ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"};
if ("config".equals(action)) { if ("config".equals(action)) {
String aliOssBucketName = systemConfigService.getSingleConfigValue("ALI_OSS_BUCKET_NAME");
String generateUrl = aliOssInterfService.generateUrl(aliOssBucketName, null);
responseVO.setImageActionName("uploadimage"); responseVO.setImageActionName("uploadimage");
responseVO.setImageFieldName("upfile"); responseVO.setImageFieldName("upfile");
responseVO.setImageMaxSize(2048000); responseVO.setImageMaxSize(2048000);
...@@ -50,48 +54,48 @@ public class AgmsSharingServiceImpl implements AgmsSharingService { ...@@ -50,48 +54,48 @@ public class AgmsSharingServiceImpl implements AgmsSharingService {
responseVO.setImageCompressEnable(true); responseVO.setImageCompressEnable(true);
responseVO.setImageCompressBorder(1600); responseVO.setImageCompressBorder(1600);
responseVO.setImageInsertAlign("none"); responseVO.setImageInsertAlign("none");
responseVO.setImageUrlPrefix(aliOssBucketName); responseVO.setImageUrlPrefix(generateUrl);
responseVO.setImagePathFormat("/sharing/image/{time}{rand:6}"); responseVO.setImagePathFormat("/sharing/image/{time}{rand:6}");
responseVO.setScrawlActionName("uploadscrawl"); responseVO.setScrawlActionName("uploadscrawl");
responseVO.setScrawlFieldName("upfile"); responseVO.setScrawlFieldName("upfile");
responseVO.setScrawlPathFormat("/sharing/image/{time}{rand:6}"); responseVO.setScrawlPathFormat("/sharing/image/{time}{rand:6}");
responseVO.setScrawlMaxSize(2048000); responseVO.setScrawlMaxSize(2048000);
responseVO.setScrawlUrlPrefix(aliOssBucketName); responseVO.setScrawlUrlPrefix(generateUrl);
responseVO.setScrawlInsertAlign("none"); responseVO.setScrawlInsertAlign("none");
responseVO.setSnapscreenActionName("uploadimage"); responseVO.setSnapscreenActionName("uploadimage");
responseVO.setSnapscreenPathFormat("/sharing/image/{time}{rand:6}"); responseVO.setSnapscreenPathFormat("/sharing/image/{time}{rand:6}");
responseVO.setSnapscreenUrlPrefix(aliOssBucketName); responseVO.setSnapscreenUrlPrefix(generateUrl);
responseVO.setSnapscreenInsertAlign("none"); responseVO.setSnapscreenInsertAlign("none");
String[] catcherLocalDomain = new String[]{"127.0.0.1", "localhost", "img.baidu.com"}; String[] catcherLocalDomain = new String[]{"127.0.0.1", "localhost", "img.baidu.com"};
responseVO.setCatcherLocalDomain(Arrays.asList(catcherLocalDomain)); responseVO.setCatcherLocalDomain(Arrays.asList(catcherLocalDomain));
responseVO.setCatcherActionName("catchimage"); responseVO.setCatcherActionName("catchimage");
responseVO.setCatcherFieldName("source"); responseVO.setCatcherFieldName("source");
responseVO.setCatcherPathFormat("/sharing/image/{time}{rand:6}"); responseVO.setCatcherPathFormat("/sharing/image/{time}{rand:6}");
responseVO.setCatcherUrlPrefix(aliOssBucketName); responseVO.setCatcherUrlPrefix(generateUrl);
responseVO.setCatcherMaxSize(2048000); responseVO.setCatcherMaxSize(2048000);
responseVO.setCatcherAllowFiles(Arrays.asList(imageAllowFiles)); responseVO.setCatcherAllowFiles(Arrays.asList(imageAllowFiles));
responseVO.setVideoActionName("uploadvideo"); responseVO.setVideoActionName("uploadvideo");
responseVO.setVideoFieldName("upfile"); responseVO.setVideoFieldName("upfile");
responseVO.setVideoPathFormat("/sharing/video/{time}{rand:6}"); responseVO.setVideoPathFormat("/sharing/video/{time}{rand:6}");
responseVO.setVideoUrlPrefix(aliOssBucketName); responseVO.setVideoUrlPrefix(generateUrl);
responseVO.setVideoMaxSize(102400000); responseVO.setVideoMaxSize(102400000);
responseVO.setVideoAllowFiles(Arrays.asList(videoAllowFiles)); responseVO.setVideoAllowFiles(Arrays.asList(videoAllowFiles));
responseVO.setFileActionName("uploadfile"); responseVO.setFileActionName("uploadfile");
responseVO.setFileFieldName("upfile"); responseVO.setFileFieldName("upfile");
responseVO.setFilePathFormat("/sharing/file/{time}{rand:6}"); responseVO.setFilePathFormat("/sharing/file/{time}{rand:6}");
responseVO.setFileUrlPrefix(aliOssBucketName); responseVO.setFileUrlPrefix(generateUrl);
responseVO.setFileMaxSize(51200000); responseVO.setFileMaxSize(51200000);
responseVO.setFileAllowFiles(Arrays.asList(fileAllowFiles)); responseVO.setFileAllowFiles(Arrays.asList(fileAllowFiles));
responseVO.setImageManagerActionName("listimage"); responseVO.setImageManagerActionName("listimage");
responseVO.setImageManagerListPath("/sharing/image/"); responseVO.setImageManagerListPath("/sharing/image/");
responseVO.setImageManagerListSize(20); responseVO.setImageManagerListSize(20);
responseVO.setImageManagerUrlPrefix(aliOssBucketName); responseVO.setImageManagerUrlPrefix(generateUrl);
responseVO.setImageManagerInsertAlign("none"); responseVO.setImageManagerInsertAlign("none");
String[] imageManagerAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp"}; String[] imageManagerAllowFiles = new String[]{".png", ".jpg", ".jpeg", ".gif", ".bmp"};
responseVO.setImageManagerAllowFiles(Arrays.asList(imageManagerAllowFiles)); responseVO.setImageManagerAllowFiles(Arrays.asList(imageManagerAllowFiles));
responseVO.setFileManagerActionName("listfile"); responseVO.setFileManagerActionName("listfile");
responseVO.setFileManagerListPath("/sharing/file/"); responseVO.setFileManagerListPath("/sharing/file/");
responseVO.setFileManagerUrlPrefix(aliOssBucketName); responseVO.setFileManagerUrlPrefix(generateUrl);
responseVO.setFileManagerListSize(20); responseVO.setFileManagerListSize(20);
responseVO.setFileManagerAllowFiles(Arrays.asList(fileAllowFiles)); responseVO.setFileManagerAllowFiles(Arrays.asList(fileAllowFiles));
} else if ("uploadimage".equals(action)){ } else if ("uploadimage".equals(action)){
......
...@@ -273,7 +273,8 @@ public class AliOssInterfServiceImpl implements AliOssInterfService { ...@@ -273,7 +273,8 @@ public class AliOssInterfServiceImpl implements AliOssInterfService {
* @param key 对象名 * @param key 对象名
* @return * @return
*/ */
public String generateUrl(String bucketName,String key){ @Override
public String generateUrl(String bucketName, String key){
OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
String url = null; String url = null;
try{ try{
......
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