refactor: flatten controller packages

This commit is contained in:
wh
2026-04-14 13:47:38 +08:00
parent ef1e4f5106
commit ba42b6f50e
11 changed files with 35 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
package com.label.module.user.controller;
package com.label.controller;
import com.label.common.result.Result;
import com.label.common.shiro.TokenPrincipal;

View File

@@ -1,4 +1,4 @@
package com.label.module.export.controller;
package com.label.controller;
import com.label.common.result.PageResult;
import com.label.common.result.Result;

View File

@@ -1,4 +1,4 @@
package com.label.module.annotation.controller;
package com.label.controller;
import com.label.common.result.Result;
import com.label.common.shiro.TokenPrincipal;

View File

@@ -1,4 +1,4 @@
package com.label.module.annotation.controller;
package com.label.controller;
import com.label.common.result.Result;
import com.label.common.shiro.TokenPrincipal;

View File

@@ -1,4 +1,4 @@
package com.label.module.source.controller;
package com.label.controller;
import com.label.common.result.PageResult;
import com.label.common.result.Result;

View File

@@ -1,4 +1,4 @@
package com.label.module.config.controller;
package com.label.controller;
import com.label.common.result.Result;
import com.label.common.shiro.TokenPrincipal;

View File

@@ -1,4 +1,4 @@
package com.label.module.task.controller;
package com.label.controller;
import com.label.common.result.PageResult;
import com.label.common.result.Result;

View File

@@ -1,4 +1,4 @@
package com.label.module.user.controller;
package com.label.controller;
import java.util.Map;

View File

@@ -1,4 +1,4 @@
package com.label.module.video.controller;
package com.label.controller;
import com.label.common.result.Result;
import com.label.common.shiro.TokenPrincipal;

View File

@@ -1,19 +1,19 @@
package com.label.unit;
import com.label.module.annotation.controller.ExtractionController;
import com.label.module.annotation.controller.QaController;
import com.label.module.config.controller.SysConfigController;
import com.label.module.export.controller.ExportController;
import com.label.module.source.controller.SourceController;
import com.label.controller.AuthController;
import com.label.controller.ExportController;
import com.label.controller.ExtractionController;
import com.label.controller.QaController;
import com.label.controller.SourceController;
import com.label.controller.SysConfigController;
import com.label.controller.TaskController;
import com.label.controller.UserController;
import com.label.controller.VideoController;
import com.label.dto.SourceResponse;
import com.label.module.task.controller.TaskController;
import com.label.dto.TaskResponse;
import com.label.module.user.controller.AuthController;
import com.label.module.user.controller.UserController;
import com.label.dto.LoginRequest;
import com.label.dto.LoginResponse;
import com.label.dto.UserInfoResponse;
import com.label.module.video.controller.VideoController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@@ -81,6 +81,23 @@ class PackageStructureMigrationTest {
}
}
@Test
@DisplayName("控制器类已迁移到扁平 controller 目录")
void controllerTypesMoved() {
for (String fqcn : java.util.List.of(
"com.label.controller.AuthController",
"com.label.controller.UserController",
"com.label.controller.SourceController",
"com.label.controller.TaskController",
"com.label.controller.ExtractionController",
"com.label.controller.QaController",
"com.label.controller.ExportController",
"com.label.controller.SysConfigController",
"com.label.controller.VideoController")) {
assertClassExists(fqcn);
}
}
private static void assertClassExists(String fqcn) {
assertThatCode(() -> Class.forName(fqcn)).doesNotThrowAnyException();
}