补充excel文档

This commit is contained in:
xiangheng
2024-09-13 16:55:52 +08:00
parent 8bec7b5bef
commit 7b39d60016
2 changed files with 11 additions and 1 deletions
+2 -1
View File
@@ -22,6 +22,7 @@ var cols = []excel2.Col{
{Name: "更新时间", Key: "UpdateTime", Width: 15, Decode: util.NullTimeUtil.DecodeTime},
}
```
# 注意点
1. Key对应的字段,如果是自定义结构体,需要实现string接口、或者传递Encode函数
<<< @/../server/util/excel2/excel_test.go#envConfig
+9
View File
@@ -39,4 +39,13 @@ func (i Int) MarshalJSON() ([]byte, error) {
return []byte(strconv.FormatInt(n, 10)), nil
}
```
### 自带了三个可为null类型:
1. 相对于guregu/null的优点
2. NullFloat、NullInt:支持前端传递null、字符串数字、数字
```go
core.NullFloat
core.NullInt
core.NullTime
```