增加数据表结构查询的方法
This commit is contained in:
11
client.go
11
client.go
@ -10,6 +10,7 @@ package database
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.zhangdeman.cn/zhangdeman/consts"
|
||||
"git.zhangdeman.cn/zhangdeman/serialize"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@ -132,15 +133,15 @@ func (c *client) getCfg(cfgPath string) (*cfgFile, error) {
|
||||
cfgInfo Database
|
||||
)
|
||||
switch fileType {
|
||||
case FileTypeYaml:
|
||||
case consts.FileTypeYaml:
|
||||
fallthrough
|
||||
case FileTypeYml:
|
||||
result.Type = FileTypeYaml
|
||||
case consts.FileTypeYml:
|
||||
result.Type = consts.FileTypeYaml
|
||||
if err = serialize.File.ReadYmlContent(cfgPath, &result.Config); nil != err {
|
||||
return nil, fmt.Errorf("%s 配置文件解析失败, 原因 : %s", cfgPath, err.Error())
|
||||
}
|
||||
case FileTypeJson:
|
||||
result.Type = FileTypeJson
|
||||
case consts.FileTypeJson:
|
||||
result.Type = consts.FileTypeJson
|
||||
if err = serialize.File.ReadJSONContent(cfgPath, &cfgInfo); nil != err {
|
||||
return nil, fmt.Errorf("%s 配置文件解析失败, 原因 : %s", cfgPath, err.Error())
|
||||
}
|
||||
|
Reference in New Issue
Block a user