mirror of https://github.com/halo-dev/halo
Refactor migrate api.
parent
fff323ee2c
commit
bf1bea2e97
|
@ -151,6 +151,7 @@ public class HaloConfiguration {
|
||||||
"/api/admin/refresh/*",
|
"/api/admin/refresh/*",
|
||||||
"/api/admin/installations",
|
"/api/admin/installations",
|
||||||
"/api/admin/recoveries/migrations/*",
|
"/api/admin/recoveries/migrations/*",
|
||||||
|
"/api/admin/migrations/*",
|
||||||
"/api/admin/is_installed",
|
"/api/admin/is_installed",
|
||||||
"/api/admin/password/code",
|
"/api/admin/password/code",
|
||||||
"/api/admin/password/reset"
|
"/api/admin/password/reset"
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class InstallController {
|
||||||
@Nullable
|
@Nullable
|
||||||
private Category createDefaultCategoryIfAbsent() {
|
private Category createDefaultCategoryIfAbsent() {
|
||||||
long categoryCount = categoryService.count();
|
long categoryCount = categoryService.count();
|
||||||
if (categoryCount == 0) {
|
if (categoryCount > 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import run.halo.app.service.MigrateService;
|
||||||
* @date 2019-10-29
|
* @date 2019-10-29
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/admin/migrates")
|
@RequestMapping("/api/admin/migrations")
|
||||||
public class MigrateController {
|
public class MigrateController {
|
||||||
|
|
||||||
private final MigrateService migrateService;
|
private final MigrateService migrateService;
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class MigrateHandlers {
|
||||||
for (MigrateHandler migrateHandler : migrateHandlers) {
|
for (MigrateHandler migrateHandler : migrateHandlers) {
|
||||||
if (migrateHandler.supportType(migrateType)) {
|
if (migrateHandler.supportType(migrateType)) {
|
||||||
migrateHandler.migrate(file);
|
migrateHandler.migrate(file);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue