|
@@ -28,6 +28,21 @@ type Result struct {
|
|
ResultElement map[string]any
|
|
ResultElement map[string]any
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+type ResultColumn struct {
|
|
|
|
+ Name string
|
|
|
|
+ ParseTime string
|
|
|
|
+ AESKey string
|
|
|
|
+ SplitWith string
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ OriginFieldType reflect.Type
|
|
|
|
+ OriginFieldValue reflect.Value
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ FieldTypeElem reflect.Type
|
|
|
|
+ FieldValueElem reflect.Value
|
|
|
|
+}
|
|
|
|
+
|
|
func ParseSqlResultTag(e any) (*Result, error) {
|
|
func ParseSqlResultTag(e any) (*Result, error) {
|
|
if e == nil {
|
|
if e == nil {
|
|
return nil, errors.New("没有传递实体")
|
|
return nil, errors.New("没有传递实体")
|
|
@@ -70,21 +85,6 @@ func ParseSqlResultTag(e any) (*Result, error) {
|
|
return sqlResult, nil
|
|
return sqlResult, nil
|
|
}
|
|
}
|
|
|
|
|
|
-type ResultColumn struct {
|
|
|
|
- Name string
|
|
|
|
- ParseTime string
|
|
|
|
- AESKey string
|
|
|
|
- SplitWith string
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- OriginFieldType reflect.Type
|
|
|
|
- OriginFieldValue reflect.Value
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- FieldTypeElem reflect.Type
|
|
|
|
- FieldValueElem reflect.Value
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
func parseSqlResultElement(field reflect.StructField, fieldValue reflect.Value) (any, error) {
|
|
func parseSqlResultElement(field reflect.StructField, fieldValue reflect.Value) (any, error) {
|
|
sqlResultTag := field.Tag.Get(sqlResultTagKey)
|
|
sqlResultTag := field.Tag.Get(sqlResultTagKey)
|
|
if sqlResultTag == sqlResultIgnore {
|
|
if sqlResultTag == sqlResultIgnore {
|