From bbf729e98f8b89c3c3928f472588fa8a7c54b726 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 07 六月 2023 18:10:42 +0800 Subject: [PATCH] 增加日志记录 --- management/guns-admin/src/main/resources/application.yml | 7 ++++--- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MallBook/util/TrhRequest.java | 10 +++++++--- management/guns-admin/src/main/resources/redis.properties | 22 +++++++++++----------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MallBook/util/TrhRequest.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MallBook/util/TrhRequest.java index 55b56be..e604316 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MallBook/util/TrhRequest.java +++ b/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; } diff --git a/management/guns-admin/src/main/resources/application.yml b/management/guns-admin/src/main/resources/application.yml index 6e2b5cb..64719ea 100644 --- a/management/guns-admin/src/main/resources/application.yml +++ b/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 diff --git a/management/guns-admin/src/main/resources/redis.properties b/management/guns-admin/src/main/resources/redis.properties index 7d6a332..4db967a 100644 --- a/management/guns-admin/src/main/resources/redis.properties +++ b/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 -- Gitblit v1.7.1