feat: 优化为批量更新结果类的 toString 方法实现

- 为BatchUpdateErrorInfo类实现toString方法
- 重构BatchUpdateResult类的toString方法,调整字段顺序
This commit is contained in:
2026-05-31 04:21:33 +08:00
parent 8de546b7a6
commit 3ad5718f8c
2 changed files with 16 additions and 3 deletions

View File

@@ -78,4 +78,17 @@ public class BatchUpdateErrorInfo {
return errorType; return errorType;
} }
/**
* 返回该错误信息的字符串表示,包含批次索引、错误类型和错误消息。
*
* @return 格式为 {@code "BatchUpdateErrorInfo{batchIndex=..., errorType=..., message=...}"} 的字符串
*/
@Override
public String toString() {
return "BatchUpdateErrorInfo{"
+ "batchIndex=" + batchIndex
+ ", errorType=" + errorType.getName()
+ ", message=" + cause.getMessage()
+ "}";
}
} }

View File

@@ -230,10 +230,10 @@ public class BatchUpdateResult {
@Override @Override
public String toString() { public String toString() {
return "BatchUpdateResult [" return "BatchUpdateResult ["
+ "total=" + total + "status=" + status
+ ", batchCount=" + batchCount + ", total=" + total
+ ", batchSize=" + batchSize + ", batchSize=" + batchSize
+ ", status=" + status + ", batchCount=" + batchCount
+ ", completeBatchCount=" + completeBatchCount + ", completeBatchCount=" + completeBatchCount
+ ", successBatchCount=" + successBatchCount + ", successBatchCount=" + successBatchCount
+ ", errorBatchCount=" + getErrorBatchCount() + ", errorBatchCount=" + getErrorBatchCount()