mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-12 04:03:44 +08:00
模块化上传驱动,使用泛型优化工具库降低冗余
This commit is contained in:
@@ -108,8 +108,7 @@ func GenJoinSelect(ctx context.Context, entity interface{}, masterDao interface{
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
return gstr.Implode(",", convert.UniqueSliceString(tmpFields)), nil
|
||||
return gstr.Implode(",", convert.UniqueSlice(tmpFields)), nil
|
||||
}
|
||||
|
||||
// GenSelect 生成select
|
||||
@@ -144,8 +143,7 @@ func GenSelect(ctx context.Context, entity interface{}, dao interface{}) (allFie
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
return gstr.Implode(",", convert.UniqueSliceString(tmpFields)), nil
|
||||
return gstr.Implode(",", convert.UniqueSlice(tmpFields)), nil
|
||||
}
|
||||
|
||||
// GetPkField 获取dao实例中的主键名称
|
||||
@@ -163,7 +161,6 @@ func GetPkField(ctx context.Context, dao daoInstance) (string, error) {
|
||||
return field.Name, nil
|
||||
}
|
||||
}
|
||||
|
||||
return "", errors.New("no primary key")
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ func FilterAuth(m *gdb.Model) *gdb.Model {
|
||||
if !needAuth {
|
||||
return m
|
||||
}
|
||||
|
||||
return m.Handler(FilterAuthWithField(filterField))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user