Skip to content

Commit

Permalink
Add APIs to fetch theme info and settings according to the theme id (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
guqing authored and winar-jin committed Mar 24, 2022
1 parent 108de89 commit 3093f88
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, Object> listSettingsBy() {
return themeSettingService.listAsMapBy(themeService.getActivatedThemeId());
}

@GetMapping("{themeId:.+}/settings")
@ApiOperation("Lists theme settings by theme id")
public Map<String, Object> listSettingsBy(@PathVariable("themeId") String themeId) {
return themeSettingService.listAsMapBy(themeId);
}
}

0 comments on commit 3093f88

Please sign in to comment.