From ebac070632dcb279ee7697d90aa1cba282a10484 Mon Sep 17 00:00:00 2001 From: yongfeng <2283865573@qq.com> Date: Thu, 14 Nov 2024 21:32:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=96=E7=95=A5=E6=A6=82=E7=8E=87=E8=A3=85?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/uiDesigner.xml | 124 +++++++++ pom.xml | 5 + .../data/log/log-error-2024-11-13.0.log | 196 ++++++++++++++ .../data/log/log-info-2024-11-13.0.log | 221 +++++++++++++++ xfg-frame-archetype-lite-app/pom.xml | 4 + .../cn/bugstack/config/RedisClientConfig.java | 85 ++++++ .../config/RedisClientConfigProperties.java | 40 +++ .../src/main/resources/application-dev.yml | 15 ++ .../resources/mybatis/mapper/award_mapper.xml | 4 +- .../mybatis/mapper/strategy_award_mapper.xml | 9 +- .../mybatis/mapper/strategy_mapper.xml | 4 +- .../mybatis/mapper/strategy_rule_mapper.xml | 4 +- .../test/domain/StrategyArmoryTest.java | 42 +++ .../test/infrastructure/AwardDaoTest.java | 4 +- .../strategy/model/entity/AwardEntity.java | 27 ++ .../model/entity/StrategyAwardEntity.java | 32 +++ .../model/entity/StrategyConditionEntity.java | 24 ++ .../repository/IStrategyRepository.java | 17 ++ .../service/armory/IStrategyArmory.java | 21 ++ .../service/armory/StrategyArmory.java | 77 ++++++ .../pom.xml | 4 + .../infrastructure/dao/IStrategyAwardDao.java | 10 - .../{ => persistent}/dao/IAwardDao.java | 4 +- .../persistent/dao/IStrategyAwardDao.java | 15 ++ .../{ => persistent}/dao/IStrategyDao.java | 4 +- .../dao/IStrategyRuleDao.java | 4 +- .../{dao => persistent}/po/Award.java | 2 +- .../{dao => persistent}/po/Strategy.java | 2 +- .../{dao => persistent}/po/StrategyAward.java | 2 +- .../{dao => persistent}/po/StrategyRule.java | 2 +- .../persistent/redis/IRedisService.java | 251 ++++++++++++++++++ .../persistent/redis/RedissonService.java | 161 +++++++++++ .../repository/StrategyRepository.java | 76 ++++++ .../infrastructure/redis/package-info.java | 4 - .../cn/bugstack/types/common/Constants.java | 7 + 35 files changed, 1469 insertions(+), 34 deletions(-) create mode 100644 .idea/uiDesigner.xml create mode 100644 xfg-frame-archetype-lite-app/data/log/log-error-2024-11-13.0.log create mode 100644 xfg-frame-archetype-lite-app/data/log/log-info-2024-11-13.0.log create mode 100644 xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfig.java create mode 100644 xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfigProperties.java create mode 100644 xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/domain/StrategyArmoryTest.java create mode 100644 xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/AwardEntity.java create mode 100644 xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyAwardEntity.java create mode 100644 xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyConditionEntity.java create mode 100644 xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/repository/IStrategyRepository.java create mode 100644 xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/IStrategyArmory.java create mode 100644 xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/StrategyArmory.java delete mode 100644 xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyAwardDao.java rename xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/{ => persistent}/dao/IAwardDao.java (57%) create mode 100644 xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyAwardDao.java rename xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/{ => persistent}/dao/IStrategyDao.java (58%) rename xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/{ => persistent}/dao/IStrategyRuleDao.java (59%) rename xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/{dao => persistent}/po/Award.java (92%) rename xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/{dao => persistent}/po/Strategy.java (89%) rename xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/{dao => persistent}/po/StrategyAward.java (95%) rename xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/{dao => persistent}/po/StrategyRule.java (94%) create mode 100644 xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/IRedisService.java create mode 100644 xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/RedissonService.java create mode 100644 xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/repository/StrategyRepository.java delete mode 100644 xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/redis/package-info.java diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index e595274..b925ba3 100644 --- a/pom.xml +++ b/pom.xml @@ -101,6 +101,11 @@ commons-codec 1.15 + + org.redisson + redisson-spring-boot-starter + 3.23.4 + diff --git a/xfg-frame-archetype-lite-app/data/log/log-error-2024-11-13.0.log b/xfg-frame-archetype-lite-app/data/log/log-error-2024-11-13.0.log new file mode 100644 index 0000000..e81127a --- /dev/null +++ b/xfg-frame-archetype-lite-app/data/log/log-error-2024-11-13.0.log @@ -0,0 +1,196 @@ +24-11-13.22:15:50.764 [main ] ERROR HikariPool - HikariPool-1 - Exception during pool initialization. +java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906) + at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831) + at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456) + at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) + at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) + at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) + at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) + at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) + at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) + at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) + at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) + at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) + at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159) + at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117) + at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) + at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:337) + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86) + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) + at com.sun.proxy.$Proxy79.selectList(Unknown Source) + at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) + at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) + at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) + at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) + at com.sun.proxy.$Proxy82.queryAwardList(Unknown Source) + at cn.bugstack.test.infrastructure.AwardDaoTest.Test_queryAwardList(AwardDaoTest.java:31) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) + at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) + at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) + at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) + at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) + at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) + at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) + at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) + at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) + at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) + at org.junit.runners.ParentRunner.run(ParentRunner.java:413) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) + at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) + at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) + at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) + at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) + at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) +Caused by: com.mysql.cj.exceptions.CJException: Unknown database 'big_market' + at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) + at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) + at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) + at java.lang.reflect.Constructor.newInstance(Constructor.java:423) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:792) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:717) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:685) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:134) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:469) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174) + at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) + at com.mysql.cj.NativeSession.connect(NativeSession.java:157) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850) + ... 71 common frames omitted +24-11-13.22:17:02.261 [main ] ERROR HikariPool - HikariPool-1 - Exception during pool initialization. +java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906) + at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831) + at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456) + at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) + at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) + at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) + at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) + at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) + at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) + at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) + at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) + at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) + at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159) + at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117) + at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) + at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:337) + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86) + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) + at com.sun.proxy.$Proxy79.selectList(Unknown Source) + at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) + at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) + at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) + at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) + at com.sun.proxy.$Proxy82.queryAwardList(Unknown Source) + at cn.bugstack.test.infrastructure.AwardDaoTest.Test_queryAwardList(AwardDaoTest.java:31) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) + at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) + at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) + at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) + at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) + at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) + at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) + at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) + at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) + at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) + at org.junit.runners.ParentRunner.run(ParentRunner.java:413) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) + at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) + at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) + at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) + at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) + at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) +Caused by: com.mysql.cj.exceptions.CJException: Unknown database 'big_market' + at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) + at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) + at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) + at java.lang.reflect.Constructor.newInstance(Constructor.java:423) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:792) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:717) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:685) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:134) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:469) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174) + at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) + at com.mysql.cj.NativeSession.connect(NativeSession.java:157) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850) + ... 71 common frames omitted diff --git a/xfg-frame-archetype-lite-app/data/log/log-info-2024-11-13.0.log b/xfg-frame-archetype-lite-app/data/log/log-info-2024-11-13.0.log new file mode 100644 index 0000000..4bc6711 --- /dev/null +++ b/xfg-frame-archetype-lite-app/data/log/log-info-2024-11-13.0.log @@ -0,0 +1,221 @@ +24-11-13.21:47:44.554 [main ] INFO AwardDaoTest - Starting AwardDaoTest using Java 1.8.0_412 on zhaoyongfeng with PID 23628 (started by zhaoyongfeng in C:\Users\31126\Desktop\study\xfg-frame-archetype-lite\xfg-frame-archetype-lite-app) +24-11-13.21:47:44.556 [main ] INFO AwardDaoTest - The following 1 profile is active: "dev" +24-11-13.21:47:47.348 [main ] INFO AwardDaoTest - Started AwardDaoTest in 3.388 seconds (JVM running for 4.48) +24-11-13.22:01:33.005 [main ] INFO AwardDaoTest - Starting AwardDaoTest using Java 1.8.0_412 on zhaoyongfeng with PID 18680 (started by zhaoyongfeng in C:\Users\31126\Desktop\study\xfg-frame-archetype-lite\xfg-frame-archetype-lite-app) +24-11-13.22:01:33.006 [main ] INFO AwardDaoTest - The following 1 profile is active: "dev" +24-11-13.22:01:35.930 [main ] INFO AwardDaoTest - Started AwardDaoTest in 3.719 seconds (JVM running for 4.92) +24-11-13.22:02:30.137 [main ] INFO AwardDaoTest - Starting AwardDaoTest using Java 1.8.0_412 on zhaoyongfeng with PID 16484 (started by zhaoyongfeng in C:\Users\31126\Desktop\study\xfg-frame-archetype-lite\xfg-frame-archetype-lite-app) +24-11-13.22:02:30.138 [main ] INFO AwardDaoTest - The following 1 profile is active: "dev" +24-11-13.22:02:32.977 [main ] INFO AwardDaoTest - Started AwardDaoTest in 3.413 seconds (JVM running for 4.608) +24-11-13.22:15:40.573 [main ] INFO AwardDaoTest - Starting AwardDaoTest using Java 1.8.0_412 on zhaoyongfeng with PID 24008 (started by zhaoyongfeng in C:\Users\31126\Desktop\study\xfg-frame-archetype-lite\xfg-frame-archetype-lite-app) +24-11-13.22:15:40.574 [main ] INFO AwardDaoTest - The following 1 profile is active: "dev" +24-11-13.22:15:43.767 [main ] INFO AwardDaoTest - Started AwardDaoTest in 3.816 seconds (JVM running for 5.064) +24-11-13.22:15:44.065 [main ] INFO HikariDataSource - HikariPool-1 - Starting... +24-11-13.22:15:50.764 [main ] ERROR HikariPool - HikariPool-1 - Exception during pool initialization. +java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906) + at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831) + at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456) + at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) + at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) + at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) + at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) + at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) + at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) + at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) + at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) + at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) + at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159) + at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117) + at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) + at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:337) + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86) + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) + at com.sun.proxy.$Proxy79.selectList(Unknown Source) + at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) + at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) + at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) + at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) + at com.sun.proxy.$Proxy82.queryAwardList(Unknown Source) + at cn.bugstack.test.infrastructure.AwardDaoTest.Test_queryAwardList(AwardDaoTest.java:31) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) + at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) + at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) + at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) + at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) + at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) + at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) + at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) + at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) + at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) + at org.junit.runners.ParentRunner.run(ParentRunner.java:413) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) + at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) + at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) + at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) + at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) + at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) +Caused by: com.mysql.cj.exceptions.CJException: Unknown database 'big_market' + at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) + at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) + at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) + at java.lang.reflect.Constructor.newInstance(Constructor.java:423) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:792) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:717) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:685) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:134) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:469) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174) + at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) + at com.mysql.cj.NativeSession.connect(NativeSession.java:157) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850) + ... 71 common frames omitted +24-11-13.22:16:52.152 [main ] INFO AwardDaoTest - Starting AwardDaoTest using Java 1.8.0_412 on zhaoyongfeng with PID 1908 (started by zhaoyongfeng in C:\Users\31126\Desktop\study\xfg-frame-archetype-lite\xfg-frame-archetype-lite-app) +24-11-13.22:16:52.154 [main ] INFO AwardDaoTest - The following 1 profile is active: "dev" +24-11-13.22:16:55.315 [main ] INFO AwardDaoTest - Started AwardDaoTest in 3.657 seconds (JVM running for 4.75) +24-11-13.22:16:55.597 [main ] INFO HikariDataSource - HikariPool-1 - Starting... +24-11-13.22:17:02.261 [main ] ERROR HikariPool - HikariPool-1 - Exception during pool initialization. +java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) + at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906) + at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831) + at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456) + at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) + at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) + at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) + at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) + at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) + at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) + at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) + at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) + at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) + at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159) + at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117) + at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80) + at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) + at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:337) + at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86) + at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) + at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) + at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) + at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) + at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) + at com.sun.proxy.$Proxy79.selectList(Unknown Source) + at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) + at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) + at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) + at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) + at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) + at com.sun.proxy.$Proxy82.queryAwardList(Unknown Source) + at cn.bugstack.test.infrastructure.AwardDaoTest.Test_queryAwardList(AwardDaoTest.java:31) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) + at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) + at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) + at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) + at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) + at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) + at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) + at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) + at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) + at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) + at org.junit.runners.ParentRunner.run(ParentRunner.java:413) + at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) + at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) + at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) + at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) + at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) + at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) +Caused by: com.mysql.cj.exceptions.CJException: Unknown database 'big_market' + at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) + at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) + at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) + at java.lang.reflect.Constructor.newInstance(Constructor.java:423) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) + at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:792) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:717) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:685) + at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:134) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:469) + at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174) + at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) + at com.mysql.cj.NativeSession.connect(NativeSession.java:157) + at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850) + ... 71 common frames omitted +24-11-13.22:18:23.243 [main ] INFO AwardDaoTest - Starting AwardDaoTest using Java 1.8.0_412 on zhaoyongfeng with PID 24192 (started by zhaoyongfeng in C:\Users\31126\Desktop\study\xfg-frame-archetype-lite\xfg-frame-archetype-lite-app) +24-11-13.22:18:23.244 [main ] INFO AwardDaoTest - The following 1 profile is active: "dev" +24-11-13.22:18:26.253 [main ] INFO AwardDaoTest - Started AwardDaoTest in 3.541 seconds (JVM running for 4.635) +24-11-13.22:18:26.501 [main ] INFO HikariDataSource - HikariPool-1 - Starting... +24-11-13.22:18:28.057 [main ] INFO HikariDataSource - HikariPool-1 - Start completed. +24-11-13.22:18:28.100 [main ] INFO AwardDaoTest - 测试结果:[Award(id=null, awardId=101, awardKey=user_credit_random, awardConfig=1,100, awardDesc=用户积分【优先透彻规则范围,如果没有则走配置】, createTime=null, updateTime=null), Award(id=null, awardId=102, awardKey=openai_use_count, awardConfig=5, awardDesc=OpenAI 增加使用次数, createTime=null, updateTime=null), Award(id=null, awardId=103, awardKey=openai_use_count, awardConfig=10, awardDesc=OpenAI 增加使用次数, createTime=null, updateTime=null), Award(id=null, awardId=104, awardKey=openai_use_count, awardConfig=20, awardDesc=OpenAI 增加使用次数, createTime=null, updateTime=null), Award(id=null, awardId=105, awardKey=openai_model, awardConfig=gpt-4, awardDesc=OpenAI 增加模型, createTime=null, updateTime=null), Award(id=null, awardId=106, awardKey=openai_model, awardConfig=dall-e-2, awardDesc=OpenAI 增加模型, createTime=null, updateTime=null), Award(id=null, awardId=107, awardKey=openai_model, awardConfig=dall-e-3, awardDesc=OpenAI 增加模型, createTime=null, updateTime=null), Award(id=null, awardId=108, awardKey=openai_use_count, awardConfig=100, awardDesc=OpenAI 增加使用次数, createTime=null, updateTime=null), Award(id=null, awardId=109, awardKey=openai_model, awardConfig=gpt-4,dall-e-2,dall-e-3, awardDesc=OpenAI 增加模型, createTime=null, updateTime=null), Award(id=null, awardId=100, awardKey=user_credit_blacklist, awardConfig=1, awardDesc=黑名单积分, createTime=null, updateTime=null)] +24-11-13.22:18:28.109 [SpringApplicationShutdownHook] INFO HikariDataSource - HikariPool-1 - Shutdown initiated... +24-11-13.22:18:28.113 [SpringApplicationShutdownHook] INFO HikariDataSource - HikariPool-1 - Shutdown completed. diff --git a/xfg-frame-archetype-lite-app/pom.xml b/xfg-frame-archetype-lite-app/pom.xml index e96799d..a185abe 100644 --- a/xfg-frame-archetype-lite-app/pom.xml +++ b/xfg-frame-archetype-lite-app/pom.xml @@ -78,6 +78,10 @@ converter-gson 2.9.0 + + org.redisson + redisson-spring-boot-starter + diff --git a/xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfig.java b/xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfig.java new file mode 100644 index 0000000..dcda1b6 --- /dev/null +++ b/xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfig.java @@ -0,0 +1,85 @@ +package cn.bugstack.config; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.ByteBufOutputStream; +import org.redisson.Redisson; +import org.redisson.api.RedissonClient; +import org.redisson.client.codec.BaseCodec; +import org.redisson.client.protocol.Decoder; +import org.redisson.client.protocol.Encoder; +import org.redisson.config.Config; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.io.IOException; + +/** + * @ClassName: RedisClientConfig + * @Description: + * @Author: zhaoyongfeng + * @Date: 2024/11/14 17:40 + */ +@Configuration +@EnableConfigurationProperties(RedisClientConfigProperties.class) +public class RedisClientConfig { + + @Bean("redissonClient") + public RedissonClient redissonClient(ConfigurableApplicationContext applicationContext, RedisClientConfigProperties properties) { + Config config = new Config(); + // 根据需要可以设定编解码器;https://github.com/redisson/redisson/wiki/4.-%E6%95%B0%E6%8D%AE%E5%BA%8F%E5%88%97%E5%8C%96 + // config.setCodec(new RedisCodec()); + + config.useSingleServer() + .setAddress("redis://" + properties.getHost() + ":" + properties.getPort()) +// .setPassword(properties.getPassword()) + .setConnectionPoolSize(properties.getPoolSize()) + .setConnectionMinimumIdleSize(properties.getMinIdleSize()) + .setIdleConnectionTimeout(properties.getIdleTimeout()) + .setConnectTimeout(properties.getConnectTimeout()) + .setRetryAttempts(properties.getRetryAttempts()) + .setRetryInterval(properties.getRetryInterval()) + .setPingConnectionInterval(properties.getPingInterval()) + .setKeepAlive(properties.isKeepAlive()) + ; + + return Redisson.create(config); + } + + static class RedisCodec extends BaseCodec { + + private final Encoder encoder = in -> { + ByteBuf out = ByteBufAllocator.DEFAULT.buffer(); + try { + ByteBufOutputStream os = new ByteBufOutputStream(out); + JSON.writeJSONString(os, in, SerializerFeature.WriteClassName); + return os.buffer(); + } catch (IOException e) { + out.release(); + throw e; + } catch (Exception e) { + out.release(); + throw new IOException(e); + } + }; + + private final Decoder decoder = (buf, state) -> JSON.parseObject(new ByteBufInputStream(buf), Object.class); + + @Override + public Decoder getValueDecoder() { + return decoder; + } + + @Override + public Encoder getValueEncoder() { + return encoder; + } + + } + +} + diff --git a/xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfigProperties.java b/xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfigProperties.java new file mode 100644 index 0000000..f42933b --- /dev/null +++ b/xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/RedisClientConfigProperties.java @@ -0,0 +1,40 @@ +package cn.bugstack.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * @ClassName: RedisClientConfigProperties + * @Description: + * @Author: zhaoyongfeng + * @Date: 2024/11/14 17:40 + */ +@Data +@ConfigurationProperties(prefix = "redis.sdk.config", ignoreInvalidFields = true) +public class RedisClientConfigProperties { + + /** host:ip */ + private String host; + /** 端口 */ + private int port; + /** 账密 */ + private String password; + /** 设置连接池的大小,默认为64 */ + private int poolSize = 64; + /** 设置连接池的最小空闲连接数,默认为10 */ + private int minIdleSize = 10; + /** 设置连接的最大空闲时间(单位:毫秒),超过该时间的空闲连接将被关闭,默认为10000 */ + private int idleTimeout = 10000; + /** 设置连接超时时间(单位:毫秒),默认为10000 */ + private int connectTimeout = 10000; + /** 设置连接重试次数,默认为3 */ + private int retryAttempts = 3; + /** 设置连接重试的间隔时间(单位:毫秒),默认为1000 */ + private int retryInterval = 1000; + /** 设置定期检查连接是否可用的时间间隔(单位:毫秒),默认为0,表示不进行定期检查 */ + private int pingInterval = 0; + /** 设置是否保持长连接,默认为true */ + private boolean keepAlive = true; + +} + diff --git a/xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml b/xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml index 335102e..d23ad81 100644 --- a/xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml +++ b/xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml @@ -34,6 +34,21 @@ mybatis: mapper-locations: classpath:/mybatis/mapper/*.xml config-location: classpath:/mybatis/config/mybatis-config.xml +# Redis +redis: + sdk: + config: + host: 127.0.0.1 + port: 6379 + pool-size: 10 + min-idle-size: 5 + idle-timeout: 30000 + connect-timeout: 5000 + retry-attempts: 3 + retry-interval: 1000 + ping-interval: 60000 + keep-alive: true + # 日志 logging: level: diff --git a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/award_mapper.xml b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/award_mapper.xml index cd5f371..408af62 100644 --- a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/award_mapper.xml +++ b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/award_mapper.xml @@ -1,8 +1,8 @@ - + - + diff --git a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_award_mapper.xml b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_award_mapper.xml index e3f708c..2997280 100644 --- a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_award_mapper.xml +++ b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_award_mapper.xml @@ -1,8 +1,8 @@ - + - + @@ -22,6 +22,11 @@ from strategy_award limit 10 + diff --git a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_mapper.xml b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_mapper.xml index 5c08ebd..03af8bd 100644 --- a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_mapper.xml +++ b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_mapper.xml @@ -1,8 +1,8 @@ - + - + diff --git a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_rule_mapper.xml b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_rule_mapper.xml index c1eb458..fe61a80 100644 --- a/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_rule_mapper.xml +++ b/xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/strategy_rule_mapper.xml @@ -1,8 +1,8 @@ - + - + diff --git a/xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/domain/StrategyArmoryTest.java b/xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/domain/StrategyArmoryTest.java new file mode 100644 index 0000000..ae682c4 --- /dev/null +++ b/xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/domain/StrategyArmoryTest.java @@ -0,0 +1,42 @@ +package cn.bugstack.test.domain; + +import cn.bugstack.domain.strategy.service.armory.IStrategyArmory; +import lombok.extern.slf4j.Slf4j; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +/** + * @ClassName: StrategyArmoryTest + * @Description: + * @Author: zhaoyongfeng + * @Date: 2024/11/14 20:28 + */ +@SpringBootTest +@Slf4j +@RunWith(SpringRunner.class) +public class StrategyArmoryTest { + + @Resource + private IStrategyArmory strategyArmory; + @Test + public void test_strategyArmory(){ + strategyArmory.assembleLotteryStrategy(100002L); + } + + /** + * 从装配的策略中随机获取奖品ID值 + */ + @Test + public void test_getAssembleRandomVal() { + log.info("测试结果:{} - 奖品ID值", strategyArmory.getRandomAwardId(100002L)); + log.info("测试结果:{} - 奖品ID值", strategyArmory.getRandomAwardId(100002L)); + log.info("测试结果:{} - 奖品ID值", strategyArmory.getRandomAwardId(100002L)); + log.info("测试结果:{} - 奖品ID值", strategyArmory.getRandomAwardId(100002L)); + log.info("测试结果:{} - 奖品ID值", strategyArmory.getRandomAwardId(100002L)); + + } +} diff --git a/xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/infrastructure/AwardDaoTest.java b/xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/infrastructure/AwardDaoTest.java index d1d88c4..00de8a6 100644 --- a/xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/infrastructure/AwardDaoTest.java +++ b/xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/infrastructure/AwardDaoTest.java @@ -1,7 +1,7 @@ package cn.bugstack.test.infrastructure; -import cn.bugstack.infrastructure.dao.IAwardDao; -import cn.bugstack.infrastructure.dao.po.Award; +import cn.bugstack.infrastructure.persistent.dao.IAwardDao; +import cn.bugstack.infrastructure.persistent.po.Award; import lombok.extern.slf4j.Slf4j; import org.junit.Test; diff --git a/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/AwardEntity.java b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/AwardEntity.java new file mode 100644 index 0000000..34bd3a3 --- /dev/null +++ b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/AwardEntity.java @@ -0,0 +1,27 @@ +package cn.bugstack.domain.strategy.model.entity; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ClassName: AwardEntity + * @Description: + * @Author: zhaoyongfeng + * @Date: 2024/11/14 19:37 + */ + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AwardEntity { + + /** 用户ID */ + private String userId; + /** 奖品ID */ + private Integer awardId; + +} + diff --git a/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyAwardEntity.java b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyAwardEntity.java new file mode 100644 index 0000000..260d06b --- /dev/null +++ b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyAwardEntity.java @@ -0,0 +1,32 @@ +package cn.bugstack.domain.strategy.model.entity; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * @ClassName: StrategyAwardEntity + * @Description: + * @Author: zhaoyongfeng + * @Date: 2024/11/14 19:32 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class StrategyAwardEntity { + /** 抽奖策略ID */ + private Long strategyId; + /** 抽奖奖品ID - 内部流转使用 */ + private Integer awardId; + /** 奖品库存总量 */ + private Integer awardCount; + /** 奖品库存剩余 */ + private Integer awardCountSurplus; + /** 奖品中奖概率 */ + private BigDecimal awardRate; + +} diff --git a/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyConditionEntity.java b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyConditionEntity.java new file mode 100644 index 0000000..1522557 --- /dev/null +++ b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/model/entity/StrategyConditionEntity.java @@ -0,0 +1,24 @@ +package cn.bugstack.domain.strategy.model.entity; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ClassName: StrategyConditionEntity + * @Description: + * @Author: zhaoyongfeng + * @Date: 2024/11/14 19:37 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class StrategyConditionEntity { + /** 用户ID */ + private String userId; + /** 策略ID */ + private Integer strategyId; + +} diff --git a/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/repository/IStrategyRepository.java b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/repository/IStrategyRepository.java new file mode 100644 index 0000000..1b19192 --- /dev/null +++ b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/repository/IStrategyRepository.java @@ -0,0 +1,17 @@ +package cn.bugstack.domain.strategy.repository; + +import cn.bugstack.domain.strategy.model.entity.StrategyAwardEntity; + +import java.util.List; +import java.util.Map; + +public interface IStrategyRepository { + List queryStrategyAwardList(Long strategyId); + + void storeStrategyAwardSearchRateTable(Long strategyId, Integer rateRange, Map strategyAwardSearchRateTable); + + Integer getStrategyAwardAssemble(Long strategyId, Integer rateKey); + + int getRateRange(Long strategyId); + +} diff --git a/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/IStrategyArmory.java b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/IStrategyArmory.java new file mode 100644 index 0000000..18859a5 --- /dev/null +++ b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/IStrategyArmory.java @@ -0,0 +1,21 @@ +package cn.bugstack.domain.strategy.service.armory; + +public interface IStrategyArmory { + + /** + * 装配抽奖策略配置「触发的时机可以为活动审核通过后进行调用」 + * + * @param strategyId 策略ID + * @return 装配结果 + */ + boolean assembleLotteryStrategy(Long strategyId); + + /** + * 获取抽奖策略装配的随机结果 + * + * @param strategyId 策略ID + * @return 抽奖结果 + */ + Integer getRandomAwardId(Long strategyId); + +} diff --git a/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/StrategyArmory.java b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/StrategyArmory.java new file mode 100644 index 0000000..6d91d70 --- /dev/null +++ b/xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/strategy/service/armory/StrategyArmory.java @@ -0,0 +1,77 @@ +package cn.bugstack.domain.strategy.service.armory; + +import cn.bugstack.domain.strategy.model.entity.StrategyAwardEntity; +import cn.bugstack.domain.strategy.repository.IStrategyRepository; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.security.SecureRandom; +import java.util.*; + +/** + * @ClassName: StrategyArmory + * @Description: 策略装配库(兵工厂),负责初始化策略计算 + * @Author: zhaoyongfeng + * @Date: 2024/11/14 17:39 + */ +@Slf4j +@Service +public class StrategyArmory implements IStrategyArmory{ + @Resource + private IStrategyRepository repository; + + @Override + public boolean assembleLotteryStrategy(Long strategyId) { + //1. 查询策略配置 + List strategyAwardEntities = repository.queryStrategyAwardList(strategyId); + // 获取最小概率值 + BigDecimal minAwardRate = strategyAwardEntities.stream() + .map(StrategyAwardEntity::getAwardRate) + .min(BigDecimal::compareTo) + .orElse(BigDecimal.ZERO); + + // 3. 获取概率值总和 + BigDecimal totalAwardRate = strategyAwardEntities.stream() + .map(StrategyAwardEntity::getAwardRate) + .reduce(BigDecimal.ZERO, BigDecimal::add); +//TODO 需要修改问题 + // 4. 用 1 % 0.0001 获得概率范围,百分位、千分位、万分位 + BigDecimal rateRange = totalAwardRate.divide(minAwardRate, 0, RoundingMode.CEILING); + // 5. 生成策略奖品概率查找表「这里指需要在list集合中,存放上对应的奖品占位即可,占位越多等于概率越高」 + + ArrayList strategyAwardSearchRateTables = new ArrayList<>(rateRange.intValue()); + for(StrategyAwardEntity strategyAward: strategyAwardEntities){ + Integer awardId = strategyAward.getAwardId(); + BigDecimal awardRate = strategyAward.getAwardRate(); + // 计算出每个概率值需要存放到查找表的数量,循环填充 + for (int i = 0; i < rateRange.multiply(awardRate).setScale(0, RoundingMode.CEILING).intValue(); i++) { + strategyAwardSearchRateTables.add(awardId); + } + + } + // 6. 对存储的奖品进行乱序操作 + Collections.shuffle(strategyAwardSearchRateTables); + // 7. 生成出Map集合,key值,对应的就是后续的概率值。通过概率来获得对应的奖品ID + Map shuffleStrategyAwardSearchRateTable = new LinkedHashMap<>(); + for (int i = 0; i < strategyAwardSearchRateTables.size(); i++) { + shuffleStrategyAwardSearchRateTable.put(i, strategyAwardSearchRateTables.get(i)); + } + // 8. 存放到 Redis + repository.storeStrategyAwardSearchRateTable(strategyId, shuffleStrategyAwardSearchRateTable.size(), shuffleStrategyAwardSearchRateTable); + + return true; + + } + + @Override + public Integer getRandomAwardId(Long strategyId) { + // 分布式部署下,不一定为当前应用做的策略装配。也就是值不一定会保存到本应用,而是分布式应用,所以需要从 Redis 中获取。 + int rateRange = repository.getRateRange(strategyId); + // 通过生成的随机值,获取概率值奖品查找表的结果 + return repository.getStrategyAwardAssemble(strategyId, new SecureRandom().nextInt(rateRange)); + } + +} diff --git a/xfg-frame-archetype-lite-infrastructure/pom.xml b/xfg-frame-archetype-lite-infrastructure/pom.xml index 2bb0475..6801b01 100644 --- a/xfg-frame-archetype-lite-infrastructure/pom.xml +++ b/xfg-frame-archetype-lite-infrastructure/pom.xml @@ -18,6 +18,10 @@ org.projectlombok lombok + + org.redisson + redisson-spring-boot-starter + cn.bugstack diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyAwardDao.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyAwardDao.java deleted file mode 100644 index 0f789cf..0000000 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyAwardDao.java +++ /dev/null @@ -1,10 +0,0 @@ -package cn.bugstack.infrastructure.dao; - -import cn.bugstack.infrastructure.dao.po.Award; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; -@Mapper -public interface IStrategyAwardDao { - List queryStrategyAwardList(); -} diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IAwardDao.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IAwardDao.java similarity index 57% rename from xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IAwardDao.java rename to xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IAwardDao.java index eaa99da..6e0ed3a 100644 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IAwardDao.java +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IAwardDao.java @@ -1,6 +1,6 @@ -package cn.bugstack.infrastructure.dao; +package cn.bugstack.infrastructure.persistent.dao; -import cn.bugstack.infrastructure.dao.po.Award; +import cn.bugstack.infrastructure.persistent.po.Award; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyAwardDao.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyAwardDao.java new file mode 100644 index 0000000..fdac7c4 --- /dev/null +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyAwardDao.java @@ -0,0 +1,15 @@ +package cn.bugstack.infrastructure.persistent.dao; + +import cn.bugstack.infrastructure.persistent.po.Award; +import cn.bugstack.infrastructure.persistent.po.StrategyAward; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +@Mapper +public interface IStrategyAwardDao { + List queryStrategyAwardList(); + + List queryStrategyAwardListByStrategyId(Long strategyId); + + +} diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyDao.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyDao.java similarity index 58% rename from xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyDao.java rename to xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyDao.java index 16951c7..8540ee6 100644 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyDao.java +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyDao.java @@ -1,6 +1,6 @@ -package cn.bugstack.infrastructure.dao; +package cn.bugstack.infrastructure.persistent.dao; -import cn.bugstack.infrastructure.dao.po.Award; +import cn.bugstack.infrastructure.persistent.po.Award; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyRuleDao.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyRuleDao.java similarity index 59% rename from xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyRuleDao.java rename to xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyRuleDao.java index 6fd6664..83d301e 100644 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/IStrategyRuleDao.java +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/IStrategyRuleDao.java @@ -1,6 +1,6 @@ -package cn.bugstack.infrastructure.dao; +package cn.bugstack.infrastructure.persistent.dao; -import cn.bugstack.infrastructure.dao.po.Award; +import cn.bugstack.infrastructure.persistent.po.Award; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Award.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Award.java similarity index 92% rename from xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Award.java rename to xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Award.java index 141591a..d238ca2 100644 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Award.java +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Award.java @@ -1,4 +1,4 @@ -package cn.bugstack.infrastructure.dao.po; +package cn.bugstack.infrastructure.persistent.po; import lombok.Data; diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Strategy.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Strategy.java similarity index 89% rename from xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Strategy.java rename to xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Strategy.java index 0747197..f2163fa 100644 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/Strategy.java +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/Strategy.java @@ -1,4 +1,4 @@ -package cn.bugstack.infrastructure.dao.po; +package cn.bugstack.infrastructure.persistent.po; import lombok.Data; diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyAward.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyAward.java similarity index 95% rename from xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyAward.java rename to xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyAward.java index f4557a8..83a085f 100644 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyAward.java +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyAward.java @@ -1,4 +1,4 @@ -package cn.bugstack.infrastructure.dao.po; +package cn.bugstack.infrastructure.persistent.po; import lombok.Data; diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyRule.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyRule.java similarity index 94% rename from xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyRule.java rename to xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyRule.java index 6483222..1fa5c7e 100644 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/dao/po/StrategyRule.java +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/StrategyRule.java @@ -1,4 +1,4 @@ -package cn.bugstack.infrastructure.dao.po; +package cn.bugstack.infrastructure.persistent.po; import lombok.Data; diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/IRedisService.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/IRedisService.java new file mode 100644 index 0000000..ccc5a59 --- /dev/null +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/IRedisService.java @@ -0,0 +1,251 @@ +package cn.bugstack.infrastructure.persistent.redis; + +import org.redisson.api.*; + +/* + * @return + * @author zhaoyongfeng + * @description + * Redis服务 + * @param null + */ +public interface IRedisService { + + /** + * 设置指定 key 的值 + * + * @param key 键 + * @param value 值 + */ + void setValue(String key, T value); + + /** + * 设置指定 key 的值 + * + * @param key 键 + * @param value 值 + * @param expired 过期时间 + */ + void setValue(String key, T value, long expired); + + /** + * 获取指定 key 的值 + * + * @param key 键 + * @return 值 + */ + T getValue(String key); + + /** + * 获取队列 + * + * @param key 键 + * @param 泛型 + * @return 队列 + */ + RQueue getQueue(String key); + + /** + * 加锁队列 + * + * @param key 键 + * @param 泛型 + * @return 队列 + */ + RBlockingQueue getBlockingQueue(String key); + + /** + * 延迟队列 + * + * @param rBlockingQueue 加锁队列 + * @param 泛型 + * @return 队列 + */ + RDelayedQueue getDelayedQueue(RBlockingQueue rBlockingQueue); + + /** + * 自增 Key 的值;1、2、3、4 + * + * @param key 键 + * @return 自增后的值 + */ + long incr(String key); + + /** + * 指定值,自增 Key 的值;1、2、3、4 + * + * @param key 键 + * @return 自增后的值 + */ + long incrBy(String key, long delta); + + /** + * 自减 Key 的值;1、2、3、4 + * + * @param key 键 + * @return 自增后的值 + */ + long decr(String key); + + /** + * 指定值,自增 Key 的值;1、2、3、4 + * + * @param key 键 + * @return 自增后的值 + */ + long decrBy(String key, long delta); + + + /** + * 移除指定 key 的值 + * + * @param key 键 + */ + void remove(String key); + + /** + * 判断指定 key 的值是否存在 + * + * @param key 键 + * @return true/false + */ + boolean isExists(String key); + + /** + * 将指定的值添加到集合中 + * + * @param key 键 + * @param value 值 + */ + void addToSet(String key, String value); + + /** + * 判断指定的值是否是集合的成员 + * + * @param key 键 + * @param value 值 + * @return 如果是集合的成员返回 true,否则返回 false + */ + boolean isSetMember(String key, String value); + + /** + * 将指定的值添加到列表中 + * + * @param key 键 + * @param value 值 + */ + void addToList(String key, String value); + + /** + * 获取列表中指定索引的值 + * + * @param key 键 + * @param index 索引 + * @return 值 + */ + String getFromList(String key, int index); + + /** + * 获取Map + * + * @param key 键 + * @return 值 + */ + RMap getMap(String key); + + /** + * 将指定的键值对添加到哈希表中 + * + * @param key 键 + * @param field 字段 + * @param value 值 + */ + void addToMap(String key, String field, String value); + + /** + * 获取哈希表中指定字段的值 + * + * @param key 键 + * @param field 字段 + * @return 值 + */ + String getFromMap(String key, String field); + + /** + * 获取哈希表中指定字段的值 + * + * @param key 键 + * @param field 字段 + * @return 值 + */ + V getFromMap(String key, K field); + + /** + * 将指定的值添加到有序集合中 + * + * @param key 键 + * @param value 值 + */ + void addToSortedSet(String key, String value); + + /** + * 获取 Redis 锁(可重入锁) + * + * @param key 键 + * @return Lock + */ + RLock getLock(String key); + + /** + * 获取 Redis 锁(公平锁) + * + * @param key 键 + * @return Lock + */ + RLock getFairLock(String key); + + /** + * 获取 Redis 锁(读写锁) + * + * @param key 键 + * @return RReadWriteLock + */ + RReadWriteLock getReadWriteLock(String key); + + /** + * 获取 Redis 信号量 + * + * @param key 键 + * @return RSemaphore + */ + RSemaphore getSemaphore(String key); + + /** + * 获取 Redis 过期信号量 + *

+ * 基于Redis的Redisson的分布式信号量(Semaphore)Java对象RSemaphore采用了与java.util.concurrent.Semaphore相似的接口和用法。 + * 同时还提供了异步(Async)、反射式(Reactive)和RxJava2标准的接口。 + * + * @param key 键 + * @return RPermitExpirableSemaphore + */ + RPermitExpirableSemaphore getPermitExpirableSemaphore(String key); + + /** + * 闭锁 + * + * @param key 键 + * @return RCountDownLatch + */ + RCountDownLatch getCountDownLatch(String key); + + /** + * 布隆过滤器 + * + * @param key 键 + * @param 存放对象 + * @return 返回结果 + */ + RBloomFilter getBloomFilter(String key); + +} diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/RedissonService.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/RedissonService.java new file mode 100644 index 0000000..f1a31ca --- /dev/null +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/redis/RedissonService.java @@ -0,0 +1,161 @@ +package cn.bugstack.infrastructure.persistent.redis; + +import org.redisson.api.*; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.time.Duration; + +/** + * @ClassName: RedissonService + * @Description: + * @Author: zhaoyongfeng + * @Date: 2024/11/14 17:49 + */ +@Service("redissonService") +public class RedissonService implements IRedisService { + + @Resource + private RedissonClient redissonClient; + + public void setValue(String key, T value) { + redissonClient.getBucket(key).set(value); + } + + @Override + public void setValue(String key, T value, long expired) { + RBucket bucket = redissonClient.getBucket(key); + bucket.set(value, Duration.ofMillis(expired)); + } + + public T getValue(String key) { + return redissonClient.getBucket(key).get(); + } + + @Override + public RQueue getQueue(String key) { + return redissonClient.getQueue(key); + } + + @Override + public RBlockingQueue getBlockingQueue(String key) { + return redissonClient.getBlockingQueue(key); + } + + @Override + public RDelayedQueue getDelayedQueue(RBlockingQueue rBlockingQueue) { + return redissonClient.getDelayedQueue(rBlockingQueue); + } + + @Override + public long incr(String key) { + return redissonClient.getAtomicLong(key).incrementAndGet(); + } + + @Override + public long incrBy(String key, long delta) { + return redissonClient.getAtomicLong(key).addAndGet(delta); + } + + @Override + public long decr(String key) { + return redissonClient.getAtomicLong(key).decrementAndGet(); + } + + @Override + public long decrBy(String key, long delta) { + return redissonClient.getAtomicLong(key).addAndGet(-delta); + } + + @Override + public void remove(String key) { + redissonClient.getBucket(key).delete(); + } + + @Override + public boolean isExists(String key) { + return redissonClient.getBucket(key).isExists(); + } + + public void addToSet(String key, String value) { + RSet set = redissonClient.getSet(key); + set.add(value); + } + + public boolean isSetMember(String key, String value) { + RSet set = redissonClient.getSet(key); + return set.contains(value); + } + + public void addToList(String key, String value) { + RList list = redissonClient.getList(key); + list.add(value); + } + + public String getFromList(String key, int index) { + RList list = redissonClient.getList(key); + return list.get(index); + } + + @Override + public RMap getMap(String key) { + return redissonClient.getMap(key); + } + + public void addToMap(String key, String field, String value) { + RMap map = redissonClient.getMap(key); + map.put(field, value); + } + + public String getFromMap(String key, String field) { + RMap map = redissonClient.getMap(key); + return map.get(field); + } + + @Override + public V getFromMap(String key, K field) { + return redissonClient.getMap(key).get(field); + } + + public void addToSortedSet(String key, String value) { + RSortedSet sortedSet = redissonClient.getSortedSet(key); + sortedSet.add(value); + } + + @Override + public RLock getLock(String key) { + return redissonClient.getLock(key); + } + + @Override + public RLock getFairLock(String key) { + return redissonClient.getFairLock(key); + } + + @Override + public RReadWriteLock getReadWriteLock(String key) { + return redissonClient.getReadWriteLock(key); + } + + @Override + public RSemaphore getSemaphore(String key) { + return redissonClient.getSemaphore(key); + } + + @Override + public RPermitExpirableSemaphore getPermitExpirableSemaphore(String key) { + return redissonClient.getPermitExpirableSemaphore(key); + } + + @Override + public RCountDownLatch getCountDownLatch(String key) { + return redissonClient.getCountDownLatch(key); + } + + @Override + public RBloomFilter getBloomFilter(String key) { + return redissonClient.getBloomFilter(key); + } + + +} diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/repository/StrategyRepository.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/repository/StrategyRepository.java new file mode 100644 index 0000000..5c2355f --- /dev/null +++ b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/repository/StrategyRepository.java @@ -0,0 +1,76 @@ +package cn.bugstack.infrastructure.persistent.repository; + + +import cn.bugstack.domain.strategy.model.entity.StrategyAwardEntity; +import cn.bugstack.domain.strategy.repository.IStrategyRepository; +import cn.bugstack.infrastructure.persistent.dao.IStrategyAwardDao; +import cn.bugstack.infrastructure.persistent.po.StrategyAward; +import cn.bugstack.infrastructure.persistent.redis.IRedisService; +import cn.bugstack.types.common.Constants; +import org.springframework.stereotype.Repository; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + + +/** + * @ClassName: StrategyRepository + * @Description: 策略服务仓储实现 + * @Author: zhaoyongfeng + * @Date: 2024/11/14 19:27 + */ +@Repository +public class StrategyRepository implements IStrategyRepository { + + @Resource + private IStrategyAwardDao strategyAwardDao; + @Resource + private IRedisService redisService; + + @Override + public List queryStrategyAwardList(Long strategyId) { + // 优先从缓存获取 + String cacheKey = Constants.RedisKey.STRATEGY_AWARD_KEY + strategyId; + List strategyAwardEntities = redisService.getValue(cacheKey); + if (null != strategyAwardEntities && !strategyAwardEntities.isEmpty()) return strategyAwardEntities; + // 从库中获取数据 + List strategyAwards = strategyAwardDao.queryStrategyAwardListByStrategyId(strategyId); + strategyAwardEntities = new ArrayList<>(strategyAwards.size()); + for (StrategyAward strategyAward : strategyAwards) { + StrategyAwardEntity strategyAwardEntity = StrategyAwardEntity.builder() + .strategyId(strategyAward.getStrategyId()) + .awardId(strategyAward.getAwardId()) + .awardCount(strategyAward.getAwardCount()) + .awardCountSurplus(strategyAward.getAwardCountSurplus()) + .awardRate(strategyAward.getAwardRate()) + .build(); + strategyAwardEntities.add(strategyAwardEntity); + } + redisService.setValue(cacheKey, strategyAwardEntities); + return strategyAwardEntities; + } + + @Override + public void storeStrategyAwardSearchRateTable(Long strategyId, Integer rateRange, Map strategyAwardSearchRateTable) { + // 1. 存储抽奖策略范围值,如10000,用于生成1000以内的随机数 + redisService.setValue(Constants.RedisKey.STRATEGY_RATE_RANGE_KEY + strategyId, rateRange); + // 2. 存储概率查找表 + Map cacheRateTable = redisService.getMap(Constants.RedisKey.STRATEGY_RATE_TABLE_KEY + strategyId); + cacheRateTable.putAll(strategyAwardSearchRateTable); + + } + + @Override + public Integer getStrategyAwardAssemble(Long strategyId, Integer rateKey) { + return redisService.getFromMap(Constants.RedisKey.STRATEGY_RATE_TABLE_KEY + strategyId, rateKey); + } + + @Override + public int getRateRange(Long strategyId) { + return redisService.getValue(Constants.RedisKey.STRATEGY_RATE_RANGE_KEY + strategyId); + } + +} + diff --git a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/redis/package-info.java b/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/redis/package-info.java deleted file mode 100644 index 6c4af59..0000000 --- a/xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/redis/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 提供redis链接配置 - */ -package cn.bugstack.infrastructure.redis; \ No newline at end of file diff --git a/xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/common/Constants.java b/xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/common/Constants.java index 3e21a0d..008bc32 100644 --- a/xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/common/Constants.java +++ b/xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/common/Constants.java @@ -4,4 +4,11 @@ public class Constants { public final static String SPLIT = ","; + public static class RedisKey { + public static String STRATEGY_AWARD_KEY = "big_market_strategy_award_key_"; + public static String STRATEGY_RATE_TABLE_KEY = "big_market_strategy_rate_table_key_"; + public static String STRATEGY_RATE_RANGE_KEY = "big_market_strategy_rate_range_key_"; + } + + } -- GitLab