From 144530c319d69385d18c0116800262009d6ae417 Mon Sep 17 00:00:00 2001 From: wangkang Date: Tue, 19 Dec 2017 11:38:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8B=E8=BD=BD=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliyun/oss/api/download/DownLoadProcessService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadProcessService.java b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadProcessService.java index 5b76edb..6e3b540 100644 --- a/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadProcessService.java +++ b/udf-starter-file-aliyun-oss-api/src/main/java/org/itkk/udf/file/aliyun/oss/api/download/DownLoadProcessService.java @@ -1,6 +1,7 @@ package org.itkk.udf.file.aliyun.oss.api.download; import org.itkk.udf.cache.redis.CacheRedisProperties; +import org.itkk.udf.core.exception.ParameterValidException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; @@ -29,9 +30,14 @@ public class DownLoadProcessService { /** * generateDownLoadId * + * @param count count * @return String */ - public String generateDownLoadId() { + public String generateDownLoadId(long count) { + //判断行数 + if (count > DownConstant.MAX_DOWNLOAD_ROW_COUNT) { + throw new ParameterValidException("导出行数不能超过" + DownConstant.MAX_DOWNLOAD_ROW_COUNT + "行", null); + } //生成ID String id = UUID.randomUUID().toString(); //获得key