Skip to content

Commit 7f229a1

Browse files
authored
fix:修复配置标签转换不对 & 客户端接口错误信息描述不对 (#1274)
1 parent 289a5bd commit 7f229a1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Diff for: common/model/config_file.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ func FromTagMap(kvs map[string]string) []*config_manage.ConfigFileTag {
424424
func ToTagMap(tags []*config_manage.ConfigFileTag) map[string]string {
425425
kvs := map[string]string{}
426426
for i := range tags {
427-
kvs[tags[i].GetKey().GetValue()] = tags[i].GetKey().GetValue()
427+
kvs[tags[i].GetKey().GetValue()] = tags[i].GetValue().GetValue()
428428
}
429429

430430
return kvs

Diff for: service/client_v1.go

+4
Original file line numberDiff line numberDiff line change
@@ -494,22 +494,26 @@ func (s *Server) getServiceCache(name string, namespace string) *model.Service {
494494
func (s *Server) commonCheckDiscoverRequest(req *apiservice.Service, resp *apiservice.DiscoverResponse) bool {
495495
if s.caches == nil {
496496
resp.Code = utils.NewUInt32Value(uint32(apimodel.Code_ClientAPINotOpen))
497+
resp.Info = utils.NewStringValue(api.Code2Info(resp.GetCode().GetValue()))
497498
resp.Service = req
498499
return false
499500
}
500501
if req == nil {
501502
resp.Code = utils.NewUInt32Value(uint32(apimodel.Code_EmptyRequest))
503+
resp.Info = utils.NewStringValue(api.Code2Info(resp.GetCode().GetValue()))
502504
resp.Service = req
503505
return false
504506
}
505507

506508
if req.GetName().GetValue() == "" {
507509
resp.Code = utils.NewUInt32Value(uint32(apimodel.Code_InvalidServiceName))
510+
resp.Info = utils.NewStringValue(api.Code2Info(resp.GetCode().GetValue()))
508511
resp.Service = req
509512
return false
510513
}
511514
if req.GetNamespace().GetValue() == "" {
512515
resp.Code = utils.NewUInt32Value(uint32(apimodel.Code_InvalidNamespaceName))
516+
resp.Info = utils.NewStringValue(api.Code2Info(resp.GetCode().GetValue()))
513517
resp.Service = req
514518
return false
515519
}

Diff for: version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.17.3
1+
v1.17.6

0 commit comments

Comments
 (0)