lijilei 3 лет назад
Родитель
Сommit
bc293ec3d1
29 измененных файлов с 207 добавлено и 554 удалено
  1. 7 7
      book-dao/src/main/java/com/book/dao/config/CpsshardDataSourceConfig.java
  2. 7 7
      book-dao/src/main/java/com/book/dao/config/PolarDataSourceConfig.java
  3. 7 2
      book-push/src/main/java/com/book/push/Application.java
  4. 5 1
      book-push/src/main/java/com/book/push/config/RedisConfiguration.java
  5. 6 4
      book-push/src/main/java/com/book/push/config/RedisProperties.java
  6. 1 1
      book-push/src/main/java/com/book/push/controller/BookIndexController.java
  7. 0 191
      book-push/src/main/java/com/book/push/controller/WxMenuController.java
  8. 0 133
      book-push/src/main/java/com/book/push/controller/WxPortalController.java
  9. 5 3
      book-push/src/main/java/com/book/push/controller/WxRedirectController.java
  10. 1 2
      book-push/src/main/java/com/book/push/service/dao/AdminConfigService.java
  11. 3 2
      book-push/src/main/java/com/book/push/service/dao/ConfigService.java
  12. 2 1
      book-push/src/main/java/com/book/push/service/dao/CustomService.java
  13. 2 1
      book-push/src/main/java/com/book/push/service/dao/OpHostService.java
  14. 2 1
      book-push/src/main/java/com/book/push/service/dao/PlatformService.java
  15. 2 1
      book-push/src/main/java/com/book/push/service/dao/UserService.java
  16. 3 2
      book-push/src/main/java/com/book/push/service/dao/UserSilentService.java
  17. 4 4
      book-push/src/main/java/com/book/push/service/dao/impl/AdminConfigServiceImpl.java
  18. 3 3
      book-push/src/main/java/com/book/push/service/dao/impl/ConfigServiceImpl.java
  19. 3 3
      book-push/src/main/java/com/book/push/service/dao/impl/CustomServiceImpl.java
  20. 3 3
      book-push/src/main/java/com/book/push/service/dao/impl/OpHostServiceImpl.java
  21. 3 3
      book-push/src/main/java/com/book/push/service/dao/impl/PlatformServiceImpl.java
  22. 3 3
      book-push/src/main/java/com/book/push/service/dao/impl/UserServiceImpl.java
  23. 5 5
      book-push/src/main/java/com/book/push/service/dao/impl/UserSilentServiceImpl.java
  24. 1 1
      book-push/src/main/java/com/book/push/service/redis/impl/RedisServiceImpl.java
  25. 5 3
      book-push/src/main/java/com/book/push/service/wx/impl/WxThirdPartServiceImpl.java
  26. 2 2
      book-push/src/main/java/com/book/push/task/CacheTask.java
  27. 119 56
      book-push/src/main/resources/application-dev.yml
  28. 3 4
      book-push/src/main/resources/application.yml
  29. 0 105
      book-server/src/main/resources/application-dev.yml

+ 7 - 7
book-dao/src/main/java/com/book/dao/config/CpsshardDataSourceConfig.java

@@ -15,30 +15,30 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager;
 import javax.sql.DataSource;
 
 @Configuration
-@MapperScan(basePackages = "com.book.dao.cpsshard.mapper", sqlSessionTemplateRef  = "mainSqlSessionTemplate")
+@MapperScan(basePackages = "com.book.dao.cpsshard.mapper", sqlSessionTemplateRef  = "cpsshardSqlSessionTemplate")
 public class CpsshardDataSourceConfig {
 
     @Bean(name = "cpsshardDataSource")
     @ConfigurationProperties(prefix = "spring.datasource.cpsshard")
-    public DataSource mainDataSource() {
+    public DataSource cpsshardDataSource() {
         return DataSourceBuilder.create().build();
     }
 
     @Bean(name = "cpsshardSqlSessionFactory")
-    public SqlSessionFactory mainSqlSessionFactory(@Qualifier("cpsshardDataSource") DataSource dataSource) throws Exception {
+    public SqlSessionFactory cpsshardSqlSessionFactory(@Qualifier("cpsshardDataSource") DataSource dataSource) throws Exception {
         SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
         bean.setDataSource(dataSource);
          bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/cpsshard/*.xml"));
        return bean.getObject();
     }
 
-    @Bean(name = "mainTransactionManager")
-    public DataSourceTransactionManager mainTransactionManager(@Qualifier("cpsshardDataSource") DataSource dataSource) {
+    @Bean(name = "cpsshardTransactionManager")
+    public DataSourceTransactionManager cpsshardTransactionManager(@Qualifier("cpsshardDataSource") DataSource dataSource) {
         return new DataSourceTransactionManager(dataSource);
     }
 
-    @Bean(name = "mainSqlSessionTemplate")
-    public SqlSessionTemplate mainSqlSessionTemplate(@Qualifier("cpsshardSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
+    @Bean(name = "cpsshardSqlSessionTemplate")
+    public SqlSessionTemplate cpsshardSqlSessionTemplate(@Qualifier("cpsshardSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
         return new SqlSessionTemplate(sqlSessionFactory);
     }
 }

+ 7 - 7
book-dao/src/main/java/com/book/dao/config/PolarDataSourceConfig.java

@@ -16,30 +16,30 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager;
 import javax.sql.DataSource;
 
 @Configuration
-@MapperScan(basePackages = "com.book.dao.polardb.mapper", sqlSessionTemplateRef  = "mainSqlSessionTemplate")
+@MapperScan(basePackages = "com.book.dao.polardb.mapper", sqlSessionTemplateRef  = "polarSqlSessionTemplate")
 public class PolarDataSourceConfig {
 
     @Bean(name = "polarDataSource")
     @ConfigurationProperties(prefix = "spring.datasource.polar")
-    public DataSource mainDataSource() {
+    public DataSource polarDataSource() {
         return DataSourceBuilder.create().build();
     }
 
     @Bean(name = "polarSqlSessionFactory")
-    public SqlSessionFactory mainSqlSessionFactory(@Qualifier("polarDataSource") DataSource dataSource) throws Exception {
+    public SqlSessionFactory polarSqlSessionFactory(@Qualifier("polarDataSource") DataSource dataSource) throws Exception {
         SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
         bean.setDataSource(dataSource);
          bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/polar/*.xml"));
        return bean.getObject();
     }
 
-    @Bean(name = "mainTransactionManager")
-    public DataSourceTransactionManager mainTransactionManager(@Qualifier("polarDataSource") DataSource dataSource) {
+    @Bean(name = "polarTransactionManager")
+    public DataSourceTransactionManager polarTransactionManager(@Qualifier("polarDataSource") DataSource dataSource) {
         return new DataSourceTransactionManager(dataSource);
     }
 
-    @Bean(name = "mainSqlSessionTemplate")
-    public SqlSessionTemplate mainSqlSessionTemplate(@Qualifier("polarSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
+    @Bean(name = "polarSqlSessionTemplate")
+    public SqlSessionTemplate polarSqlSessionTemplate(@Qualifier("polarSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
         return new SqlSessionTemplate(sqlSessionFactory);
     }
 }

+ 7 - 2
book-push/src/main/java/com/book/push/Application.java

@@ -1,17 +1,22 @@
 package com.book.push;
 
-import org.mybatis.spring.annotation.MapperScan;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
 
 
 /**
  * @author win7
  */
 @SpringBootApplication
-@MapperScan("com.book.push.dao.mapper")
+@Slf4j
+@ComponentScan({"com.book.dao","com.book.push"})
 public class Application {
     public static void main(String[] args) {
         SpringApplication.run(Application.class);
+        System.out.println("----------------------------------------------------------------------------------");
+        System.out.println("--------              application book-push run success                 ----------");
+        System.out.println("----------------------------------------------------------------------------------");
     }
 }

+ 5 - 1
book-push/src/main/java/com/book/push/config/RedisConfiguration.java

@@ -25,7 +25,7 @@ public class RedisConfiguration {
         JedisPoolConfig config = new JedisPoolConfig();
         config.setMaxTotal(redisProperties.getMaxActive());
         config.setMaxIdle(redisProperties.getMaxIdle());
-        config.setMaxWaitMillis(redisProperties.getMaxWaitMillis());
+        config.setMaxWaitMillis(redisProperties.getMaxWait());
 
         JedisPool jedisPool;
         if (StringUtils.isEmpty(redisProperties.getPassword())) {
@@ -37,4 +37,8 @@ public class RedisConfiguration {
         return jedisPool;
 
     }
+  /*  @Autowired
+    public void setRedisProperties(RedisProperties redisProperties) {
+        this.redisProperties = redisProperties;
+    }*/
 }

+ 6 - 4
book-push/src/main/java/com/book/push/config/RedisProperties.java

@@ -2,6 +2,7 @@ package com.book.push.config;
 
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
 
 import static com.book.push.config.RedisProperties.PREFIX;
 
@@ -13,10 +14,11 @@ import static com.book.push.config.RedisProperties.PREFIX;
  *
  * @author win7
  */
+@Component
 @Data
 @ConfigurationProperties(PREFIX)
 public class RedisProperties {
-    public static final String PREFIX = "redis";
+    public static final String PREFIX = "book.redis";
     /**
      * 主机地址
      */
@@ -28,7 +30,7 @@ public class RedisProperties {
     /**
      * 密码
      */
-    private String password;
+    private String password ="";
     /**
      * 超时时间
      */
@@ -41,7 +43,7 @@ public class RedisProperties {
     /**
      * 最大活跃数
      */
-    private Integer maxActive;
+    private Integer maxActive = 500;
     /**
      * 最大空闲连接数
      */
@@ -53,7 +55,7 @@ public class RedisProperties {
     /**
      * 等待可用连接的最大时间
      */
-    private Integer maxWaitMillis;
+    private Integer maxWait;
 
 
 

+ 1 - 1
book-push/src/main/java/com/book/push/controller/BookIndexController.java

@@ -7,8 +7,8 @@ package com.book.push.controller;
  * @author win7
  */
 
+import com.book.dao.cps.pojo.AdminConfig;
 import com.book.push.cons.UrlCons;
-import com.book.push.dao.pojo.AdminConfig;
 import com.book.push.service.dao.AdminConfigService;
 import com.book.push.service.wx.WxThirdPartService;
 import lombok.AllArgsConstructor;

+ 0 - 191
book-push/src/main/java/com/book/push/controller/WxMenuController.java

@@ -1,191 +0,0 @@
-package com.book.push.controller;
-
-import lombok.AllArgsConstructor;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.bean.menu.WxMenu;
-import me.chanjar.weixin.common.bean.menu.WxMenuButton;
-import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult;
-import me.chanjar.weixin.mp.bean.menu.WxMpMenu;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType;
-
-/**
- * @author
- * 创建自定义菜单
- * 目前版本用不到,暂时废弃
- */
-@Deprecated
-@AllArgsConstructor
-@RestController
-@RequestMapping("/wx/menu/{appid}")
-public class WxMenuController {
-    private final WxMpService wxService;
-
-    /**
-     * <pre>
-     * 自定义菜单创建接口
-     * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN
-     * 如果要创建个性化菜单,请设置matchrule属性
-     * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
-     * </pre>
-     *
-     * @return 如果是个性化菜单,则返回menuid,否则返回null
-     */
-    @PostMapping("/create")
-    public String menuCreate(@PathVariable String appid, @RequestBody WxMenu menu) throws WxErrorException {
-        return this.wxService.switchoverTo(appid).getMenuService().menuCreate(menu);
-    }
-
-    @GetMapping("/create")
-    public String menuCreateSample(@PathVariable String appid) throws WxErrorException, MalformedURLException {
-        WxMenu menu = new WxMenu();
-        WxMenuButton button1 = new WxMenuButton();
-        button1.setType(MenuButtonType.CLICK);
-        button1.setName("今日歌曲");
-        button1.setKey("V1001_TODAY_MUSIC");
-
-//        WxMenuButton button2 = new WxMenuButton();
-//        button2.setType(WxConsts.BUTTON_MINIPROGRAM);
-//        button2.setName("小程序");
-//        button2.setAppId("wx286b93c14bbf93aa");
-//        button2.setPagePath("pages/lunar/index.html");
-//        button2.setUrl("http://mp.weixin.qq.com");
-
-        WxMenuButton button3 = new WxMenuButton();
-        button3.setName("菜单");
-
-        menu.getButtons().add(button1);
-//        menu.getButtons().add(button2);
-        menu.getButtons().add(button3);
-
-        WxMenuButton button31 = new WxMenuButton();
-        button31.setType(MenuButtonType.VIEW);
-        button31.setName("搜索");
-        button31.setUrl("http://www.soso.com/");
-
-        WxMenuButton button32 = new WxMenuButton();
-        button32.setType(MenuButtonType.VIEW);
-        button32.setName("视频");
-        button32.setUrl("http://v.qq.com/");
-
-        WxMenuButton button33 = new WxMenuButton();
-        button33.setType(MenuButtonType.CLICK);
-        button33.setName("赞一下我们");
-        button33.setKey("V1001_GOOD");
-
-        WxMenuButton button34 = new WxMenuButton();
-        button34.setType(MenuButtonType.VIEW);
-        button34.setName("获取用户信息");
-
-        ServletRequestAttributes servletRequestAttributes =
-            (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
-        if (servletRequestAttributes != null) {
-            HttpServletRequest request = servletRequestAttributes.getRequest();
-            URL requestURL = new URL(request.getRequestURL().toString());
-            String url = this.wxService.switchoverTo(appid).getOAuth2Service().buildAuthorizationUrl(
-                String.format("%s://%s/wx/redirect/%s/greet", requestURL.getProtocol(), requestURL.getHost(), appid),
-                WxConsts.OAuth2Scope.SNSAPI_USERINFO, null);
-            button34.setUrl(url);
-        }
-
-        button3.getSubButtons().add(button31);
-        button3.getSubButtons().add(button32);
-        button3.getSubButtons().add(button33);
-        button3.getSubButtons().add(button34);
-
-        this.wxService.switchover(appid);
-        return this.wxService.getMenuService().menuCreate(menu);
-    }
-
-    /**
-     * <pre>
-     * 自定义菜单创建接口
-     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN
-     * 如果要创建个性化菜单,请设置matchrule属性
-     * 详情请见:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
-     * </pre>
-     *
-     * @return 如果是个性化菜单,则返回menuid,否则返回null
-     */
-    @PostMapping("/createByJson")
-    public String menuCreate(@PathVariable String appid, @RequestBody String json) throws WxErrorException {
-        return this.wxService.switchoverTo(appid).getMenuService().menuCreate(json);
-    }
-
-    /**
-     * <pre>
-     * 自定义菜单删除接口
-     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141015&token=&lang=zh_CN
-     * </pre>
-     */
-    @GetMapping("/delete")
-    public void menuDelete(@PathVariable String appid) throws WxErrorException {
-        this.wxService.switchoverTo(appid).getMenuService().menuDelete();
-    }
-
-    /**
-     * <pre>
-     * 删除个性化菜单接口
-     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN
-     * </pre>
-     *
-     * @param menuId 个性化菜单的menuid
-     */
-    @GetMapping("/delete/{menuId}")
-    public void menuDelete(@PathVariable String appid, @PathVariable String menuId) throws WxErrorException {
-        this.wxService.switchoverTo(appid).getMenuService().menuDelete(menuId);
-    }
-
-    /**
-     * <pre>
-     * 自定义菜单查询接口
-     * 详情请见: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141014&token=&lang=zh_CN
-     * </pre>
-     */
-    @GetMapping("/get")
-    public WxMpMenu menuGet(@PathVariable String appid) throws WxErrorException {
-        return this.wxService.switchoverTo(appid).getMenuService().menuGet();
-    }
-
-    /**
-     * <pre>
-     * 测试个性化菜单匹配结果
-     * 详情请见: http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
-     * </pre>
-     *
-     * @param userid 可以是粉丝的OpenID,也可以是粉丝的微信号。
-     */
-    @GetMapping("/menuTryMatch/{userid}")
-    public WxMenu menuTryMatch(@PathVariable String appid, @PathVariable String userid) throws WxErrorException {
-        return this.wxService.switchoverTo(appid).getMenuService().menuTryMatch(userid);
-    }
-
-    /**
-     * <pre>
-     * 获取自定义菜单配置接口
-     * 本接口将会提供公众号当前使用的自定义菜单的配置,如果公众号是通过API调用设置的菜单,则返回菜单的开发配置,而如果公众号是在公众平台官网通过网站功能发布菜单,则本接口返回运营者设置的菜单配置。
-     * 请注意:
-     * 1、第三方平台开发者可以通过本接口,在旗下公众号将业务授权给你后,立即通过本接口检测公众号的自定义菜单配置,并通过接口再次给公众号设置好自动回复规则,以提升公众号运营者的业务体验。
-     * 2、本接口与自定义菜单查询接口的不同之处在于,本接口无论公众号的接口是如何设置的,都能查询到接口,而自定义菜单查询接口则仅能查询到使用API设置的菜单配置。
-     * 3、认证/未认证的服务号/订阅号,以及接口测试号,均拥有该接口权限。
-     * 4、从第三方平台的公众号登录授权机制上来说,该接口从属于消息与菜单权限集。
-     * 5、本接口中返回的图片/语音/视频为临时素材(临时素材每次获取都不同,3天内有效,通过素材管理-获取临时素材接口来获取这些素材),本接口返回的图文消息为永久素材素材(通过素材管理-获取永久素材接口来获取这些素材)。
-     *  接口调用请求说明:
-     * http请求方式: GET(请使用https协议)
-     * https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token=ACCESS_TOKEN
-     * </pre>
-     */
-    @GetMapping("/getSelfMenuInfo")
-    public WxMpGetSelfMenuInfoResult getSelfMenuInfo(@PathVariable String appid) throws WxErrorException {
-        return this.wxService.switchoverTo(appid).getMenuService().getSelfMenuInfo();
-    }
-}

+ 0 - 133
book-push/src/main/java/com/book/push/controller/WxPortalController.java

@@ -1,133 +0,0 @@
-package com.book.push.controller;
-
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.mp.api.WxMpMessageRouter;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * 微信认证
- * java系统现住应该没用,以后需要再放开
- *
- * @author
- */
-@Deprecated
-@Slf4j
-@AllArgsConstructor
-@RestController
-@RequestMapping("/wx/portal/{appid}")
-public class WxPortalController {
-    private final WxMpService wxService;
-    private final WxMpMessageRouter messageRouter;
-
-    /**
-     * GET
-     *
-     * @param appid
-     * @param signature
-     * @param timestamp
-     * @param nonce
-     * @param echostr
-     * @return
-     */
-    @GetMapping(produces = "text/plain;charset=utf-8")
-    public String authGet(@PathVariable String appid,
-                          @RequestParam(name = "signature", required = false) String signature,
-                          @RequestParam(name = "timestamp", required = false) String timestamp,
-                          @RequestParam(name = "nonce", required = false) String nonce,
-                          @RequestParam(name = "echostr", required = false) String echostr) {
-
-        log.info("\n接收到来自微信服务器的认证消息:[{}, {}, {}, {}]", signature,
-                timestamp, nonce, echostr);
-        if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) {
-            throw new IllegalArgumentException("请求参数非法,请核实!");
-        }
-
-        if (!this.wxService.switchover(appid)) {
-            throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid));
-        }
-
-        if (wxService.checkSignature(timestamp, nonce, signature)) {
-            return echostr;
-        }
-
-        return "非法请求";
-    }
-
-
-    /**
-     * POST
-     *
-     * @param appid
-     * @param requestBody
-     * @param signature
-     * @param timestamp
-     * @param nonce
-     * @param openid
-     * @param encType
-     * @param msgSignature
-     * @return
-     */
-    @PostMapping(produces = "application/xml; charset=UTF-8")
-    public String post(@PathVariable String appid,
-                       @RequestBody String requestBody,
-                       @RequestParam("signature") String signature,
-                       @RequestParam("timestamp") String timestamp,
-                       @RequestParam("nonce") String nonce,
-                       @RequestParam("openid") String openid,
-                       @RequestParam(name = "encrypt_type", required = false) String encType,
-                       @RequestParam(name = "msg_signature", required = false) String msgSignature) {
-        log.info("\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
-                        + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
-                openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
-
-        if (!this.wxService.switchover(appid)) {
-            throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid));
-        }
-
-        if (!wxService.checkSignature(timestamp, nonce, signature)) {
-            throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
-        }
-
-        String out = null;
-        if (encType == null) {
-            // 明文传输的消息
-            WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody);
-            WxMpXmlOutMessage outMessage = this.route(inMessage);
-            if (outMessage == null) {
-                return "";
-            }
-
-            out = outMessage.toXml();
-        } else if ("aes".equalsIgnoreCase(encType)) {
-            // aes加密的消息
-            WxMpXmlMessage inMessage = WxMpXmlMessage.fromEncryptedXml(requestBody, wxService.getWxMpConfigStorage(),
-                    timestamp, nonce, msgSignature);
-            log.debug("\n消息解密后内容为:\n{} ", inMessage.toString());
-            WxMpXmlOutMessage outMessage = this.route(inMessage);
-            if (outMessage == null) {
-                return "";
-            }
-
-            out = outMessage.toEncryptedXml(wxService.getWxMpConfigStorage());
-        }
-
-        log.debug("\n组装回复信息:{}", out);
-        return out;
-    }
-
-    private WxMpXmlOutMessage route(WxMpXmlMessage message) {
-        try {
-            return this.messageRouter.route(message);
-        } catch (Exception e) {
-            log.error("路由消息时出现异常!", e);
-        }
-
-        return null;
-    }
-
-}

+ 5 - 3
book-push/src/main/java/com/book/push/controller/WxRedirectController.java

@@ -1,10 +1,12 @@
 package com.book.push.controller;
 
+import com.book.dao.cps.pojo.*;
+import com.book.dao.cps.pojo.Ophost;
+import com.book.dao.polardb.pojo.UserSilent;
 import com.book.push.cons.SchemeCons;
 import com.book.push.cons.SiteCons;
 import com.book.push.cons.UrlCons;
-import com.book.push.dao.pojo.*;
-import com.book.push.service.UserSilentService;
+import com.book.push.service.dao.UserSilentService;
 import com.book.push.service.dao.AdminConfigService;
 import com.book.push.service.dao.ConfigService;
 import com.book.push.service.dao.OpHostService;
@@ -33,7 +35,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 @Controller
 @RequestMapping("/wx/redirect/{appid}")
 public class WxRedirectController {
-    private Logger logger = LoggerFactory.getLogger(getClass());
+    public static final Logger logger = LoggerFactory.getLogger(WxRedirectController.class);
     @Autowired
     private UserService userService;
     @Autowired

+ 1 - 2
book-push/src/main/java/com/book/push/service/dao/AdminConfigService.java

@@ -1,7 +1,6 @@
 package com.book.push.service.dao;
 
-import com.book.push.dao.mapper.AdminConfigMapper;
-import com.book.push.dao.pojo.AdminConfig;
+import com.book.dao.cps.pojo.AdminConfig;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 3 - 2
book-push/src/main/java/com/book/push/service/dao/ConfigService.java

@@ -1,6 +1,8 @@
 package com.book.push.service.dao;
 
-import com.book.push.dao.pojo.Config;
+
+import com.book.dao.cps.pojo.Config;
+import org.springframework.stereotype.Service;
 
 /**
  * created in 2021/8/20
@@ -8,7 +10,6 @@ import com.book.push.dao.pojo.Config;
  *
  * @author win7
  */
-
 public interface ConfigService {
  Config selectByName(String name);
 }

+ 2 - 1
book-push/src/main/java/com/book/push/service/dao/CustomService.java

@@ -1,6 +1,7 @@
 package com.book.push.service.dao;
 
-import com.book.push.dao.pojo.Custom;
+
+import com.book.dao.cps.pojo.Custom;
 
 import java.util.List;
 

+ 2 - 1
book-push/src/main/java/com/book/push/service/dao/OpHostService.java

@@ -1,6 +1,7 @@
 package com.book.push.service.dao;
 
-import com.book.push.dao.pojo.Ophost;
+
+import com.book.dao.cps.pojo.Ophost;
 
 /**
  * created in 2021/8/20

+ 2 - 1
book-push/src/main/java/com/book/push/service/dao/PlatformService.java

@@ -1,6 +1,7 @@
 package com.book.push.service.dao;
 
-import com.book.push.dao.pojo.Platform;
+
+import com.book.dao.cps.pojo.Platform;
 
 import java.util.Map;
 

+ 2 - 1
book-push/src/main/java/com/book/push/service/dao/UserService.java

@@ -1,6 +1,7 @@
 package com.book.push.service.dao;
 
-import com.book.push.dao.pojo.User;
+
+import com.book.dao.cps.pojo.User;
 
 /**
  * created in 2021/8/17

+ 3 - 2
book-push/src/main/java/com/book/push/service/UserSilentService.java → book-push/src/main/java/com/book/push/service/dao/UserSilentService.java

@@ -1,6 +1,7 @@
-package com.book.push.service;
+package com.book.push.service.dao;
 
-import com.book.push.dao.pojo.UserSilent;
+
+import com.book.dao.polardb.pojo.UserSilent;
 
 /**
  * created in 2021/8/20

+ 4 - 4
book-push/src/main/java/com/book/push/service/dao/impl/AdminConfigServiceImpl.java

@@ -1,7 +1,7 @@
 package com.book.push.service.dao.impl;
 
-import com.book.push.dao.mapper.AdminConfigMapper;
-import com.book.push.dao.pojo.AdminConfig;
+import com.book.dao.cps.mapper.AdminConfigMapper;
+import com.book.dao.cps.pojo.AdminConfig;
 import com.book.push.service.dao.AdminConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -16,7 +16,7 @@ import java.util.stream.Collectors;
  *
  * @author win7
  */
-@Service("adminConfigService")
+@Service
 public class AdminConfigServiceImpl implements AdminConfigService {
     @Autowired
     private AdminConfigMapper adminConfigMapper;
@@ -30,7 +30,7 @@ public class AdminConfigServiceImpl implements AdminConfigService {
 
     @Override
     public AdminConfig selectByAppid(String appid) {
-        return adminConfigMapper.selectByAppid();
+        return adminConfigMapper.selectByAppid(appid);
     }
 
     @Override

+ 3 - 3
book-push/src/main/java/com/book/push/service/dao/impl/ConfigServiceImpl.java

@@ -1,7 +1,7 @@
 package com.book.push.service.dao.impl;
 
-import com.book.push.dao.mapper.ConfigMapper;
-import com.book.push.dao.pojo.Config;
+import com.book.dao.cps.mapper.ConfigMapper;
+import com.book.dao.cps.pojo.Config;
 import com.book.push.service.dao.ConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  *
  * @author win7
  */
-@Service("configService")
+@Service
 public class ConfigServiceImpl implements ConfigService {
     @Autowired
     private ConfigMapper configMapper;

+ 3 - 3
book-push/src/main/java/com/book/push/service/dao/impl/CustomServiceImpl.java

@@ -1,7 +1,7 @@
 package com.book.push.service.dao.impl;
 
-import com.book.push.dao.mapper.CustomMapper;
-import com.book.push.dao.pojo.Custom;
+import com.book.dao.cps.mapper.CustomMapper;
+import com.book.dao.cps.pojo.Custom;
 import com.book.push.service.dao.CustomService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -14,7 +14,7 @@ import java.util.List;
  *
  * @author win7
  */
-@Service("customService")
+@Service
 public class CustomServiceImpl implements CustomService {
     @Autowired
     private CustomMapper customMapper;

+ 3 - 3
book-push/src/main/java/com/book/push/service/dao/impl/OpHostServiceImpl.java

@@ -1,7 +1,7 @@
 package com.book.push.service.dao.impl;
 
-import com.book.push.dao.mapper.OphostMapper;
-import com.book.push.dao.pojo.Ophost;
+import com.book.dao.cps.mapper.OphostMapper;
+import com.book.dao.cps.pojo.Ophost;
 import com.book.push.service.dao.OpHostService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  *
  * @author win7
  */
-@Service("opHostService")
+@Service
 public class OpHostServiceImpl implements OpHostService {
     @Autowired
     private OphostMapper ophostMapper;

+ 3 - 3
book-push/src/main/java/com/book/push/service/dao/impl/PlatformServiceImpl.java

@@ -1,7 +1,7 @@
 package com.book.push.service.dao.impl;
 
-import com.book.push.dao.mapper.PlatformMapper;
-import com.book.push.dao.pojo.Platform;
+import com.book.dao.cps.mapper.PlatformMapper;
+import com.book.dao.cps.pojo.Platform;
 import com.book.push.service.dao.PlatformService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -16,7 +16,7 @@ import java.util.stream.Collectors;
  *
  * @author win7
  */
-@Service("platformService")
+@Service
 public class PlatformServiceImpl implements PlatformService {
     @Autowired
     private PlatformMapper platformMapper;

+ 3 - 3
book-push/src/main/java/com/book/push/service/dao/impl/UserServiceImpl.java

@@ -1,7 +1,7 @@
 package com.book.push.service.dao.impl;
 
-import com.book.push.dao.mapper.UserMapper;
-import com.book.push.dao.pojo.User;
+import com.book.dao.cps.mapper.UserMapper;
+import com.book.dao.cps.pojo.User;
 import com.book.push.service.dao.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  *
  * @author win7
  */
-@Service("userService")
+@Service
 public class UserServiceImpl implements UserService {
     @Autowired
     private UserMapper userMapper;

+ 5 - 5
book-push/src/main/java/com/book/push/service/wx/impl/UserSilentServiceImpl.java → book-push/src/main/java/com/book/push/service/dao/impl/UserSilentServiceImpl.java

@@ -1,8 +1,8 @@
-package com.book.push.service.wx.impl;
+package com.book.push.service.dao.impl;
 
-import com.book.push.dao.mapper.UserSilentMapper;
-import com.book.push.dao.pojo.UserSilent;
-import com.book.push.service.UserSilentService;
+import com.book.dao.polardb.mapper.UserSilentMapper;
+import com.book.dao.polardb.pojo.UserSilent;
+import com.book.push.service.dao.UserSilentService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  *
  * @author win7
  */
-@Service("userSilentService")
+@Service
 public class UserSilentServiceImpl implements UserSilentService {
     @Autowired
     private UserSilentMapper userSilentMapper;

+ 1 - 1
book-push/src/main/java/com/book/push/service/redis/impl/RedisServiceImpl.java

@@ -13,7 +13,7 @@ import redis.clients.jedis.JedisPool;
  *
  * @author win7
  */
-@Service("redisService")
+@Service
 public class RedisServiceImpl implements RedisService {
     @Autowired
     private JedisPool jedisPool;

+ 5 - 3
book-push/src/main/java/com/book/push/service/wx/impl/WxThirdPartServiceImpl.java

@@ -1,11 +1,12 @@
 package com.book.push.service.wx.impl;
 
+import com.book.dao.cps.pojo.Platform;
 import com.book.push.config.RedisProperties;
-import com.book.push.dao.pojo.Platform;
 import com.book.push.handler.*;
 import com.book.push.service.dao.PlatformService;
 import com.book.push.service.wx.WxThirdPartService;
 import lombok.AllArgsConstructor;
+import lombok.RequiredArgsConstructor;
 import me.chanjar.weixin.open.api.WxOpenService;
 import me.chanjar.weixin.open.api.impl.WxOpenInRedisConfigStorage;
 import me.chanjar.weixin.open.api.impl.WxOpenServiceImpl;
@@ -36,10 +37,11 @@ import static me.chanjar.weixin.mp.constant.WxMpEventConstants.POI_CHECK_NOTIFY;
  * @author win7
  */
 @Service
-@AllArgsConstructor
+@RequiredArgsConstructor
 @EnableConfigurationProperties(RedisProperties.class)
 public class WxThirdPartServiceImpl implements WxThirdPartService {
-    private Logger logger = LoggerFactory.getLogger(getClass());
+//    private Logger logger = LoggerFactory.getLogger(getClass());
+
     private final LogHandler logHandler;
     private final NullHandler nullHandler;
     private final KfSessionHandler kfSessionHandler;

+ 2 - 2
book-push/src/main/java/com/book/push/task/CacheTask.java

@@ -8,8 +8,8 @@ package com.book.push.task;
  * @author win7
  */
 
-import com.book.push.dao.pojo.AdminConfig;
-import com.book.push.dao.pojo.Platform;
+import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.Platform;
 import com.book.push.service.dao.AdminConfigService;
 import com.book.push.service.dao.PlatformService;
 import org.springframework.beans.factory.annotation.Autowired;

+ 119 - 56
book-push/src/main/resources/application-dev.yml

@@ -1,64 +1,127 @@
 server:
   port: 8080
 
+book:
+  redis:
+    host: 127.0.0.1
+    port: 6379
+    database: 0
+    password:
+    timeout: 1000  # 数据库连接超时时间,2.0 中该参数的类型为Duration,这里在配置的时候需要指明单位
+    # 最大空闲连接数
+    maxIdle: 500
+    # 最小空闲连接数
+    minIdle: 50
+    # 等待可用连接的最大时间,负数为不限制
+    maxWait: -1
+    # 最大活跃连接数,负数为不限制
+    maxActive: -1
+    #  最大连接数
+
 spring:
   datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://121.41.100.198:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-    username: root
-    password: root
-    #下面为连接池补充设置
-    druid:
-      initial-size: 5 # 初始化
-      max-active: 5 # 最大
-      min-idle: 5 # 最小
-      max-wait: 6000 # 超时时间
-      time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
-      min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
-      # 检测链接是否有效的query
-      validation-query: SELECT 1 FROM DUAL
-      test-while-idle: true # 检测到链接空闲时,验证是否有效
-      test-on-borrow: false # 申请链接时,不检测
-      test-on-return: false # 返回链接时,不检测
-      pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
-      # 如果上面开启了游标,这里要设置一下大小,例如 50
-      max-pool-prepared-statement-per-connection-size: -1
-      # 统计、监控配置
-      filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
-      connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
-      use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
-      stat-view-servlet:
-        enabled: true
-        loginusername: tianyun
-        login-password: tianyunperfect
-        allow: # 默认运行所有
-        deny: # 默认即可
-        reset-enable: true
-
-
-mybatis:
-  type-aliases-package: com.book.server.entity
-  mapper-locations: classpath:mapper/*Mapper.xml
-
-
-redis:
-  host: 127.0.0.1
-  port: 6379
-  database: 0
-  password:
-  timeout: 1000s  # 数据库连接超时时间,2.0 中该参数的类型为Duration,这里在配置的时候需要指明单位
-  # 最大空闲连接数
-  max-idle: 500
-  # 最小空闲连接数
-  min-idle: 50
-  # 等待可用连接的最大时间,负数为不限制
-  max-wait: -1
-  # 最大活跃连接数,负数为不限制
-  max-active: -1
-#  最大连接数
-
+    cps:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      jdbc-url: jdbc:mysql://121.41.100.198:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: root
+      password: root
+      #下面为连接池补充设置
+      druid:
+        initial-size: 5 # 初始化
+        max-active: 5 # 最大
+        min-idle: 5 # 最小
+        max-wait: 6000 # 超时时间
+        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
+        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
+        # 检测链接是否有效的query
+        validation-query: SELECT 1 FROM DUAL
+        test-while-idle: true # 检测到链接空闲时,验证是否有效
+        test-on-borrow: false # 申请链接时,不检测
+        test-on-return: false # 返回链接时,不检测
+        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
+        # 如果上面开启了游标,这里要设置一下大小,例如 50
+        max-pool-prepared-statement-per-connection-size: -1
+        # 统计、监控配置
+        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
+        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
+        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
+        stat-view-servlet:
+          enabled: true
+          login-username: tianyun
+          login-password: tianyunperfect
+          allow: # 默认运行所有
+          deny: # 默认即可
+          reset-enable: true
+    polar:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      jdbc-url: jdbc:mysql://121.41.100.198:3306/polar?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: root
+      password: root
+      #下面为连接池补充设置
+      druid:
+        initial-size: 5 # 初始化
+        max-active: 5 # 最大
+        min-idle: 5 # 最小
+        max-wait: 6000 # 超时时间
+        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
+        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
+        # 检测链接是否有效的query
+        validation-query: SELECT 1 FROM DUAL
+        test-while-idle: true # 检测到链接空闲时,验证是否有效
+        test-on-borrow: false # 申请链接时,不检测
+        test-on-return: false # 返回链接时,不检测
+        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
+        # 如果上面开启了游标,这里要设置一下大小,例如 50
+        max-pool-prepared-statement-per-connection-size: -1
+        # 统计、监控配置
+        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
+        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
+        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
+        stat-view-servlet:
+          enabled: true
+          login-username: tianyun
+          login-password: tianyunperfect
+          allow: # 默认运行所有
+          deny: # 默认即可
+          reset-enable: true
+    cpsshard:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      jdbc-url: jdbc:mysql://121.41.100.198:3306/test_cps_shard_192?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: root
+      password: root
+      #下面为连接池补充设置
+      druid:
+        initial-size: 5 # 初始化
+        max-active: 5 # 最大
+        min-idle: 5 # 最小
+        max-wait: 6000 # 超时时间
+        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
+        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
+        # 检测链接是否有效的query
+        validation-query: SELECT 1 FROM DUAL
+        test-while-idle: true # 检测到链接空闲时,验证是否有效
+        test-on-borrow: false # 申请链接时,不检测
+        test-on-return: false # 返回链接时,不检测
+        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
+        # 如果上面开启了游标,这里要设置一下大小,例如 50
+        max-pool-prepared-statement-per-connection-size: -1
+        # 统计、监控配置
+        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
+        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
+        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
+        stat-view-servlet:
+          enabled: true
+          login-username: tianyun
+          login-password: tianyunperfect
+          allow: # 默认运行所有
+          deny: # 默认即可
+          reset-enable: true
 
 # 设置debug模式下打印mysql
 logging:

+ 3 - 4
book-push/src/main/resources/application.yml

@@ -1,5 +1,4 @@
 spring:
-  spring:
-    # 环境 dev:开发环境|test:测试环境|prod:生产环境
-    profiles:
-      active: dev #激活的配置文件
+  # 环境 dev:开发环境|test:测试环境|prod:生产环境
+  profiles:
+    active: dev #激活的配置文件

+ 0 - 105
book-server/src/main/resources/application-dev.yml

@@ -1,107 +1,2 @@
 server:
   port: 9999
-
-spring:
-  datasource:
-    cps:
-      type: com.alibaba.druid.pool.DruidDataSource
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      jdbc-url: jdbc:mysql://121.41.100.198:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-      username: root
-      password: root
-      #下面为连接池补充设置
-      druid:
-        initial-size: 5 # 初始化
-        max-active: 5 # 最大
-        min-idle: 5 # 最小
-        max-wait: 6000 # 超时时间
-        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
-        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
-        # 检测链接是否有效的query
-        validation-query: SELECT 1 FROM DUAL
-        test-while-idle: true # 检测到链接空闲时,验证是否有效
-        test-on-borrow: false # 申请链接时,不检测
-        test-on-return: false # 返回链接时,不检测
-        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
-        # 如果上面开启了游标,这里要设置一下大小,例如 50
-        max-pool-prepared-statement-per-connection-size: -1
-        # 统计、监控配置
-        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
-        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
-        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
-        stat-view-servlet:
-          enabled: true
-          login-username: tianyun
-          login-password: tianyunperfect
-          allow: # 默认运行所有
-          deny: # 默认即可
-          reset-enable: true
-    polar:
-      type: com.alibaba.druid.pool.DruidDataSource
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      jdbc-url: jdbc:mysql://121.41.100.198:3306/polar?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-      username: root
-      password: root
-      #下面为连接池补充设置
-      druid:
-        initial-size: 5 # 初始化
-        max-active: 5 # 最大
-        min-idle: 5 # 最小
-        max-wait: 6000 # 超时时间
-        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
-        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
-        # 检测链接是否有效的query
-        validation-query: SELECT 1 FROM DUAL
-        test-while-idle: true # 检测到链接空闲时,验证是否有效
-        test-on-borrow: false # 申请链接时,不检测
-        test-on-return: false # 返回链接时,不检测
-        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
-        # 如果上面开启了游标,这里要设置一下大小,例如 50
-        max-pool-prepared-statement-per-connection-size: -1
-        # 统计、监控配置
-        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
-        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
-        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
-        stat-view-servlet:
-          enabled: true
-          login-username: tianyun
-          login-password: tianyunperfect
-          allow: # 默认运行所有
-          deny: # 默认即可
-          reset-enable: true
-    cpsshard:
-      type: com.alibaba.druid.pool.DruidDataSource
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      jdbc-url: jdbc:mysql://121.41.100.198:3306/test_cps_shard_192?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-      username: root
-      password: root
-      #下面为连接池补充设置
-      druid:
-        initial-size: 5 # 初始化
-        max-active: 5 # 最大
-        min-idle: 5 # 最小
-        max-wait: 6000 # 超时时间
-        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
-        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
-        # 检测链接是否有效的query
-        validation-query: SELECT 1 FROM DUAL
-        test-while-idle: true # 检测到链接空闲时,验证是否有效
-        test-on-borrow: false # 申请链接时,不检测
-        test-on-return: false # 返回链接时,不检测
-        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
-        # 如果上面开启了游标,这里要设置一下大小,例如 50
-        max-pool-prepared-statement-per-connection-size: -1
-        # 统计、监控配置
-        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
-        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
-        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
-        stat-view-servlet:
-          enabled: true
-          login-username: tianyun
-          login-password: tianyunperfect
-          allow: # 默认运行所有
-          deny: # 默认即可
-          reset-enable: true