feat(可回溯): 重构

增加feign
This commit is contained in:
BrandWang
2023-05-08 19:24:38 +08:00
parent d1a4b55f5d
commit dbaab0484b
22 changed files with 549 additions and 4 deletions
@@ -1,8 +1,10 @@
package com.wabestway.recall.trace.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.wabestway.recall.trace.handler.ListTypeHandler;
import lombok.Data;
import java.util.List;
@@ -29,6 +31,7 @@ public class RecallRecordEntity {
/** 页面说明 */
private String content;
/** 记录事件 */
@TableField(typeHandler = ListTypeHandler.class)
private List<String> events;
/** 回溯记录跟踪ID */
private String traceId;
@@ -0,0 +1,42 @@
package com.wabestway.recall.trace.handler;
import com.wabestway.recall.trace.vo.RecallRecordVO;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import org.apache.ibatis.type.TypeHandler;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;
@MappedTypes(value = {RecallRecordVO.class})
@MappedJdbcTypes(value = {JdbcType.LONGNVARCHAR})
public class ListTypeHandler implements TypeHandler<List<String>> {
@Override
public void setParameter(PreparedStatement ps, int i, List<String> strings, JdbcType jdbcType) throws SQLException {
ps.setString(i, String.join(",", strings));
}
@Override
public List<String> getResult(ResultSet rs, String s) throws SQLException {
String str = rs.getString(s);
return Arrays.asList(str.split(","));
}
@Override
public List<String> getResult(ResultSet rs, int i) throws SQLException {
String str = rs.getString(i);
return Arrays.asList(str.split(","));
}
@Override
public List<String> getResult(CallableStatement cs, int i) throws SQLException {
String str = cs.getString(i);
return Arrays.asList(str.split(","));
}
}
@@ -1,6 +1,10 @@
package com.wabestway.recall.trace.vo;
import java.io.Serializable;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -76,6 +80,7 @@ public class RecallOrderVO implements Serializable {
private String createBy;
/** 创建时间 */
@ApiModelProperty(value = "创建时间")
@JsonProperty(value = "createAt")
private Long createTime;
/** 更新人 */
@ApiModelProperty(value = "更新人")
@@ -84,4 +89,6 @@ public class RecallOrderVO implements Serializable {
@ApiModelProperty(value = "更新时间")
private Long updateTime;
private List<String> events;
}