TASK:aida;
This commit is contained in:
@@ -4,6 +4,7 @@ import com.ai.da.common.utils.MinioUtil;
|
||||
import com.ai.da.common.utils.SendEmailUtil;
|
||||
import com.ai.da.mapper.primary.*;
|
||||
import com.ai.da.mapper.primary.entity.*;
|
||||
import com.ai.da.mapper.secondary.AttributeRetrievalMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
@@ -17,10 +18,13 @@ import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -205,4 +209,32 @@ public class MyTaskScheduler {
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Resource
|
||||
private AttributeRetrievalMapper attributeRetrievalMapper;
|
||||
|
||||
public void addSystemFileStyle() {
|
||||
String directoryPath = "C:\\Users\\10233\\Downloads\\blouse done\\blouse done\\废土风";
|
||||
List<String> fileNames = getFileNames(directoryPath);
|
||||
for (String fileName : fileNames) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getFileNames(String directoryPath) {
|
||||
List<String> fileNames = new ArrayList<>();
|
||||
Path path = Paths.get(directoryPath);
|
||||
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {
|
||||
for (Path entry : stream) {
|
||||
if (Files.isRegularFile(entry)) {
|
||||
fileNames.add(entry.getFileName().toString());
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println("Error reading directory: " + e.getMessage());
|
||||
}
|
||||
|
||||
return fileNames;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
||||
"/api/third/party/addNoLoginRequiredNew","/api/third/party/deleteNoLoginRequiredNew",
|
||||
"/api/third/party/existNoLoginRequired","/api/third/party/getRedirectUrl",
|
||||
"/api/python/flush","/api/account/healthy","/api/ali-pay/trade/notify","/api/paypal/ipn/back","/api/alipay-hk/trade/notify",
|
||||
"/api/portfolio/page", "/api/portfolio/detail",
|
||||
"/api/portfolio/page", "/api/portfolio/detail", "/api/portfolio/commentPage", "/api/portfolio/viewsIncrease",
|
||||
"/api/account/designWorksRegister"
|
||||
);
|
||||
|
||||
|
||||
@@ -200,4 +200,17 @@ public class RedisUtil {
|
||||
Boolean isMember = redisTemplate.opsForSet().isMember(key, userId.toString());
|
||||
return isMember != null && isMember;
|
||||
}
|
||||
|
||||
public final static String PORTFOLIO_VIEW_KEY = "portfolio:view:";
|
||||
|
||||
public void increaseViewCount(Long portfolioId) {
|
||||
String key = PORTFOLIO_VIEW_KEY + portfolioId;
|
||||
redisTemplate.opsForValue().increment(key);
|
||||
}
|
||||
|
||||
public Long getViewCount(Long portfolioId) {
|
||||
String key = PORTFOLIO_VIEW_KEY + portfolioId;
|
||||
return redisTemplate.opsForValue().increment(key, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user