Commit 63faedb0 authored by yanzg's avatar yanzg

表结构修改

parent 86ff61e9
...@@ -90,4 +90,16 @@ public class TypeHelper { ...@@ -90,4 +90,16 @@ public class TypeHelper {
System.out.println(returnType.getName()); System.out.println(returnType.getName());
printSuperClass(returnType.getSuperclass()); printSuperClass(returnType.getSuperclass());
} }
/**
* 获取代理类名称
* @param className 当前代理类名
* @return 普通类名称
*/
public static String getProxyClassName(String className){
if(StringHelper.isEmpty(className)){
return className;
}
return className.split("\\$")[0];
}
} }
...@@ -5,6 +5,7 @@ import com.yanzuoguang.util.YzgError; ...@@ -5,6 +5,7 @@ import com.yanzuoguang.util.YzgError;
import com.yanzuoguang.util.helper.TypeHelper; import com.yanzuoguang.util.helper.TypeHelper;
import com.yanzuoguang.util.vo.ResponseResult; import com.yanzuoguang.util.vo.ResponseResult;
import helper.vo.ResponseDataMainResult; import helper.vo.ResponseDataMainResult;
import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import java.lang.reflect.Method; import java.lang.reflect.Method;
...@@ -27,4 +28,15 @@ public class TestTypeHelper { ...@@ -27,4 +28,15 @@ public class TestTypeHelper {
throw YzgError.getRuntimeException("004"); throw YzgError.getRuntimeException("004");
} }
} }
@Test
public void testClassName() {
String commonClassName = "com.tourbida.store.other1949.plan.StorePlanSceneService";
String proxyClassName = TypeHelper.getProxyClassName("com.tourbida.store.other1949.plan.StorePlanSceneService$$EnhancerBySpringCGLIB$$18231bee");
Assert.assertEquals(commonClassName, proxyClassName);
String commonToClassName = TypeHelper.getProxyClassName(commonClassName);
Assert.assertEquals(commonClassName, commonToClassName);
}
} }
...@@ -10,6 +10,7 @@ import com.yanzuoguang.redis.mq.PlanProcedure; ...@@ -10,6 +10,7 @@ import com.yanzuoguang.redis.mq.PlanProcedure;
import com.yanzuoguang.redis.vo.PlanConfigVo; import com.yanzuoguang.redis.vo.PlanConfigVo;
import com.yanzuoguang.redis.vo.PlanLevelType; import com.yanzuoguang.redis.vo.PlanLevelType;
import com.yanzuoguang.util.helper.StringHelper; import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.helper.TypeHelper;
import com.yanzuoguang.util.helper.YzgTimeout; import com.yanzuoguang.util.helper.YzgTimeout;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -158,6 +159,7 @@ public class PlanService { ...@@ -158,6 +159,7 @@ public class PlanService {
private String getCacheKey(PlanConfigVo config, String key) { private String getCacheKey(PlanConfigVo config, String key) {
PlanLevelNamespace planLevelNamespace = config.getPlanLevelNamespace(); PlanLevelNamespace planLevelNamespace = config.getPlanLevelNamespace();
PlanLevelType level = planLevelNamespace.getLevel(); PlanLevelType level = planLevelNamespace.getLevel();
String toKey = TypeHelper.getProxyClassName(key);
return StringHelper.getId(level.getName(), planLevelNamespace.getLevelNamespace(), key); return StringHelper.getId(level.getName(), planLevelNamespace.getLevelNamespace(), key);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment