diff --git a/udf-starter-file-aliyun-oss-api/pom.xml b/udf-starter-file-aliyun-oss-api/pom.xml
index 2c9d6b3..4c48a66 100644
--- a/udf-starter-file-aliyun-oss-api/pom.xml
+++ b/udf-starter-file-aliyun-oss-api/pom.xml
@@ -20,6 +20,11 @@
org.itkk.udf
udf-starter-core
+
+
+ org.itkk.udf
+ udf-starter-cache-redis
+
com.aliyun.oss
diff --git a/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/OssWarpper.java b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/OssWarpper.java
index 37a66fc..7825437 100644
--- a/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/OssWarpper.java
+++ b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/OssWarpper.java
@@ -182,8 +182,9 @@ public class OssWarpper {
*
* @param code code
* @param file file
+ * @return String
*/
- public void uploadFile(String code, File file) {
+ public String uploadFile(String code, File file) {
//判空
if (!aliyunOssProperties.getAuth().containsKey(code) || !aliyunOssProperties.getPath().containsKey(code)) {
throw new ParameterValidException("aliyun oss code:" + code + "未定义", null);
@@ -194,7 +195,9 @@ public class OssWarpper {
//实例化oss对象
OSSClient client = new OSSClient(auth.getEndPoint(), auth.getAccessId(), auth.getAccessKey());
try {
- client.putObject(path.getBucketName(), file.getName(), file);
+ String objectKey = "upload/" + file.getName();
+ client.putObject(path.getBucketName(), objectKey, file);
+ return objectKey;
} finally {
client.shutdown();
}
diff --git a/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownConstant.java b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownConstant.java
new file mode 100644
index 0000000..7d7a69b
--- /dev/null
+++ b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownConstant.java
@@ -0,0 +1,63 @@
+/**
+ * BaseMqConstant.java
+ * Created at 2016-12-05
+ * Created by Administrator
+ * Copyright (C) 2016 egridcloud.com, All rights reserved.
+ */
+package org.itkk.udf.file.aliyun.oss.api.download;
+
+/**
+ * 描述 : DownConstant
+ *
+ * @author Administrator
+ */
+public class DownConstant {
+
+ /**
+ * 下载状态
+ */
+ public enum DOWNLOAD_PROCESS_STATUS {
+ /**
+ * 执行中
+ */
+ STATUS_1(1),
+ /**
+ * 执行完成
+ */
+ STATUS_2(2),
+ /**
+ * 执行错误
+ */
+ STATUS_3(3);
+
+ /**
+ * value
+ */
+ private Integer value;
+
+ /**
+ * PAY_TYPE
+ *
+ * @param value value
+ */
+ DOWNLOAD_PROCESS_STATUS(Integer value) {
+ this.value = value;
+ }
+
+ /**
+ * value
+ *
+ * @return Integer
+ */
+ public Integer value() {
+ return this.value;
+ }
+ }
+
+ /**
+ * 描述 : 私有化构造函数
+ */
+ private DownConstant() {
+ }
+
+}
diff --git a/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadParam.java b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadParam.java
new file mode 100644
index 0000000..4e1b0d6
--- /dev/null
+++ b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadParam.java
@@ -0,0 +1,38 @@
+/**
+ * Message.java
+ * Created at 2016-09-19
+ * Created by wangkang
+ * Copyright (C) 2016 itkk.org, All rights reserved.
+ */
+package org.itkk.udf.file.aliyun.oss.api.download;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * 描述 : 下载消息
+ *
+ * @author wangkang
+ */
+@Data
+@ToString
+public class DownLoadParam implements Serializable {
+
+ /**
+ * 描述 : id
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 描述 : 消息ID
+ */
+ private String id;
+
+ /**
+ * 描述 : 消息体
+ */
+ private T body; //NOSONAR
+
+}
diff --git a/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadProcessAspect.java b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadProcessAspect.java
new file mode 100644
index 0000000..1920f8c
--- /dev/null
+++ b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadProcessAspect.java
@@ -0,0 +1,97 @@
+/**
+ * RabbitmqListenerAspect.java
+ * Created at 2016-11-17
+ * Created by wangkang
+ * Copyright (C) 2016 itkk.org, All rights reserved.
+ */
+package org.itkk.udf.file.aliyun.oss.api.download;
+
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.itkk.udf.cache.redis.CacheRedisProperties;
+import org.itkk.udf.core.exception.SystemRuntimeException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.annotation.Order;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 描述 : DownLoadProcessAspect
+ *
+ * @author wangkang
+ */
+@Aspect
+@Component
+@Order(101)
+@Slf4j
+public class DownLoadProcessAspect {
+
+ /**
+ * DOWNLOAD_CACHE_PREFIX
+ */
+ public static final String DOWNLOAD_CACHE_PREFIX = ":DOWNLOAD_CACHE:";
+
+ /**
+ * DOWNLOAD_CACHE_EXPIRATION
+ */
+ public static final long DOWNLOAD_CACHE_EXPIRATION = 10;
+
+ /**
+ * redisTemplate
+ */
+ @Autowired
+ private RedisTemplate