diff --git a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java index 56d5c1dc..d8a49c9f 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java @@ -71,6 +71,7 @@ public class BookForumArticlesServiceController { wrapper.eq(BookForumArticlesEntity::getDelflag,0); wrapper.eq(BookEntity::getDelFlag,0); wrapper.eq(BookEntity::getState,1); + wrapper.orderByDesc(BookForumArticlesEntity::getCreateTime); Page bookForumArticlesEntityPage = bookForumArticlesDao.selectJoinPage(new Page<>(page, limit), BookForumArticlesEntity.class, wrapper); for (BookForumArticlesEntity b : bookForumArticlesEntityPage.getRecords()){ @@ -80,6 +81,9 @@ public class BookForumArticlesServiceController { b.setCommentNum(commentcount); } + if(bookForumArticlesEntityPage.getTotal()>20){ + bookForumArticlesEntityPage.setTotal(20); + } return R.ok().put("page",bookForumArticlesEntityPage); } @@ -113,6 +117,10 @@ public class BookForumArticlesServiceController { b.setCommentNum(commentcount); } + if(bookForumArticlesEntityPage.getTotal()>20){ + bookForumArticlesEntityPage.setTotal(20); + } + return R.ok().put("page",bookForumArticlesEntityPage); } diff --git a/src/main/resources/application-dev-wcl.yml b/src/main/resources/application-dev-wcl.yml deleted file mode 100644 index 038b687d..00000000 --- a/src/main/resources/application-dev-wcl.yml +++ /dev/null @@ -1,76 +0,0 @@ - -spring: - redis: - open: false # 是否开启redis缓存 true开启 false关闭 - database: 0 - host: 127.0.0.1 - port: 6379 -# password: Jgll2015 # 密码(默认为空) - timeout: 6000000ms # 连接超时时长(毫秒) - jedis: - pool: - max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) - max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) - max-idle: 10 # 连接池中的最大空闲连接 - min-idle: 5 # 连接池中的最小空闲连接 - datasource: - type: com.alibaba.druid.pool.DruidDataSource - druid: - driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/e_book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true - username: root - password: password - initial-size: 10 - max-active: 100 - min-idle: 10 - max-wait: 60000 - pool-prepared-statements: true - max-pool-prepared-statement-per-connection-size: 20 - time-between-eviction-runs-millis: 60000 - min-evictable-idle-time-millis: 300000 - #Oracle需要打开注释 - #validation-query: SELECT 1 FROM DUAL - test-while-idle: true - test-on-borrow: false - test-on-return: false - stat-view-servlet: - enabled: true - url-pattern: /druid/* - #login-username: admin - #login-password: admin - filter: - stat: - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: false - wall: - config: - multi-statement-allow: true - tomcat: - initSQL: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci - - rabbitmq: - host: 39.106.36.183 - port: 5672 - username: admin - password: 751019 - virtualHost: / -aliyun: - oss: - file: - endpoint: oss-cn-beijing.aliyuncs.com - keyid: LTAIiSMeo8ztauV5 - keysecret: pVIYAOIFSUGg61lYfE8cjg2ZNpnLJA - bucketname: ehh-private-01 - sms: - accessKeyId: LTAI5tJbbw5fY97pnw635yq3 - accessKeySecret: LTXQ9v3OYVwNVbDWWfVpbbcVDKErKi - singName: 疯子读书 - - templateCode: SMS_248840040 - -server: - port: 9200 - -redisAddress: redis://39.106.36.183:6379 -redisPassword: Jgll2015 \ No newline at end of file diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 76931d85..464a5f46 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -75,5 +75,17 @@ aliyun: server: port: 9200 +wxpay: + appId: wx47134a8f15083734 + mchId: 1612860909 + payUrl: https://api.mch.weixin.qq.com/v3/pay/transactions/app + notifyUrl: https://testapi.nuttyreading.com/pay/payNotify + refundNotifyUrl: http://pjm6m9.natappfree.cc/pay/refundNotify + keyPemPath: D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem + serialNo: 679AECB2F7AC4183033F713828892BA640E4EEE3 + apiV3Key: 4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF + wechatPayCertificateUrl: D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem + privateKeyUrl: D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem + redisAddress: redis://59.110.212.44:6379 redisPassword: Jgll2015 \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 05f16195..dc743429 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -74,5 +74,17 @@ aliyun: server: port: 9100 +wxpay: + appId: wx47134a8f15083734 + mchId: 1612860909 + payUrl: https://api.mch.weixin.qq.com/v3/pay/transactions/app + notifyUrl: https://api.nuttyreading.com/pay/payNotify + refundNotifyUrl: http://pjm6m9.natappfree.cc/pay/refundNotify + keyPemPath: /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem + serialNo: 679AECB2F7AC4183033F713828892BA640E4EEE3 + apiV3Key: 4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF + wechatPayCertificateUrl: /usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem + privateKeyUrl: /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem + redisAddress: redis://59.110.212.44:6379 redisPassword: Jgll2015 \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 9a6c2cb5..7febd147 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -1,11 +1,28 @@ + spring: + redis: + open: false # 是否开启redis缓存 true开启 false关闭 + database: 0 + host: 59.110.212.44 + port: 6379 + password: Jgll2015 # 密码(默认为空) + timeout: 6000000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 datasource: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai - username: renren - password: 123456 + url: jdbc:mysql://rm-2zev4157t67trxuu3yo.mysql.rds.aliyuncs.com:3306/e_book_test + # username: root + # password: HSXY1234hsxy + # password: Jgll2023Nutty + username: nuttyreading + password: Wu751019! initial-size: 10 max-active: 100 min-idle: 10 @@ -32,18 +49,43 @@ spring: wall: config: multi-statement-allow: true + tomcat: + initSQL: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci + rabbitmq: + host: 39.106.36.183 + port: 5672 + username: admin + password: 751019 + virtualHost: / +aliyun: + oss: + file: + endpoint: oss-cn-beijing.aliyuncs.com + keyid: LTAIiSMeo8ztauV5 + keysecret: pVIYAOIFSUGg61lYfE8cjg2ZNpnLJA + bucketname: ehh-private-01 + sms: + accessKeyId: LTAI5tJbbw5fY97pnw635yq3 + accessKeySecret: LTXQ9v3OYVwNVbDWWfVpbbcVDKErKi + singName: 疯子读书国际 + templateCode: SMS_248840040 + sTemplateCode: SMS_463780139 -##多数据源的配置 -#dynamic: -# datasource: -# slave1: -# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver -# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_security -# username: sa -# password: 123456 -# slave2: -# driver-class-name: org.postgresql.Driver -# url: jdbc:postgresql://localhost:5432/renren_security -# username: renren -# password: 123456 \ No newline at end of file +server: + port: 9200 + +wxpay: + appId: wx47134a8f15083734 + mchId: 1612860909 + payUrl: https://api.mch.weixin.qq.com/v3/pay/transactions/app + notifyUrl: https://testapi.nuttyreading.com/pay/payNotify + refundNotifyUrl: http://pjm6m9.natappfree.cc/pay/refundNotify + keyPemPath: /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem + serialNo: 679AECB2F7AC4183033F713828892BA640E4EEE3 + apiV3Key: 4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF + wechatPayCertificateUrl: /usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem + privateKeyUrl: /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem + +redisAddress: redis://59.110.212.44:6379 +redisPassword: Jgll2015 \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ad28466c..4b7d7a8c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -11,7 +11,7 @@ connection-timeout: 6000000ms spring: # 环境 dev|test|prod profiles: - active: prod + active: dev # jackson时间格式化 jackson: time-zone: GMT+8 diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index e93b08b3..26c7e28e 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -1,26 +1,210 @@ - - - + + + - - - - - - + + + + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + info + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/web_debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/web-debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/web_info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/web-info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/web_warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/web-warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/web_error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/web-error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/weChatConfig.properties b/src/main/resources/weChatConfig.properties deleted file mode 100644 index a24fe685..00000000 --- a/src/main/resources/weChatConfig.properties +++ /dev/null @@ -1,26 +0,0 @@ -# APP ID -wxpay.appId:wx47134a8f15083734 -# ?? ID -wxpay.mchId:1612860909 -# ?? URL -wxpay.payUrl:https://api.mch.weixin.qq.com/v3/pay/transactions/app -# ???? -wxpay.notifyUrl:https://api.nuttyreading.com/pay/payNotify -# ?? url -wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify -# key pem -wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem -#wxpay.keyPemPath:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem -#wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem -# ??? -wxpay.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3 -# API v3 key -wxpay.apiV3Key:4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF -# ???? -wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem -#wxpay.wechatPayCertificateUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem -# wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem -# ?? url -wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem -#wxpay.privateKeyUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem -#wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem \ No newline at end of file