- update type

master v1.0.42
李光春 2 years ago
parent b615f8f1b1
commit e27626dd15

@ -30,10 +30,14 @@ type ApiClient struct {
}
}
// client 数据库服务
// string 表名
type apiGormClientFun func() (*dorm.GormClient, string)
// NewApiGormClient 创建接口实例化
// client 数据库服务
// tableName 表名
func NewApiGormClient(gormClientFun func() (client *dorm.GormClient, tableName string), debug bool) (*ApiClient, error) {
func NewApiGormClient(gormClientFun apiGormClientFun, debug bool) (*ApiClient, error) {
c := &ApiClient{}
@ -66,11 +70,16 @@ func NewApiGormClient(gormClientFun func() (client *dorm.GormClient, tableName s
return c, nil
}
// client 数据库服务
// string 库名
// string 表名
type apiMongoClientFun func() (*dorm.MongoClient, string, string)
// NewApiMongoClient 创建接口实例化
// client 数据库服务
// databaseName 库名
// collectionName 表名
func NewApiMongoClient(mongoClientFun func() (client *dorm.MongoClient, databaseName string, collectionName string), debug bool) (*ApiClient, error) {
func NewApiMongoClient(mongoClientFun apiMongoClientFun, debug bool) (*ApiClient, error) {
c := &ApiClient{}

@ -1,5 +1,5 @@
package golog
const (
Version = "1.0.41"
Version = "1.0.42"
)

@ -34,11 +34,15 @@ type GinClient struct {
}
}
// client 数据库服务
// string 表名
type ginGormClientFun func() (*dorm.GormClient, string)
// NewGinGormClient 创建框架实例化
// client 数据库服务
// tableName=表名
// tableName 表名
// ipService ip服务
func NewGinGormClient(gormClientFun func() (client *dorm.GormClient, tableName string), ipService *goip.Client, debug bool) (*GinClient, error) {
func NewGinGormClient(gormClientFun ginGormClientFun, ipService *goip.Client, debug bool) (*GinClient, error) {
c := &GinClient{}
@ -73,12 +77,17 @@ func NewGinGormClient(gormClientFun func() (client *dorm.GormClient, tableName s
return c, nil
}
// client 数据库服务
// string 库名
// string 表名
type ginMongoClientFun func() (*dorm.MongoClient, string, string)
// NewGinMongoClient 创建框架实例化
// client 数据库服务
// databaseName 库名
// collectionName 表名
// ipService ip服务
func NewGinMongoClient(mongoClientFun func() (client *dorm.MongoClient, databaseName string, collectionName string), ipService *goip.Client, debug bool) (*GinClient, error) {
func NewGinMongoClient(mongoClientFun ginMongoClientFun, ipService *goip.Client, debug bool) (*GinClient, error) {
c := &GinClient{}

Loading…
Cancel
Save