优化结构

This commit is contained in:
Yvan
2026-08-21 00:10:27 +08:00
parent 746e33e027
commit 361a562f75
334 changed files with 382 additions and 379 deletions
@@ -0,0 +1,35 @@
package data
import (
"kra/app/system/internal/conf"
"google.golang.org/protobuf/proto"
)
func cloneAdminConfig(value *conf.AdminBackend) *conf.AdminBackend {
if value == nil {
return &conf.AdminBackend{}
}
return proto.Clone(value).(*conf.AdminBackend)
}
func maskStorageSecrets(storage *conf.AdminBackend_Storage) {
if storage == nil {
return
}
if storage.Qiniu != nil && storage.Qiniu.SecretKey != "" {
storage.Qiniu.SecretKey = "******"
}
for _, item := range []*conf.AdminBackend_ObjectStore{
storage.AliyunOss,
storage.HuaweiObs,
storage.TencentCos,
storage.AwsS3,
storage.CloudflareR2,
storage.Minio,
} {
if item != nil && item.SecretKey != "" {
item.SecretKey = "******"
}
}
}