diff --git a/src/main/java/run/halo/app/controller/content/api/ThemeController.java b/src/main/java/run/halo/app/controller/content/api/ThemeController.java index 927ab861be..8af4d2dc10 100644 --- a/src/main/java/run/halo/app/controller/content/api/ThemeController.java +++ b/src/main/java/run/halo/app/controller/content/api/ThemeController.java @@ -3,6 +3,7 @@ import io.swagger.annotations.ApiOperation; import java.util.Map; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import run.halo.app.handler.theme.config.support.ThemeProperty; @@ -34,9 +35,21 @@ public ThemeProperty getBy() { return themeService.getThemeOfNonNullBy(themeService.getActivatedThemeId()); } + @GetMapping("{themeId:.+}") + @ApiOperation("Gets theme property by theme id") + public ThemeProperty getBy(@PathVariable("themeId") String themeId) { + return themeService.getThemeOfNonNullBy(themeId); + } + @GetMapping("activation/settings") @ApiOperation("Lists activated theme settings") public Map listSettingsBy() { return themeSettingService.listAsMapBy(themeService.getActivatedThemeId()); } + + @GetMapping("{themeId:.+}/settings") + @ApiOperation("Lists theme settings by theme id") + public Map listSettingsBy(@PathVariable("themeId") String themeId) { + return themeSettingService.listAsMapBy(themeId); + } }