modify trace dara

pull/60/head
diaobisong 2 years ago
parent 4b448f1484
commit eb513593a7

@ -32,4 +32,9 @@ public class SimpleAnchorInfo {
*
*/
private long timestamp;
/**
* id
*/
private String messageId;
}

@ -95,7 +95,7 @@ public class ConsumeServiceImpl implements ConsumeService {
* 1.userId list:{key,list}
* key:userId,listValue:[{timestamp,state,businessId},{timestamp,state,businessId}]
*/
SimpleAnchorInfo userAnchorInfo = SimpleAnchorInfo.builder().businessId(info.getBusinessId()).state(info.getState()).timestamp(info.getLogTimestamp()).build();
SimpleAnchorInfo userAnchorInfo = SimpleAnchorInfo.builder().businessId(info.getBusinessId()).state(info.getState()).timestamp(info.getLogTimestamp()).messageId(info.getMessageId()).build();
for (String id : info.getIds()) {
redisFutures.add(redisAsyncCommands.lpush(id.getBytes(), JSON.toJSONString(userAnchorInfo).getBytes()));
redisFutures.add(redisAsyncCommands.expire(id.getBytes(), (DateUtil.endOfDay(new Date()).getTime() - DateUtil.current()) / 1000));

@ -152,7 +152,7 @@ public class DataServiceImpl implements DataService {
sb.append(StrPool.CRLF);
}
String startTime = DateUtil.format(new Date(simpleAnchorInfo.getTimestamp()), DatePattern.NORM_DATETIME_PATTERN);
String stateDescription = AnchorStateUtils.getDescriptionByState(messageTemplate.getSendChannel(), simpleAnchorInfo.getState());
String stateDescription = AnchorStateUtils.getDescriptionByState(messageTemplate.getSendChannel(), simpleAnchorInfo.getState(), simpleAnchorInfo.getMessageId());
sb.append(startTime).append(StrPool.C_COLON).append(stateDescription).append("==>");
}

@ -8,10 +8,9 @@ import me.chanjar.weixin.common.error.WxCpErrorMsgEnum;
import me.chanjar.weixin.common.error.WxMaErrorMsgEnum;
import me.chanjar.weixin.common.error.WxMpErrorMsgEnum;
/**
* @author 3y
* AnchorStateUtils
* AnchorStateUtils
*/
public class AnchorStateUtils {
@ -26,7 +25,7 @@ public class AnchorStateUtils {
* @param state
* @return
*/
public static String getDescriptionByState(Integer channel, Integer state) {
public static String getDescriptionByState(Integer channel, Integer state, String messageId) {
String stateDescription = EnumUtil.getDescriptionByCode(state, AnchorState.class);
// 如果 AnchorState 找不到对应的点位描述,那就是在对应渠道的点位信息
@ -39,6 +38,7 @@ public class AnchorStateUtils {
stateDescription = WxCpErrorMsgEnum.findMsgByCode(state);
}
}
stateDescription = String.join("", stateDescription, " [", messageId, "]");
return stateDescription;
}

Loading…
Cancel
Save