Fix theme activation bug

pull/146/head
johnniang 2019-04-20 21:20:25 +08:00
parent ea761fa73f
commit 175739dbd4
4 changed files with 5 additions and 4 deletions

View File

@ -19,8 +19,8 @@ import java.util.Map;
* @author johnniang
* @date 19-4-20
*/
@Component
@Slf4j
@Component
public class FreemarkerConfigAwareListener {
private final OptionService optionService;

View File

@ -210,7 +210,7 @@ public interface ThemeService {
* @return theme property
*/
@NonNull
ThemeProperty activeTheme(@NonNull String themeId);
ThemeProperty activateTheme(@NonNull String themeId);
/**
* Upload theme.

View File

@ -316,7 +316,7 @@ public class ThemeServiceImpl implements ThemeService {
}
@Override
public ThemeProperty activeTheme(String themeId) {
public ThemeProperty activateTheme(String themeId) {
// Check existence of the theme
ThemeProperty themeProperty = getThemeOfNonNullBy(themeId);
@ -508,6 +508,7 @@ public class ThemeServiceImpl implements ThemeService {
*/
private void setActivatedTheme(@Nullable ThemeProperty activatedTheme) {
this.activatedTheme = activatedTheme;
this.activatedThemeId = activatedTheme.getId();
}
/**

View File

@ -71,7 +71,7 @@ public class ThemeController {
@PostMapping("{themeId}/activation")
@ApiOperation("Activates a theme")
public ThemeProperty active(@PathVariable("themeId") String themeId) {
return themeService.activeTheme(themeId);
return themeService.activateTheme(themeId);
}
@GetMapping("activation")