All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.haoxuer.discover.web.data.common.InitConfig Maven / Gradle / Ivy

There is a newer version: 3.3.18-20230117
Show newest version
package com.haoxuer.discover.web.data.common;

import com.haoxuer.discover.web.data.entity.WebConfig;
import com.haoxuer.discover.web.data.service.WebConfigService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 网站配置初始化.
 */
public class InitConfig {
  
  @Autowired
  private WebConfigService webConfigMapper;
  
  private static WebConfig webConfig;
  
  
  public void initWebConfig() {
    webConfig = webConfigMapper.config();
  }
  
  public static WebConfig getWebConfig() {
    if (webConfig == null) {
      webConfig = new WebConfig();
      webConfig.setTheme("default");
      webConfig.setAdminTheme("default");
    }
    return webConfig;
  }
  
  public static void setWebConfig(WebConfig webConfig) {
    InitConfig.webConfig = webConfig;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy