mirror of https://github.com/halo-dev/halo
Create getCustomTpl api
parent
fc2349314d
commit
04d75cc10a
|
@ -41,8 +41,9 @@ public class ThemeUtils {
|
|||
/**
|
||||
* Scan themes by directory
|
||||
*
|
||||
* @param file file
|
||||
* @return List<Theme>
|
||||
* @param themesPath themes Path
|
||||
* @param isInternal isInternal
|
||||
* @return themes
|
||||
*/
|
||||
private static List<Theme> getThemesByPath(File themesPath, boolean isInternal) {
|
||||
final List<Theme> themes = new ArrayList<>();
|
||||
|
@ -146,6 +147,7 @@ public class ThemeUtils {
|
|||
/**
|
||||
* Get custom template, such as page_xxx.ftl, and xxx will be template name
|
||||
*
|
||||
* @param theme theme name
|
||||
* @return List
|
||||
*/
|
||||
public static List<String> getCustomTpl(String theme) throws FileNotFoundException {
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package cc.ryanc.halo.web.controller.admin.api;
|
||||
|
||||
import cc.ryanc.halo.model.support.Theme;
|
||||
import cc.ryanc.halo.utils.ThemeUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : RYAN0UP
|
||||
* @date : 2019/3/20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/api/themes")
|
||||
public class ThemeController {
|
||||
|
||||
/**
|
||||
* List all themes
|
||||
*
|
||||
* @return themes
|
||||
*/
|
||||
@GetMapping
|
||||
@ApiOperation("List all themes")
|
||||
public List<Theme> listAll() {
|
||||
return ThemeUtils.getThemes();
|
||||
}
|
||||
}
|
|
@ -162,7 +162,7 @@ public class InstallController {
|
|||
// TODO and i18n for the category name, description
|
||||
|
||||
category.setName("Initial Blog");
|
||||
category.setSnakeName("initial_blog");
|
||||
category.setSlugName("initial_blog");
|
||||
category.setDescription("Initial Blog for alphabet");
|
||||
return categoryService.create(category);
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ public class InstallController {
|
|||
//默认分类
|
||||
Category category = new Category();
|
||||
category.setName("未分类");
|
||||
category.setSnakeName("default");
|
||||
category.setSlugName("default");
|
||||
category.setDescription("未分类");
|
||||
category = categoryService.create(category);
|
||||
|
||||
|
|
Loading…
Reference in New Issue