diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 717f87b33..6d50ecad8 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -15,6 +15,7 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/middleware" "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/getcdv3" "Open_IM/pkg/utils" "flag" "fmt" @@ -213,7 +214,7 @@ func main() { } // - go utils.RegisterConf() + go getcdv3.RegisterConf() go apiThird.MinioInit() defaultPorts := config.Config.Api.GinPort ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10002 as port") diff --git a/pkg/utils/getcd.go b/pkg/getcdv3/getcd.go similarity index 86% rename from pkg/utils/getcd.go rename to pkg/getcdv3/getcd.go index 88f7e6a8a..87243aef0 100644 --- a/pkg/utils/getcd.go +++ b/pkg/getcdv3/getcd.go @@ -1,7 +1,8 @@ -package utils +package getcdv3 import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/utils" "context" "fmt" "github.com/OpenIMSDK/getcdv3" @@ -32,8 +33,8 @@ func RegisterConf() { if err != nil { panic(err.Error()) } - secretMD5 := Md5(config.Config.Etcd.Secret) - confBytes, err := AesEncrypt(bytes, []byte(secretMD5[0:16])) + secretMD5 := utils.Md5(config.Config.Etcd.Secret) + confBytes, err := utils.AesEncrypt(bytes, []byte(secretMD5[0:16])) if err != nil { panic(err.Error()) }