1:为日志查询添加请求内容的条件

2:将请求日志表分为配置请求记录表和日志请求记录表
3:更改redis数据同步到集群的策略
This commit is contained in:
renkaige
2018-10-19 17:17:04 +08:00
parent ddf64439ea
commit f6c056231c
8 changed files with 313 additions and 68 deletions

View File

@@ -16,6 +16,8 @@ import com.nis.domain.restful.ServicesRequestLogBean;
public interface ServicesRequestLogDao {
int insert(ServicesRequestLog record);
int insertConfigLog(ServicesRequestLog record);
int insertLogLog(ServicesRequestLog record);
public void deleteById(Long id);

View File

@@ -176,4 +176,185 @@
</if>
</trim>
</insert>
<insert id="insertConfigLog" parameterType="com.nis.domain.ServicesRequestLog">
insert into SERVICES_CONFIG_REQUEST_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="operator != null">
OPERATOR,
</if>
<if test="version != null">
VERSION,
</if>
<if test="opAction != null">
OPACTION,
</if>
<if test="opTime != null">
OPTIME,
</if>
<if test="requestContent != null">
REQUEST_CONTENT,
</if>
<if test="requestTime != null">
REQUEST_TIME,
</if>
<if test="consumerTime != null">
CONSUMER_TIME,
</if>
<if test="requestIp != null">
REQUEST_IP,
</if>
<if test="businessCode != null">
BUSINESS_CODE,
</if>
<if test="exceptionInfo != null">
EXCEPTION_INFO,
</if>
<if test="serverIp != null">
SERVER_IP,
</if>
<if test="traceCode != null">
TRACE_CODE,
</if>
<if test="requestURI != null">
REQUEST_URI,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="operator != null">
#{operator,jdbcType=VARCHAR},
</if>
<if test="version != null">
#{version,jdbcType=VARCHAR},
</if>
<if test="opAction != null">
#{opAction,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="requestContent != null">
#{requestContent,jdbcType=CLOB},
</if>
<if test="requestTime != null">
#{requestTime,jdbcType=TIMESTAMP},
</if>
<if test="consumerTime != null">
#{consumerTime,jdbcType=BIGINT},
</if>
<if test="requestIp != null">
#{requestIp,jdbcType=VARCHAR},
</if>
<if test="businessCode != null">
#{businessCode,jdbcType=INTEGER},
</if>
<if test="exceptionInfo != null">
#{exceptionInfo,jdbcType=VARCHAR},
</if>
<if test="serverIp != null">
#{serverIp,jdbcType=VARCHAR},
</if>
<if test="traceCode != null">
#{traceCode,jdbcType=VARCHAR},
</if>
<if test="requestURI != null">
#{requestURI,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert id="insertLogLog" parameterType="com.nis.domain.ServicesRequestLog">
insert into SERVICES_LOG_REQUEST_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="operator != null">
OPERATOR,
</if>
<if test="version != null">
VERSION,
</if>
<if test="opAction != null">
OPACTION,
</if>
<if test="opTime != null">
OPTIME,
</if>
<if test="requestContent != null">
REQUEST_CONTENT,
</if>
<if test="requestTime != null">
REQUEST_TIME,
</if>
<if test="consumerTime != null">
CONSUMER_TIME,
</if>
<if test="requestIp != null">
REQUEST_IP,
</if>
<if test="businessCode != null">
BUSINESS_CODE,
</if>
<if test="exceptionInfo != null">
EXCEPTION_INFO,
</if>
<if test="serverIp != null">
SERVER_IP,
</if>
<if test="traceCode != null">
TRACE_CODE,
</if>
<if test="requestURI != null">
REQUEST_URI,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="operator != null">
#{operator,jdbcType=VARCHAR},
</if>
<if test="version != null">
#{version,jdbcType=VARCHAR},
</if>
<if test="opAction != null">
#{opAction,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="requestContent != null">
#{requestContent,jdbcType=CLOB},
</if>
<if test="requestTime != null">
#{requestTime,jdbcType=TIMESTAMP},
</if>
<if test="consumerTime != null">
#{consumerTime,jdbcType=BIGINT},
</if>
<if test="requestIp != null">
#{requestIp,jdbcType=VARCHAR},
</if>
<if test="businessCode != null">
#{businessCode,jdbcType=INTEGER},
</if>
<if test="exceptionInfo != null">
#{exceptionInfo,jdbcType=VARCHAR},
</if>
<if test="serverIp != null">
#{serverIp,jdbcType=VARCHAR},
</if>
<if test="traceCode != null">
#{traceCode,jdbcType=VARCHAR},
</if>
<if test="requestURI != null">
#{requestURI,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>

View File

@@ -5,7 +5,7 @@
<select id="findList" resultType="swaggerLog">
SELECT
a.*
FROM services_request_log a
FROM ${tableName} a
WHERE a.request_time BETWEEN
#{beginDate} AND #{endDate}