java110-db/src/main/resources/mapper/goods/ShopServiceDaoImplMapper.xml
pom.xml
@@ -21,7 +21,6 @@ <module>service-eureka</module> <module>service-sequence</module> <module>service-store</module> <module>service-rule</module> <module>service-order</module> <module>service-api</module> <module>service-community</module> @@ -29,7 +28,9 @@ <module>service-common</module> <module>service-report</module> <module>service-front</module> <module>service-goods</module> <module>java110-generator</module> </modules> <parent> service-fee/pom.xml
@@ -18,8 +18,8 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> service-goods/docker/Dockerfile
New file @@ -0,0 +1,10 @@ FROM registry.cn-beijing.aliyuncs.com/sxd/ubuntu-java8:1.0 MAINTAINER wuxw <928255095@qq.com> ADD bin/start_goods.sh /root/ RUN chmod u+x /root/start_goods.sh CMD ["/root/start_goods.sh","dev"] service-goods/docker/bin/start_goods.sh
New file @@ -0,0 +1,14 @@ #!/bin/bash #### debug model prod #nohup java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar -Dspring.profiles.active=dev target/service-goods.jar > goods.log 2>&1 & #### normal prod model #nohup java -jar -Dspring.profiles.active=prod target/service-goods.jar > goods.log 2>&1 & #### normal test model #nohup java -jar -Dspring.profiles.active=test target/service-goods.jar > goods.log 2>&1 & #### normal dev model nohup java -jar -Dspring.profiles.active=$1 target/service-goods.jar > goods.log 2>&1 & tail -100f goods.log service-goods/docker/docker-compose.yml
New file @@ -0,0 +1,25 @@ version: '2' services: goodsserivce: container_name: goodsserivce-1 build: context: . dockerfile: Dockerfile restart: always ports: - "8014:8014" volumes: - ../target/service-goods.jar:/root/target/service-goods.jar networks: - java110-net # mem_limit: 1024m # extra_hosts: # - "dev.java110.com:192.168.1.18" # - "dev.db.java110.com:192.168.1.18" # - "dev.zk.java110.com:192.168.1.18" # - "dev.kafka.java110.com:192.168.1.18" # - "dev.redis.java110.com:192.168.1.18" # - "api.java110.com:92.168.1.18" networks: java110-net: external: true service-goods/docker/onStart.sh
New file @@ -0,0 +1,11 @@ #!/bin/bash cp -r ../bin . cp -r ../target . docker build -t java110/goods . docker run -ti --name goods_test -p8014:8014 -idt java110/goods:latest docker logs -f goods_test service-goods/pom.xml
New file @@ -0,0 +1,69 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>MicroCommunity</artifactId> <groupId>com.java110</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>service-goods</artifactId> <name>service-goods</name> <!-- FIXME change it to the project's website --> <url>http://www.example.com</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>com.java110</groupId> <artifactId>java110-service</artifactId> </dependency> </dependencies> <build> <finalName>service-goods</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.10</version> <executions> <execution> <id>unpack</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>com.java110</groupId> <artifactId>java110-interface</artifactId> <version>${microcommunity.version}</version> <type>jar</type> <overWrite>true</overWrite> <outputDirectory>${project.build.directory}/classes</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>com.java110.goods.GoodsServiceApplicationStart</mainClass> </configuration> </plugin> </plugins> </build> </project> service-goods/src/main/java/com/java110/goods/GoodsServiceApplicationStart.java
New file @@ -0,0 +1,67 @@ package com.java110.goods; import com.java110.core.annotation.Java110ListenerDiscovery; import com.java110.core.client.RestTemplate; import com.java110.core.event.service.BusinessServiceDataFlowEventPublishing; import com.java110.service.init.ServiceStartInit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.http.converter.StringHttpMessageConverter; import java.nio.charset.Charset; /** * spring boot 初始化启动类 * * @version v0.1 * @auther com.java110.wuxw * @mail 928255095@qq.com * @date 2016年8月6日 * @tag */ @SpringBootApplication(scanBasePackages = {"com.java110.service", "com.java110.goods", "com.java110.core", "com.java110.config.properties.code", "com.java110.db"}) @EnableDiscoveryClient @Java110ListenerDiscovery(listenerPublishClass = BusinessServiceDataFlowEventPublishing.class, basePackages = {"com.java110.fee.listener"}) @EnableFeignClients(basePackages = {"com.java110.intf.user", "com.java110.intf.order", "com.java110.intf.community", "com.java110.intf.store", "com.java110.intf.store"}) public class GoodsServiceApplicationStart { private static Logger logger = LoggerFactory.getLogger(GoodsServiceApplicationStart.class); /** * 实例化RestTemplate,通过@LoadBalanced注解开启均衡负载能力. * * @return restTemplate */ @Bean @LoadBalanced public RestTemplate restTemplate() { StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8")); RestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build(RestTemplate.class); return restTemplate; } public static void main(String[] args) throws Exception { try { ApplicationContext context = SpringApplication.run(GoodsServiceApplicationStart.class, args); ServiceStartInit.initSystemConfig(context); } catch (Throwable e) { logger.error("系统启动失败", e); } } } service-goods/src/main/java/com/java110/goods/kafka/GoodsServiceBean.java
New file @@ -0,0 +1,16 @@ package com.java110.goods.kafka; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Created by wuxw on 2018/4/15. */ @Configuration public class GoodsServiceBean { @Bean public GoodsServiceKafka listener() { return new GoodsServiceKafka(); } } service-goods/src/main/java/com/java110/goods/kafka/GoodsServiceKafka.java
New file @@ -0,0 +1,86 @@ package com.java110.goods.kafka; import com.alibaba.fastjson.JSONObject; import com.java110.core.base.controller.BaseController; import com.java110.core.context.BusinessServiceDataFlow; import com.java110.core.factory.DataTransactionFactory; import com.java110.goods.smo.IGoodsServiceSMO; import com.java110.utils.constant.KafkaConstant; import com.java110.utils.constant.ResponseConstant; import com.java110.utils.constant.StatusConstant; import com.java110.utils.exception.InitConfigDataException; import com.java110.utils.exception.InitDataFlowContextException; import com.java110.utils.kafka.KafkaFactory; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.kafka.annotation.KafkaListener; import java.util.HashMap; import java.util.Map; /** * kafka侦听 * Created by wuxw on 2018/4/15. */ public class GoodsServiceKafka extends BaseController { private final static Logger logger = LoggerFactory.getLogger(GoodsServiceKafka.class); @Autowired private IGoodsServiceSMO feeServiceSMOImpl; @KafkaListener(topics = {"feeServiceTopic"}) public void listen(ConsumerRecord<?, ?> record) { logger.info("kafka的key: " + record.key()); logger.info("kafka的value: " + record.value().toString()); String orderInfo = record.value().toString(); BusinessServiceDataFlow businessServiceDataFlow = null; JSONObject responseJson = null; try { Map<String, String> headers = new HashMap<String, String>(); //预校验 preValiateOrderInfo(orderInfo); businessServiceDataFlow = this.writeDataToDataFlowContext(orderInfo, headers); responseJson = feeServiceSMOImpl.service(businessServiceDataFlow); }catch (InitDataFlowContextException e){ logger.error("请求报文错误,初始化 BusinessServiceDataFlow失败"+orderInfo,e); responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null); }catch (InitConfigDataException e){ logger.error("请求报文错误,加载配置信息失败"+orderInfo,e); responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null); }catch (Exception e){ logger.error("请求订单异常",e); responseJson = DataTransactionFactory.createBusinessResponseJson(businessServiceDataFlow,ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e, null); }finally { logger.debug("当前请求报文:" + orderInfo +", 当前返回报文:" +responseJson.toJSONString()); //只有business 和 instance 过程才做通知消息 if(!StatusConstant.REQUEST_BUSINESS_TYPE_BUSINESS.equals(responseJson.getString("businessType")) && !StatusConstant.REQUEST_BUSINESS_TYPE_INSTANCE.equals(responseJson.getString("businessType"))){ return ; } try { KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_NOTIFY_CENTER_SERVICE_NAME, "", responseJson.toJSONString()); }catch (Exception e){ logger.error("用户服务通知centerService失败"+responseJson,e); //这里保存异常信息 } } } /** * 这里预校验,请求报文中不能有 dataFlowId * @param orderInfo */ private void preValiateOrderInfo(String orderInfo) { /* if(JSONObject.parseObject(orderInfo).getJSONObject("orders").containsKey("dataFlowId")){ throw new BusinessException(ResponseConstant.RESULT_CODE_ERROR,"报文中不能存在dataFlowId节点"); }*/ } } service-goods/src/main/java/com/java110/goods/smo/IGoodsServiceSMO.java
New file @@ -0,0 +1,17 @@ package com.java110.goods.smo; import com.alibaba.fastjson.JSONObject; import com.java110.core.context.BusinessServiceDataFlow; import com.java110.utils.exception.SMOException; /** * * 用户信息管理,服务 * Created by wuxw on 2017/4/5. */ public interface IGoodsServiceSMO { public JSONObject service(BusinessServiceDataFlow businessServiceDataFlow) throws SMOException; } service-goods/src/main/java/com/java110/goods/smo/impl/GoodsServiceSMOImpl.java
New file @@ -0,0 +1,112 @@ package com.java110.goods.smo.impl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.java110.core.base.smo.BaseServiceSMO; import com.java110.core.context.BusinessServiceDataFlow; import com.java110.core.event.service.BusinessServiceDataFlowEventPublishing; import com.java110.core.factory.DataFlowFactory; import com.java110.entity.center.DataFlowLinksCost; import com.java110.entity.center.DataFlowLog; import com.java110.goods.smo.IGoodsServiceSMO; import com.java110.utils.cache.MappingCache; import com.java110.utils.constant.KafkaConstant; import com.java110.utils.constant.MappingConstant; import com.java110.utils.constant.ResponseConstant; import com.java110.utils.exception.SMOException; import com.java110.utils.kafka.KafkaFactory; import com.java110.utils.util.Assert; import com.java110.utils.util.DateUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; /** * 用户服务信息管理业务信息实现 * Created by wuxw on 2017/4/5. */ @Service("feeServiceSMOImpl") @Transactional public class GoodsServiceSMOImpl extends BaseServiceSMO implements IGoodsServiceSMO { private static Logger logger = LoggerFactory.getLogger(GoodsServiceSMOImpl.class); @Override public JSONObject service(BusinessServiceDataFlow businessServiceDataFlow) throws SMOException { try { Assert.hasLength(businessServiceDataFlow.getbId(), "bId 不能为空"); BusinessServiceDataFlowEventPublishing.multicastEvent(businessServiceDataFlow); Assert.notEmpty(businessServiceDataFlow.getResJson(), "用户服务[" + businessServiceDataFlow.getCurrentBusiness().getServiceCode() + "]没有返回内容"); } catch (Exception e) { logger.error("用户信息处理异常", e); throw new SMOException(ResponseConstant.RESULT_PARAM_ERROR, "用户信息处理异常" + e.getMessage()); } finally { if (businessServiceDataFlow == null) { return null; } //这里记录日志 Date endDate = DateUtil.getCurrentDate(); businessServiceDataFlow.setEndDate(endDate); //添加耗时 DataFlowFactory.addCostTime(businessServiceDataFlow, "service", "业务处理总耗时", businessServiceDataFlow.getStartDate(), businessServiceDataFlow.getEndDate()); //保存耗时 saveCostTimeLogMessage(businessServiceDataFlow); //保存日志 saveLogMessage(businessServiceDataFlow); } return businessServiceDataFlow.getResJson(); } /** * 保存日志信息 * * @param businessServiceDataFlow */ private void saveLogMessage(BusinessServiceDataFlow businessServiceDataFlow) { try { if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_LOG_ON_OFF))) { for (DataFlowLog dataFlowLog : businessServiceDataFlow.getLogDatas()) { KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_LOG_NAME, "", JSONObject.toJSONString(dataFlowLog)); } } } catch (Exception e) { logger.error("报错日志出错了,", e); } } /** * 保存耗时信息 * * @param businessServiceDataFlow */ private void saveCostTimeLogMessage(BusinessServiceDataFlow businessServiceDataFlow) { try { if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_COST_TIME_ON_OFF))) { List<DataFlowLinksCost> dataFlowLinksCosts = businessServiceDataFlow.getLinksCostDates(); JSONObject costDate = new JSONObject(); JSONArray costDates = new JSONArray(); JSONObject newObj = null; for (DataFlowLinksCost dataFlowLinksCost : dataFlowLinksCosts) { newObj = JSONObject.parseObject(JSONObject.toJSONString(dataFlowLinksCost)); newObj.put("dataFlowId", businessServiceDataFlow.getDataFlowId()); newObj.put("transactionId", businessServiceDataFlow.getTransactionId()); costDates.add(newObj); } costDate.put("costDates", costDates); KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_COST_TIME_LOG_NAME, "", costDate.toJSONString()); } } catch (Exception e) { logger.error("报错日志出错了,", e); } } } service-goods/src/main/resources/application-dev.yml
New file @@ -0,0 +1,85 @@ jedis: pool: config: maxTotal: 100 maxIdle: 20 maxWaitMillis: 20000 host: dev.redis.java110.com port: 6379 timeout: 3000 password: hc eureka: instance: leaseRenewalIntervalInSeconds: 10 leaseExpirationDurationInSeconds: 30 preferIpAddress: true instanceId: ${spring.cloud.client.ip-address}:${server.port} client: serviceUrl: defaultZone: http://dev.java110.com:8761/eureka/ #defaultZone: http://localhost:8761/eureka/ server: port: 8014 tomcat: uri-encoding: UTF-8 spring: profiles: active: share http: encoding: charset: UTF-8 enabled: true force: true application: name: goods-service redis: database: 0 host: dev.redis.java110.com port: 6379 password: hc pool: max-active: 300 max-wait: 10000 max-idle: 100 min-idle: 0 timeout: 0 feign: client: config: default: connect-timeout: 10000 read-timeout: 20000 #============== kafka =================== kafka: consumer: zookeeper: connect: dev.zk.java110.com:2181 servers: dev.kafka.java110.com:9092 enable: auto: commit: true session: timeout: 6000 auto: commit: interval: 100 offset: reset: latest topic: test group: id: goodsBusinessStatus concurrency: 10 producer: zookeeper: connect: dev.zk.java110.com:2181 servers: dev.kafka.java110.com:9092 retries: 0 batch: size: 4096 linger: 1 buffer: memory: 40960 service-goods/src/main/resources/application-prod.yml
New file @@ -0,0 +1,97 @@ jedis: pool: config: maxTotal: 100 maxIdle: 20 maxWaitMillis: 20000 host: prod.redis.java110.com port: 6379 timeout: 3000 password: hc eureka: instance: leaseRenewalIntervalInSeconds: 10 leaseExpirationDurationInSeconds: 30 preferIpAddress: true instanceId: ${spring.cloud.client.ip-address}:${server.port} client: serviceUrl: defaultZone: http://prod.java110.com:8761/eureka/ #defaultZone: http://localhost:8761/eureka/ server: port: 8014 tomcat: uri-encoding: UTF-8 spring: http: encoding: charset: UTF-8 enabled: true force: true application: name: goods-service redis: database: 0 host: prod.redis.java110.com port: 6379 password: hc pool: max-active: 300 max-wait: 10000 max-idle: 100 min-idle: 0 timeout: 0 datasource: connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 minIdle: 5 validationQuery: SELECT 1 FROM DUAL initialSize: 5 maxWait: 60000 filters: stat,wall,log4j poolPreparedStatements: true type: com.alibaba.druid.pool.DruidDataSource url: jdbc:mysql://prod.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8 maxPoolPreparedStatementPerConnectionSize: 20 password: TT@12345678 testOnBorrow: false testWhileIdle: true minEvictableIdleTimeMillis: 300000 timeBetweenEvictionRunsMillis: 60000 testOnReturn: false driverClassName: com.mysql.cj.jdbc.Driver maxActive: 20 username: TT #============== kafka =================== kafka: consumer: zookeeper: connect: prod.zk.java110.com:2181 servers: prod.kafka.java110.com:9092 enable: auto: commit: true session: timeout: 6000 auto: commit: interval: 100 offset: reset: latest topic: test group: id: goodsBusinessStatus concurrency: 10 producer: zookeeper: connect: prod.zk.java110.com:2181 servers: prod.kafka.java110.com:9092 retries: 0 batch: size: 4096 linger: 1 buffer: memory: 40960 service-goods/src/main/resources/application-test.yml
New file @@ -0,0 +1,97 @@ jedis: pool: config: maxTotal: 100 maxIdle: 20 maxWaitMillis: 20000 host: test.redis.java110.com port: 6379 timeout: 3000 password: hc eureka: instance: leaseRenewalIntervalInSeconds: 10 leaseExpirationDurationInSeconds: 30 preferIpAddress: true instanceId: ${spring.cloud.client.ip-address}:${server.port} client: serviceUrl: defaultZone: http://test.java110.com:8761/eureka/ #defaultZone: http://localhost:8761/eureka/ server: port: 8014 tomcat: uri-encoding: UTF-8 spring: http: encoding: charset: UTF-8 enabled: true force: true application: name: goods-service redis: database: 0 host: test.redis.java110.com port: 6379 password: hc pool: max-active: 300 max-wait: 10000 max-idle: 100 min-idle: 0 timeout: 0 datasource: connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 minIdle: 5 validationQuery: SELECT 1 FROM DUAL initialSize: 5 maxWait: 60000 filters: stat,wall,log4j poolPreparedStatements: true type: com.alibaba.druid.pool.DruidDataSource url: jdbc:mysql://test.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8 maxPoolPreparedStatementPerConnectionSize: 20 password: TT@12345678 testOnBorrow: false testWhileIdle: true minEvictableIdleTimeMillis: 300000 timeBetweenEvictionRunsMillis: 60000 testOnReturn: false driverClassName: com.mysql.cj.jdbc.Driver maxActive: 20 username: TT #============== kafka =================== kafka: consumer: zookeeper: connect: test.zk.java110.com:2181 servers: test.kafka.java110.com:9092 enable: auto: commit: true session: timeout: 6000 auto: commit: interval: 100 offset: reset: latest topic: test group: id: goodsBusinessStatus concurrency: 10 producer: zookeeper: connect: test.zk.java110.com:2181 servers: test.kafka.java110.com:9092 retries: 0 batch: size: 4096 linger: 1 buffer: memory: 40960 service-goods/src/main/resources/application.yml
New file @@ -0,0 +1,3 @@ spring: profiles: active: dev service-goods/src/main/resources/banner.txt
New file @@ -0,0 +1,15 @@ ${AnsiColor.BRIGHT_RED} __ ____ ___________ |__|____ ___ _______ /_ /_ \ _ \ | \__ \\ \/ /\__ \ | || / /_\ \ | |/ __ \\ / / __ \| || \ \_/ \ /\__| (____ /\_/ (____ /___||___|\_____ / \______| \/ \/ \/ ____ ___ _________ .__ | | \______ ___________/ _____/ ______________ _|__| ____ ____ | | / ___// __ \_ __ \_____ \_/ __ \_ __ \ \/ / |/ ___\/ __ \ | | /\___ \\ ___/| | \/ \ ___/| | \/\ /| \ \__\ ___/ |______//____ >\___ >__| /_______ /\___ >__| \_/ |__|\___ >___ > \/ \/ \/ \/ \/ \/ java110 GoodsService starting, more information scan https://github.com/java110/MicroCommunity service-goods/src/main/resources/dataSource.yml
New file @@ -0,0 +1,75 @@ dataSources: ds0: !!com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver url: jdbc:mysql://dev.db.java110.com:3306/hc_community?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 username: hc_community password: hc_community@12345678 minIdle: 5 validationQuery: SELECT 1 FROM DUAL initialSize: 5 maxWait: 60000 filters: stat,wall,log4j poolPreparedStatements: true # ds0_slave0: !!com.alibaba.druid.pool.DruidDataSource # driverClassName: com.mysql.jdbc.Driver # url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8 # username: TT # password: TT@12345678 # connectionTimeoutMilliseconds: 30000 # idleTimeoutMilliseconds: 60000 # maxPoolSize: 50 # minPoolSize: 1 # maintenanceIntervalMilliseconds: 30000 ds1: !!com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 username: TT password: TT@12345678 minIdle: 5 validationQuery: SELECT 1 FROM DUAL initialSize: 5 maxWait: 60000 filters: stat,wall,log4j poolPreparedStatements: true # ds1_slave0: !!com.alibaba.druid.pool.DruidDataSource # driverClassName: com.mysql.jdbc.Driver # url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8 # username: TT # password: TT@12345678 # connectionTimeoutMilliseconds: 30000 # idleTimeoutMilliseconds: 60000 # maxPoolSize: 50 # minPoolSize: 1 # maintenanceIntervalMilliseconds: 30000 shardingRule: tables: business_xxx: actualDataNodes: ds${0..1}.business_community databaseStrategy: inline: shardingColumn: community_id algorithmExpression: ds${Long.parseLong(community_id) % 2} bindingTables: - business_xxx defaultDataSourceName: ds1 defaultDatabaseStrategy: none: defaultTableStrategy: none: # masterSlaveRules: # ms_ds0: # masterDataSourceName: ds0 # slaveDataSourceNames: # - ds0_slave0 # loadBalanceAlgorithmType: ROUND_ROBIN # ms_ds1: # masterDataSourceName: ds1 # slaveDataSourceNames: # - ds1_slave0 # loadBalanceAlgorithmType: ROUND_ROBIN props: sql.show: true service-goods/src/main/resources/java110.properties
New file @@ -0,0 +1,3 @@ java110.mappingPath=classpath:mapper/goods/*.xml service-rule/README.md
File was deleted service-rule/pom.xml
File was deleted service-rule/src/main/java/com/java110/rule/AppSpringBootApplication.java
File was deleted service-rule/src/main/java/com/java110/rule/common/RuleCommon.java
File was deleted service-rule/src/main/java/com/java110/rule/dao/IRuleDao.java
File was deleted service-rule/src/main/java/com/java110/rule/dao/impl/RuleDaoImpl.java
File was deleted service-rule/src/main/java/com/java110/rule/rest/RuleServiceRest.java
File was deleted service-rule/src/main/java/com/java110/rule/service/RuleService.java
File was deleted service-rule/src/main/java/com/java110/rule/smo/IRuleServiceSMO.java
File was deleted service-rule/src/main/java/com/java110/rule/smo/impl/RuleServiceSMOImpl.java
File was deleted service-rule/src/main/java/com/java110/rule/thread/RuleCommonThread.java
File was deleted service-rule/src/test/java/com/java110/AppTest.java
File was deleted