refactor: flatten service packages
This commit is contained in:
@@ -8,8 +8,8 @@ import com.label.mapper.AnnotationResultMapper;
|
|||||||
import com.label.mapper.TrainingDatasetMapper;
|
import com.label.mapper.TrainingDatasetMapper;
|
||||||
import com.label.entity.SourceData;
|
import com.label.entity.SourceData;
|
||||||
import com.label.mapper.SourceDataMapper;
|
import com.label.mapper.SourceDataMapper;
|
||||||
import com.label.module.task.service.TaskClaimService;
|
import com.label.service.TaskClaimService;
|
||||||
import com.label.module.task.service.TaskService;
|
import com.label.service.TaskService;
|
||||||
import com.label.event.ExtractionApprovedEvent;
|
import com.label.event.ExtractionApprovedEvent;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.label.module.annotation.controller;
|
|||||||
|
|
||||||
import com.label.common.result.Result;
|
import com.label.common.result.Result;
|
||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.module.annotation.service.ExtractionService;
|
import com.label.service.ExtractionService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.label.module.annotation.controller;
|
|||||||
|
|
||||||
import com.label.common.result.Result;
|
import com.label.common.result.Result;
|
||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.module.annotation.service.QaService;
|
import com.label.service.QaService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.label.module.config.controller;
|
|||||||
import com.label.common.result.Result;
|
import com.label.common.result.Result;
|
||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.entity.SysConfig;
|
import com.label.entity.SysConfig;
|
||||||
import com.label.module.config.service.SysConfigService;
|
import com.label.service.SysConfigService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import com.label.common.result.Result;
|
|||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.entity.TrainingDataset;
|
import com.label.entity.TrainingDataset;
|
||||||
import com.label.entity.ExportBatch;
|
import com.label.entity.ExportBatch;
|
||||||
import com.label.module.export.service.ExportService;
|
import com.label.service.ExportService;
|
||||||
import com.label.module.export.service.FinetuneService;
|
import com.label.service.FinetuneService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import com.label.common.result.PageResult;
|
|||||||
import com.label.common.result.Result;
|
import com.label.common.result.Result;
|
||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.dto.SourceResponse;
|
import com.label.dto.SourceResponse;
|
||||||
import com.label.module.source.service.SourceService;
|
import com.label.service.SourceService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import com.label.common.result.PageResult;
|
|||||||
import com.label.common.result.Result;
|
import com.label.common.result.Result;
|
||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.dto.TaskResponse;
|
import com.label.dto.TaskResponse;
|
||||||
import com.label.module.task.service.TaskClaimService;
|
import com.label.service.TaskClaimService;
|
||||||
import com.label.module.task.service.TaskService;
|
import com.label.service.TaskService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.label.common.shiro.TokenPrincipal;
|
|||||||
import com.label.dto.LoginRequest;
|
import com.label.dto.LoginRequest;
|
||||||
import com.label.dto.LoginResponse;
|
import com.label.dto.LoginResponse;
|
||||||
import com.label.dto.UserInfoResponse;
|
import com.label.dto.UserInfoResponse;
|
||||||
import com.label.module.user.service.AuthService;
|
import com.label.service.AuthService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import com.label.common.result.PageResult;
|
|||||||
import com.label.common.result.Result;
|
import com.label.common.result.Result;
|
||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.entity.SysUser;
|
import com.label.entity.SysUser;
|
||||||
import com.label.module.user.service.UserService;
|
import com.label.service.UserService;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.label.module.video.controller;
|
|||||||
import com.label.common.result.Result;
|
import com.label.common.result.Result;
|
||||||
import com.label.common.shiro.TokenPrincipal;
|
import com.label.common.shiro.TokenPrincipal;
|
||||||
import com.label.entity.VideoProcessJob;
|
import com.label.entity.VideoProcessJob;
|
||||||
import com.label.module.video.service.VideoProcessService;
|
import com.label.service.VideoProcessService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.user.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.label.common.exception.BusinessException;
|
import com.label.common.exception.BusinessException;
|
||||||
import com.label.common.redis.RedisKeyManager;
|
import com.label.common.redis.RedisKeyManager;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.export.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.annotation.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@@ -16,7 +16,7 @@ import com.label.entity.SourceData;
|
|||||||
import com.label.mapper.SourceDataMapper;
|
import com.label.mapper.SourceDataMapper;
|
||||||
import com.label.entity.AnnotationTask;
|
import com.label.entity.AnnotationTask;
|
||||||
import com.label.mapper.AnnotationTaskMapper;
|
import com.label.mapper.AnnotationTaskMapper;
|
||||||
import com.label.module.task.service.TaskClaimService;
|
import com.label.service.TaskClaimService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.export.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.label.common.ai.AiServiceClient;
|
import com.label.common.ai.AiServiceClient;
|
||||||
import com.label.common.exception.BusinessException;
|
import com.label.common.exception.BusinessException;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.annotation.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@@ -12,7 +12,7 @@ import com.label.entity.SourceData;
|
|||||||
import com.label.mapper.SourceDataMapper;
|
import com.label.mapper.SourceDataMapper;
|
||||||
import com.label.entity.AnnotationTask;
|
import com.label.entity.AnnotationTask;
|
||||||
import com.label.mapper.AnnotationTaskMapper;
|
import com.label.mapper.AnnotationTaskMapper;
|
||||||
import com.label.module.task.service.TaskClaimService;
|
import com.label.service.TaskClaimService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.source.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.config.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.label.common.exception.BusinessException;
|
import com.label.common.exception.BusinessException;
|
||||||
import com.label.entity.SysConfig;
|
import com.label.entity.SysConfig;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.task.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.label.common.exception.BusinessException;
|
import com.label.common.exception.BusinessException;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.task.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.user.service;
|
package com.label.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.label.module.video.service;
|
package com.label.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.label.common.ai.AiServiceClient;
|
import com.label.common.ai.AiServiceClient;
|
||||||
@@ -62,6 +62,25 @@ class PackageStructureMigrationTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("服务类已迁移到扁平 service 目录")
|
||||||
|
void serviceTypesMoved() {
|
||||||
|
for (String fqcn : java.util.List.of(
|
||||||
|
"com.label.service.ExtractionService",
|
||||||
|
"com.label.service.QaService",
|
||||||
|
"com.label.service.SysConfigService",
|
||||||
|
"com.label.service.ExportService",
|
||||||
|
"com.label.service.FinetuneService",
|
||||||
|
"com.label.service.SourceService",
|
||||||
|
"com.label.service.TaskClaimService",
|
||||||
|
"com.label.service.TaskService",
|
||||||
|
"com.label.service.AuthService",
|
||||||
|
"com.label.service.UserService",
|
||||||
|
"com.label.service.VideoProcessService")) {
|
||||||
|
assertClassExists(fqcn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void assertClassExists(String fqcn) {
|
private static void assertClassExists(String fqcn) {
|
||||||
assertThatCode(() -> Class.forName(fqcn)).doesNotThrowAnyException();
|
assertThatCode(() -> Class.forName(fqcn)).doesNotThrowAnyException();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user