mymx2 commented on issue #741:
URL: https://github.com/apache/fesod/issues/741#issuecomment-3736820771

   我的意见是不引入,除了常见的输入校验,用户可能还存在业务校验,这是最麻烦的一点。就像上面说的,使用者更希望的是一次性知晓导入中所发生的所有错误。
   
   如果仅仅想要自己校验。完全可以通过对解析后的对象调用validator来完成。
   
   使用者可能更关注一次性导入结果,例如:
   ```
     /** 导入结果 */
     class ResultData<T> {
       /** 表格数据 */
       var data = mutableMapOf<Int, MutableList<T>>()
   
       /** 表格错误 */
       var error = mutableMapOf<Int, MutableList<ExcelErrorData>>()
     }
   ```
   
   一次性错误收集:
   ```
   data class ExcelErrorData(
     /** 页数 */
     @ExcelProperty("页数") @ColumnWidth(15) var sheetNo: Int,
   
     /** 行数 */
     @ExcelProperty("行数") @ColumnWidth(15) var rowIndex: Int,
   
     /** 列数 */
     @ExcelProperty("列数") @ColumnWidth(15) var columnIndex: Int,
   
     /** 单元格数据 */
     @ExcelProperty("错误数据") @ColumnWidth(15) var cellData: String,
   
     /** 错误描述 */
     @ExcelProperty("错误描述") @ColumnWidth(100) var errorMsg: String,
   
     /** 单元格位置 */
     @ExcelProperty("位置") @ColumnWidth(15) var cellPosition: String,
   
     /** 正确示例 */
     @ExcelSelectCell @ExcelProperty("正确示例") @ColumnWidth(15) var exampleData: 
String,
   ) {
   
     /** 生成excel行列的中文表述 例如: 1-10-M 表示 sheet1的第10行的M列 */
     fun transCellPosition(): ExcelErrorData {
       this.cellPosition =
         "【sheet${sheetNo + 1}-${rowIndex + 
1}行-${ExcelUtil.calcNumToLetter(columnIndex)}列】"
       return this
     }
   }
   
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to