优化代码

This commit is contained in:
GoEdgeLab
2022-03-22 21:45:07 +08:00
parent 2b0e2b6888
commit 1e4143bcbb
148 changed files with 340 additions and 315 deletions

View File

@@ -76,7 +76,7 @@ func (this *NSKeyService) FindEnabledNSKey(ctx context.Context, req *pb.FindEnab
return &pb.FindEnabledNSKeyResponse{
NsKey: &pb.NSKey{
Id: int64(key.Id),
IsOn: key.IsOn == 1,
IsOn: key.IsOn,
Name: key.Name,
Algo: key.Algo,
Secret: key.Secret,
@@ -116,7 +116,7 @@ func (this *NSKeyService) ListEnabledNSKeys(ctx context.Context, req *pb.ListEna
for _, key := range keys {
pbKeys = append(pbKeys, &pb.NSKey{
Id: int64(key.Id),
IsOn: key.IsOn == 1,
IsOn: key.IsOn,
Name: key.Name,
Algo: key.Algo,
Secret: key.Secret,
@@ -155,7 +155,7 @@ func (this *NSKeyService) ListNSKeysAfterVersion(ctx context.Context, req *pb.Li
pbKeys = append(pbKeys, &pb.NSKey{
Id: int64(key.Id),
IsOn: key.IsOn == 1,
IsOn: key.IsOn,
Name: "",
Algo: key.Algo,
Secret: key.Secret,