Copilot commented on code in PR #619:
URL: https://github.com/apache/fesod/pull/619#discussion_r2391473477


##########
fesod/src/main/java/org/apache/fesod/excel/write/handler/context/CellWriteHandlerContext.java:
##########
@@ -35,6 +34,8 @@
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 
+import java.util.List;

Review Comment:
   The import statement for `java.util.List` was moved from the top imports 
section to after the POI imports. This breaks the conventional import ordering 
where `java.*` imports should come before third-party imports.



##########
fesod/src/main/java/org/apache/fesod/excel/write/executor/ExcelWriteAddExecutor.java:
##########
@@ -20,23 +20,14 @@
 package org.apache.fesod.excel.write.executor;
 
 import cn.idev.excel.support.cglib.beans.BeanMap;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.fesod.excel.context.WriteContext;
 import org.apache.fesod.excel.enums.HeadKindEnum;
 import org.apache.fesod.excel.metadata.FieldCache;
 import org.apache.fesod.excel.metadata.FieldWrapper;
 import org.apache.fesod.excel.metadata.Head;
 import org.apache.fesod.excel.metadata.property.ExcelContentProperty;
-import org.apache.fesod.excel.util.BeanMapUtils;
-import org.apache.fesod.excel.util.ClassUtils;
-import org.apache.fesod.excel.util.FieldUtils;
-import org.apache.fesod.excel.util.WorkBookUtil;
-import org.apache.fesod.excel.util.WriteHandlerUtils;
+import org.apache.fesod.excel.util.*;

Review Comment:
   Using wildcard imports (`import org.apache.fesod.excel.util.*;`) reduces 
code readability and can lead to naming conflicts. Consider using explicit 
imports instead.
   ```suggestion
   import org.apache.fesod.excel.util.CollectionUtilsPlus;
   import org.apache.fesod.excel.util.ConverterUtils;
   import org.apache.fesod.excel.util.DateUtils;
   import org.apache.fesod.excel.util.StringUtils;
   ```



##########
fesod/src/main/java/org/apache/fesod/excel/write/executor/ExcelWriteFillExecutor.java:
##########
@@ -41,25 +31,16 @@
 import org.apache.fesod.excel.exception.ExcelGenerateException;
 import org.apache.fesod.excel.metadata.data.WriteCellData;
 import org.apache.fesod.excel.metadata.property.ExcelContentProperty;
-import org.apache.fesod.excel.util.BeanMapUtils;
-import org.apache.fesod.excel.util.ClassUtils;
-import org.apache.fesod.excel.util.FieldUtils;
-import org.apache.fesod.excel.util.ListUtils;
-import org.apache.fesod.excel.util.MapUtils;
-import org.apache.fesod.excel.util.PoiUtils;
-import org.apache.fesod.excel.util.StringUtils;
-import org.apache.fesod.excel.util.WriteHandlerUtils;
+import org.apache.fesod.excel.util.*;

Review Comment:
   Using wildcard imports (`import org.apache.fesod.excel.util.*;`) reduces 
code readability and can lead to naming conflicts. Consider using explicit 
imports instead.
   ```suggestion
   import org.apache.fesod.excel.util.CollectionUtilsPlus;
   import org.apache.fesod.excel.util.MapUtils;
   import org.apache.fesod.excel.util.StringUtils;
   ```



##########
fesod-examples/src/test/java/org/apache/fesod/excel/demo/write/WriteTest.java:
##########
@@ -36,12 +28,7 @@
 import org.apache.fesod.excel.annotation.write.style.ContentRowHeight;
 import org.apache.fesod.excel.annotation.write.style.HeadRowHeight;
 import org.apache.fesod.excel.enums.CellDataTypeEnum;
-import org.apache.fesod.excel.metadata.data.CommentData;
-import org.apache.fesod.excel.metadata.data.FormulaData;
-import org.apache.fesod.excel.metadata.data.HyperlinkData;
-import org.apache.fesod.excel.metadata.data.ImageData;
-import org.apache.fesod.excel.metadata.data.RichTextStringData;
-import org.apache.fesod.excel.metadata.data.WriteCellData;
+import org.apache.fesod.excel.metadata.data.*;

Review Comment:
   Using wildcard imports reduces code readability and can lead to naming 
conflicts. Consider using explicit imports instead.
   ```suggestion
   import org.apache.fesod.excel.metadata.data.CellData;
   import org.apache.fesod.excel.metadata.data.WriteCellData;
   import org.apache.fesod.excel.metadata.data.WriteRowData;
   import org.apache.fesod.excel.metadata.data.WriteSheetData;
   ```



##########
fesod-examples/src/test/java/org/apache/fesod/excel/demo/write/RecordData.java:
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fesod.excel.demo.write;
+
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.apache.fesod.excel.annotation.ExcelProperty;
+
+import java.util.Date;
+
+/**
+ * Basic data class
+ *
+ *
+ **/
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode
+public class RecordData {
+    /**
+     * String Title
+     */
+    @ExcelProperty("String Title")
+    private String string;
+
+    /**
+     * Date Title
+     */
+    @ExcelProperty("Date Title")
+    private Date date;
+
+    /**
+     * Number Title
+     */
+    @ExcelProperty("Number Title")
+    private Double doubleData;
+
+    /**
+     * 通过自定义转换器转换

Review Comment:
   The comment is written in Chinese. For consistency with the rest of the 
codebase, documentation should be in English.
   ```suggestion
        * Converted by a custom converter
   ```



##########
fesod-examples/src/test/java/org/apache/fesod/excel/demo/write/RecordStringStringConverter.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fesod.excel.demo.write;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.fesod.excel.converters.Converter;
+import org.apache.fesod.excel.converters.ReadConverterContext;
+import org.apache.fesod.excel.converters.WriteConverterContext;
+import org.apache.fesod.excel.enums.CellDataTypeEnum;
+import org.apache.fesod.excel.metadata.data.WriteCellData;
+
+/**
+ * converter to the original data record
+ */
+@Slf4j
+public class RecordStringStringConverter implements Converter<String> {
+    @Override
+    public Class<?> supportJavaTypeKey() {
+        return String.class;
+    }
+
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return CellDataTypeEnum.STRING;
+    }
+
+    @Override
+    public String convertToJavaData(ReadConverterContext<?> context) {
+        return context.getReadCellData().getStringValue();
+    }
+
+    /**
+     * 这里是写的时候会可以访问到原始数据,你可以进行其他业务处理,然后进行转换

Review Comment:
   The comment is written in Chinese. For consistency with the rest of the 
codebase, documentation should be in English.
   ```suggestion
        * When writing, you can access the original data here. You can perform 
other business processing before conversion.
   ```



##########
fesod-examples/src/test/java/org/apache/fesod/excel/demo/write/RecordCellWriteHandler.java:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fesod.excel.demo.write;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.fesod.excel.util.BooleanUtils;
+import org.apache.fesod.excel.write.handler.CellWriteHandler;
+import org.apache.fesod.excel.write.handler.context.CellWriteHandlerContext;
+import org.apache.poi.ss.usermodel.Cell;
+
+/**
+ * 拦截器中单元格上下文可以获取到行数据

Review Comment:
   The comment is written in Chinese. For consistency with the rest of the 
codebase, documentation should be in English.
   ```suggestion
    * The cell context in the interceptor can obtain the row data.
   ```



##########
fesod/src/main/java/org/apache/fesod/excel/write/executor/AbstractExcelWriteExecutor.java:
##########
@@ -28,31 +27,17 @@
 import org.apache.fesod.excel.converters.WriteConverterContext;
 import org.apache.fesod.excel.enums.CellDataTypeEnum;
 import org.apache.fesod.excel.exception.ExcelWriteDataConvertException;
-import org.apache.fesod.excel.metadata.data.CommentData;
-import org.apache.fesod.excel.metadata.data.FormulaData;
-import org.apache.fesod.excel.metadata.data.HyperlinkData;
-import org.apache.fesod.excel.metadata.data.ImageData;
-import org.apache.fesod.excel.metadata.data.WriteCellData;
+import org.apache.fesod.excel.metadata.data.*;
 import org.apache.fesod.excel.metadata.property.ExcelContentProperty;
 import org.apache.fesod.excel.support.ExcelTypeEnum;
-import org.apache.fesod.excel.util.DateUtils;
-import org.apache.fesod.excel.util.FileTypeUtils;
-import org.apache.fesod.excel.util.ListUtils;
-import org.apache.fesod.excel.util.StyleUtil;
-import org.apache.fesod.excel.util.WorkBookUtil;
-import org.apache.fesod.excel.util.WriteHandlerUtils;
+import org.apache.fesod.excel.util.*;

Review Comment:
   Using wildcard imports reduces code readability and can lead to naming 
conflicts. Consider using explicit imports instead.
   ```suggestion
   import org.apache.fesod.excel.util.ListUtils;
   import org.apache.fesod.excel.util.StyleUtil;
   import org.apache.fesod.excel.util.WriteHandlerUtils;
   ```



-- 
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