puzhibing
2023-06-07 bbf729e98f8b89c3c3928f472588fa8a7c54b726
增加日志记录
3个文件已修改
39 ■■■■■ 已修改文件
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MallBook/util/TrhRequest.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/resources/application.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/resources/redis.properties 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MallBook/util/TrhRequest.java
@@ -7,6 +7,8 @@
import com.stylefeng.guns.modular.system.util.MallBook.config.ChannelConfig;
import com.stylefeng.guns.modular.system.util.MallBook.model.InterfaceRequest;
import com.stylefeng.guns.modular.system.util.MallBook.model.InterfaceResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * @Author xiaogc
@@ -14,17 +16,19 @@
 */
public class TrhRequest<T> {
    Logger logger = LoggerFactory.getLogger("ServerLog");
    public InterfaceResponse execute(T t, String serverCode) {
        InterfaceRequest<T> request = new InterfaceRequest(t, serverCode);
        System.out.println("mallbook请求参数:" + JSONUtil.toJsonStr(request));
        logger.warn("mallbook请求参数:" + JSONUtil.toJsonStr(request));
        String result = HttpUtil.post(ChannelConfig.payUrl, BeanUtil.beanToMap(request));
        System.out.println("mallbook响应参数:" + result);
        logger.warn("mallbook响应参数:" + result);
        InterfaceResponse response = JSONUtil.toBean(result, InterfaceResponse.class);
        boolean verify = RSASignature.validate(response.content(), response.getSign());
        if (!verify) {
            throw new ValidateException("签名验证失败");
        } else {
            System.out.printf("签名验证通过");
            logger.warn("签名验证通过");
        }
        return response;
    }
management/guns-admin/src/main/resources/application.yml
@@ -15,7 +15,8 @@
spring:
  profiles:
    active: dev
#    active: dev
    active: produce
  mvc:
    static-path-pattern: /static/**
    view:
@@ -59,8 +60,8 @@
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
    username: root
#    password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj
    password: 123456
    password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj
#    password: 123456
    db-name: super_save_driving #用来搜集数据库的所有表
    filters: wall,mergeStat
management/guns-admin/src/main/resources/redis.properties
@@ -2,19 +2,19 @@
# RedisÊý¾Ý¿âË÷Òý£¨Ä¬ÈÏΪ0£©
spring.redis.database=0
## Redis·þÎñÆ÷µØÖ·
#spring.redis.host=127.0.0.1
### Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú
#spring.redis.port=16379
### Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£©
#spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ
# Redis·þÎñÆ÷µØÖ·
spring.redis.host=127.0.0.1
# Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú
spring.redis.port=6379
# Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£©
spring.redis.password=123456
## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú
spring.redis.port=16379
## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£©
spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ
## Redis·þÎñÆ÷µØÖ·
#spring.redis.host=127.0.0.1
## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú
#spring.redis.port=6379
## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£©
#spring.redis.password=123456
# Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£©
spring.redis.jedis.pool.max-active=1024