|
@@ -1,11 +1,14 @@
|
|
package com.ssj.framework.basic.config.service.impl;
|
|
package com.ssj.framework.basic.config.service.impl;
|
|
|
|
|
|
import com.ssj.framework.basic.config.bean.Config;
|
|
import com.ssj.framework.basic.config.bean.Config;
|
|
|
|
+import com.ssj.framework.basic.config.bean.VersionConfig;
|
|
import com.ssj.framework.basic.config.dao.ConfigDao;
|
|
import com.ssj.framework.basic.config.dao.ConfigDao;
|
|
import com.ssj.framework.basic.config.service.ConfigService;
|
|
import com.ssj.framework.basic.config.service.ConfigService;
|
|
import com.ssj.framework.core.common.service.BaseServiceImpl;
|
|
import com.ssj.framework.core.common.service.BaseServiceImpl;
|
|
import com.ssj.framework.core.persistence.DynamicSpecifications;
|
|
import com.ssj.framework.core.persistence.DynamicSpecifications;
|
|
import com.ssj.framework.core.persistence.SearchFilter;
|
|
import com.ssj.framework.core.persistence.SearchFilter;
|
|
|
|
+import com.ssj.framework.core.security.manager.TokenManager;
|
|
|
|
+import com.ssj.framework.core.util.SystemResourceLocator;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
@@ -32,6 +35,21 @@ public class ConfigServiceImpl extends BaseServiceImpl<Config, String> implement
|
|
@Autowired
|
|
@Autowired
|
|
public ConfigDao configDao;
|
|
public ConfigDao configDao;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TokenManager tokenManager;
|
|
|
|
+ /**
|
|
|
|
+ * 数学
|
|
|
|
+ */
|
|
|
|
+ private static String versionKey1="VERSION_M";
|
|
|
|
+ /**
|
|
|
|
+ * 语文
|
|
|
|
+ */
|
|
|
|
+ private static String versionKey2="VERSION_C";
|
|
|
|
+ /**
|
|
|
|
+ * 英语
|
|
|
|
+ */
|
|
|
|
+ private static String versionKey3="VERSION_E";
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public PagingAndSortingRepository<Config, String> getDao() {
|
|
public PagingAndSortingRepository<Config, String> getDao() {
|
|
return configDao;
|
|
return configDao;
|
|
@@ -105,4 +123,23 @@ public class ConfigServiceImpl extends BaseServiceImpl<Config, String> implement
|
|
public Config findConfigByParamCode(String paramCode) {
|
|
public Config findConfigByParamCode(String paramCode) {
|
|
return configDao.findByParamCode(paramCode);
|
|
return configDao.findByParamCode(paramCode);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void refushCache(String paramCode) {
|
|
|
|
+ String courseName = getCourseName(paramCode);
|
|
|
|
+ Map<String,List<VersionConfig>> map = SystemResourceLocator.getVersionList(courseName);
|
|
|
|
+ List<VersionConfig> list = map.get(courseName);
|
|
|
|
+// tokenManager.hset(courseName,courseName,list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private String getCourseName(String paramCode){
|
|
|
|
+ if(paramCode.contains(versionKey2)){
|
|
|
|
+ return "语文";
|
|
|
|
+ }else if(paramCode.contains(versionKey1)){
|
|
|
|
+ return "数学";
|
|
|
|
+ }else{
|
|
|
|
+ return "英语";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|