Create getCustomTpl api

pull/137/head
ruibaby 2019-03-20 11:04:16 +08:00
parent fc2349314d
commit 04d75cc10a
3 changed files with 6 additions and 34 deletions

View File

@ -41,8 +41,9 @@ public class ThemeUtils {
/** /**
* Scan themes by directory * Scan themes by directory
* *
* @param file file * @param themesPath themes Path
* @return List<Theme> * @param isInternal isInternal
* @return themes
*/ */
private static List<Theme> getThemesByPath(File themesPath, boolean isInternal) { private static List<Theme> getThemesByPath(File themesPath, boolean isInternal) {
final List<Theme> themes = new ArrayList<>(); 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 * Get custom template, such as page_xxx.ftl, and xxx will be template name
* *
* @param theme theme name
* @return List * @return List
*/ */
public static List<String> getCustomTpl(String theme) throws FileNotFoundException { public static List<String> getCustomTpl(String theme) throws FileNotFoundException {

View File

@ -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();
}
}

View File

@ -162,7 +162,7 @@ public class InstallController {
// TODO and i18n for the category name, description // TODO and i18n for the category name, description
category.setName("Initial Blog"); category.setName("Initial Blog");
category.setSnakeName("initial_blog"); category.setSlugName("initial_blog");
category.setDescription("Initial Blog for alphabet"); category.setDescription("Initial Blog for alphabet");
return categoryService.create(category); return categoryService.create(category);
} }
@ -236,7 +236,7 @@ public class InstallController {
//默认分类 //默认分类
Category category = new Category(); Category category = new Category();
category.setName("未分类"); category.setName("未分类");
category.setSnakeName("default"); category.setSlugName("default");
category.setDescription("未分类"); category.setDescription("未分类");
category = categoryService.create(category); category = categoryService.create(category);