项目结构类名称优化

This commit is contained in:
wh
2026-04-14 15:26:08 +08:00
parent ceaac48051
commit 158873d5ae
14 changed files with 61 additions and 60 deletions

View File

@@ -2,7 +2,7 @@ package com.label.integration;
import com.label.AbstractIntegrationTest;
import com.label.service.RedisService;
import com.label.util.RedisKeyManager;
import com.label.util.RedisUtil;
import org.junit.jupiter.api.*;
import org.springframework.beans.factory.annotation.Autowired;
@@ -61,7 +61,7 @@ public class TaskClaimConcurrencyTest extends AbstractIntegrationTest {
tokens.add(token);
// 所有 Token 使用 userId=3annotator01这在真实场景不会发生
// 但在测试中用于验证并发锁机制redis key 基于 taskId不是 userId
redisService.hSetAll(RedisKeyManager.tokenKey(token),
redisService.hSetAll(RedisUtil.tokenKey(token),
Map.of("userId", String.valueOf(i + 100), // 假设 userId > 100 不存在,但不影响锁逻辑
"role", "ANNOTATOR", "companyId", "1", "username", "annotator" + i),
3600L);
@@ -70,9 +70,9 @@ public class TaskClaimConcurrencyTest extends AbstractIntegrationTest {
@AfterEach
void cleanup() {
tokens.forEach(token -> redisService.delete(RedisKeyManager.tokenKey(token)));
tokens.forEach(token -> redisService.delete(RedisUtil.tokenKey(token)));
if (taskId != null) {
redisService.delete(RedisKeyManager.taskClaimKey(taskId));
redisService.delete(RedisUtil.taskClaimKey(taskId));
}
}