diff --git a/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java index f002008..9415d12 100644 --- a/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java +++ b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java @@ -1,6 +1,5 @@ package com.bnyer.file.controller; -import cn.hutool.log.Log; import com.bnyer.common.core.domain.R; import com.bnyer.file.config.ImgConfig; import com.bnyer.file.dto.FileDto; @@ -20,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; diff --git a/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/service/impl/FileServiceImpl.java b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/service/impl/FileServiceImpl.java index f3764f8..62d0450 100644 --- a/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/service/impl/FileServiceImpl.java +++ b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/service/impl/FileServiceImpl.java @@ -9,10 +9,8 @@ import com.bnyer.file.service.IQiniuService; import com.bnyer.file.service.ITikTokImage; import com.bnyer.file.utils.ImgUtil; import com.bnyer.file.vo.ChekFileVo; -import com.bnyer.file.vo.TiktokImgVo; import com.bnyer.img.api.RemoteImgService; import com.bnyer.img.api.dto.TiktokImgMiniDto; -import com.bnyer.system.api.RemoteFileService; import lombok.extern.slf4j.Slf4j; import org.apache.http.entity.ContentType; import org.springframework.beans.factory.annotation.Autowired; @@ -21,14 +19,12 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; -import javax.annotation.Resource; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; -import java.util.UUID; /** * @Author: Yeman @@ -89,7 +85,7 @@ public class FileServiceImpl implements IFileService { @Override @Async("mySimpleAsync") public void checkUploadSave(FileUploadDto fileUploadDto) throws IOException { - //redis累计平台用户当天下载次数,12.00后过期 + //redis累计艺术家当天上传次数,12.00后过期 writeUploadTotalNum(fileUploadDto.getCreatorId()); ArrayList multipartFiles = new ArrayList<>(); for (FileDto fileDto : fileUploadDto.getFiles()) { @@ -116,7 +112,7 @@ public class FileServiceImpl implements IFileService { public void writeUploadTotalNum(Long creatorId) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String date = df.format(new Date()); - log.info("日期【{}】艺术家【{}】下载数+1",date,creatorId); + log.info("日期【{}】艺术家【{}】上传数+1",date,creatorId); String redisKey = RedisKeyConstant.CREATOR_UPLOAD_KEY + date; redisService.hashIncr(redisKey, creatorId.toString(), 1); } diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/constants/RedisKeyConstant.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/constants/RedisKeyConstant.java index a563643..e5c7bd3 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/constants/RedisKeyConstant.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/constants/RedisKeyConstant.java @@ -100,5 +100,5 @@ public class RedisKeyConstant { /** * 艺术家上传键 */ - public static final String CREATOR_DOWNLOAD_KEY="bnyer.img.createor.download"; + public static final String CREATOR_UPLOAD_KEY="bnyer.img.creator.upload:"; } diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/CreatorProfitService.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/CreatorProfitService.java index 0a63269..c7f2231 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/CreatorProfitService.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/CreatorProfitService.java @@ -205,5 +205,5 @@ public interface CreatorProfitService { /** * 批量删除昨日艺术家上传次数 */ - void batchDeleteCreatorDownloadNum(); + void batchDeleteCreatorUploadNum(); } diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java index 35c6af1..d24b87c 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java @@ -389,9 +389,9 @@ public class CreatorProfitServiceImpl implements CreatorProfitService { public boolean checkCreatorCanUpload(Long creatorId) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String date = df.format(new Date()); - String redisKey = RedisKeyConstant.CREATOR_DOWNLOAD_KEY + date; + String redisKey = RedisKeyConstant.CREATOR_UPLOAD_KEY + date; if (redisService.hasHashKey(redisKey, creatorId.toString())) { - //存在键,判断次数,次数达标则不可下载 + //存在键,判断次数,次数达标则不可上传 Integer downloadNum = redisService.getCacheMapValue(redisKey, creatorId.toString()); if (downloadNum >= 40) { return true; @@ -405,14 +405,14 @@ public class CreatorProfitServiceImpl implements CreatorProfitService { } @Override - public void batchDeleteCreatorDownloadNum() { + public void batchDeleteCreatorUploadNum() { log.info("==============批量删除昨日艺术家上传次数开始!==============="); long startTime = System.currentTimeMillis(); //获取昨日日期 Date yesterday = new Date(startTime - 1000 * 60 * 60 * 24); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); String date = simpleDateFormat.format(yesterday); - String redisKey = RedisKeyConstant.CREATOR_DOWNLOAD_KEY + date; + String redisKey = RedisKeyConstant.CREATOR_UPLOAD_KEY + date; if(redisService.hasKey(redisKey)){ redisService.deleteObject(redisKey); } diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/UserDownloadSyncTask.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/UserDownloadSyncTask.java index e682b71..7b51221 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/UserDownloadSyncTask.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/UserDownloadSyncTask.java @@ -28,9 +28,9 @@ public class UserDownloadSyncTask { } @XxlJob("creatorDownloadSyncTask") - public ReturnT syncCreatorDownload(String param) throws Exception { - creatorProfitService.batchDeleteCreatorDownloadNum(); - XxlJobLogger.log("{} 我执行了批量删除昨日用户下载次数任务", System.currentTimeMillis()); + public ReturnT syncCreatorUpload(String param) throws Exception { + creatorProfitService.batchDeleteCreatorUploadNum(); + XxlJobLogger.log("{} 我执行了批量删除昨日用户上传次数任务", System.currentTimeMillis()); return ReturnT.SUCCESS; } }