refactor: 更新 Consul 服务地址配置

- 将配置文件中的 Consul 地址从具体 IP 修改为通用的 consul:8500
- 修改相关代码中的 Consul 解析地址为 consul:8500
-此更改提高了配置的可移植性和一致性,适用于开发、测试和生产环境
This commit is contained in:
suyiiyii 2025-01-21 21:51:34 +08:00
parent 83a33f2668
commit 1414be406d
Signed by: suyiiyii
GPG Key ID: 044704CB29B8AD85
8 changed files with 8 additions and 8 deletions

View File

@ -20,7 +20,7 @@ func NewVerifyTokenByRPCService(ctx context.Context) *VerifyTokenByRPCService {
// Run create note info
func (s *VerifyTokenByRPCService) Run(req *auth.VerifyTokenReq) (resp *auth.VerifyResp, err error) {
// Finish your business logic.
r, err := consul.NewConsulResolver("10.21.22.53:8500")
r, err := consul.NewConsulResolver("consul:8500")
rpcClient, err := user.NewRPCClient("user", client.WithResolver(r))
if err != nil {
return nil, err

View File

@ -9,7 +9,7 @@ kitex:
registry:
registry_address:
- 10.21.22.53:8500
- consul:8500
username: ""
password: ""

View File

@ -9,7 +9,7 @@ kitex:
registry:
registry_address:
- 10.21.22.53:8500
- consul:8500
username: ""
password: ""

View File

@ -9,7 +9,7 @@ kitex:
registry:
registry_address:
- 10.21.22.53:8500
- consul:8500
username: ""
password: ""

View File

@ -27,7 +27,7 @@ func (h *RegisterService) Run(req *facade.RegisterReq) (resp *facade.RegisterRes
// hlog.CtxInfof(h.Context, "resp = %+v", resp)
//}()
// todo edit your code
r, err := consul.NewConsulResolver("10.21.22.53:8500")
r, err := consul.NewConsulResolver("consul:8500")
if err != nil {
return nil, err
}

View File

@ -9,7 +9,7 @@ kitex:
registry:
registry_address:
- 10.21.22.53:8500
- consul:8500
username: ""
password: ""

View File

@ -9,7 +9,7 @@ kitex:
registry:
registry_address:
- 10.21.22.53:8500
- consul:8500
username: ""
password: ""

View File

@ -9,7 +9,7 @@ kitex:
registry:
registry_address:
- 10.21.22.53:8500
- consul:8500
username: ""
password: ""