Commit 2f1af6e0 by songxiang

视频课

parent 3b48cfc7
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
package com.pcloud.common.core.constant; package com.pcloud.common.core.constant;
/** /**
* @描述:
* *
* @作者:songx *
* @创建时间:2017年2月27日,下午4:29:06 @版本:1.0 * @author:songx
* @date:2017年2月27日,下午4:29:06
*
* 使用RabbitMQ需要去MqQueueConstant中声明队列名称,枚举的第二个值将不再使用,第一个值正常使用
* modify by songx at 2018-08-22
*/ */
public enum ConvertEnum { public enum ConvertEnum {
...@@ -74,7 +77,12 @@ public enum ConvertEnum { ...@@ -74,7 +77,12 @@ public enum ConvertEnum {
/** /**
* 直播工具 * 直播工具
*/ */
LIVE_APP("LIVE_APP","convert2LiveApp"); LIVE_APP("LIVE_APP", "convert2LiveApp"),
/**
* 视频课
*/
VIDEO_LESSON("VIDEO_LESSON", "convert2VideoLesson");
/** /**
* 值 * 值
......
...@@ -358,6 +358,9 @@ public class AliyunConstant { ...@@ -358,6 +358,9 @@ public class AliyunConstant {
return null; return null;
} }
String domainName = FileUtils.getDomainName(fileUrl); String domainName = FileUtils.getDomainName(fileUrl);
if (domainName == null) {
return INPUT_BUCKET;
}
switch (domainName) { switch (domainName) {
case "file.chubanyun.me": case "file.chubanyun.me":
return DEV_BUCKET; return DEV_BUCKET;
...@@ -371,6 +374,7 @@ public class AliyunConstant { ...@@ -371,6 +374,7 @@ public class AliyunConstant {
case "rays-adviser.chubanyun.me": case "rays-adviser.chubanyun.me":
return IOS_TEST_BUCKET; return IOS_TEST_BUCKET;
case "byfile.1wlshu.com": case "byfile.1wlshu.com":
case "byfile.raysgo.com":
return BY_BUCKET; return BY_BUCKET;
case "file.5rs.me": case "file.5rs.me":
case "oss.5rs.me": case "oss.5rs.me":
......
/**
*
*/
package com.pcloud.common.enums; package com.pcloud.common.enums;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
......
package com.pcloud.common.utils; package com.pcloud.common.utils;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import com.google.common.collect.Lists;
/** /**
* *
* *
...@@ -10,6 +16,8 @@ import org.springframework.beans.BeanUtils; ...@@ -10,6 +16,8 @@ import org.springframework.beans.BeanUtils;
*/ */
public class BeanNewUtils { public class BeanNewUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(BeanNewUtils.class);
/** /**
* 实体类之间的转换 * 实体类之间的转换
* *
...@@ -19,12 +27,38 @@ public class BeanNewUtils { ...@@ -19,12 +27,38 @@ public class BeanNewUtils {
* 目标对象 * 目标对象
* @return * @return
*/ */
public static <T> T copyProperties(Object source, T t) { public static <T> T copyProperties(Object source, Class<T> clazz) {
if (source == null || t == null) { if (source == null) {
return t; return null;
}
T t = null;
try {
t = clazz.newInstance();
} catch (Exception e) {
LOGGER.error("clazz newInstance is error:" + e.getMessage(), e);
} }
BeanUtils.copyProperties(source, t); BeanUtils.copyProperties(source, t);
return t; return t;
} }
/**
* 实体类之间的转换
*
* @param sources
* 来源
* @param clazz
* 目标对象
* @return
*/
public static <T> List<T> copyProperties(List<?> sources, Class<T> clazz) {
if (ListUtils.isEmpty(sources)) {
return null;
}
List<T> results = Lists.newArrayList();
for (Object source : sources) {
results.add(copyProperties(source, clazz));
}
return results;
}
} }
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