chore: replace all cn comments to en version by volc api (#313)
This commit is contained in:
@@ -61,7 +61,7 @@ func (v SysConfVariables) GroupByName() []*kvmemory.GroupVariableInfo {
|
||||
|
||||
groupName := variable.GroupName
|
||||
if groupName == "" {
|
||||
groupName = "未分组" // 处理空分组名
|
||||
groupName = "未分组" // Handling empty group names
|
||||
}
|
||||
|
||||
if _, ok := groups[groupName]; !ok {
|
||||
@@ -75,13 +75,13 @@ func (v SysConfVariables) GroupByName() []*kvmemory.GroupVariableInfo {
|
||||
groups[groupName].VarInfoList = append(groups[groupName].VarInfoList, variable)
|
||||
}
|
||||
|
||||
// 转换为切片并按组名排序
|
||||
// Convert to slices and sort by group name
|
||||
result := make([]*kvmemory.GroupVariableInfo, 0, len(groups))
|
||||
for _, group := range groups {
|
||||
result = append(result, group)
|
||||
}
|
||||
|
||||
// 可选:按组名排序
|
||||
// Optional: sort by group name
|
||||
sort.Slice(result, func(i, j int) bool {
|
||||
return result[i].GroupName < result[j].GroupName
|
||||
})
|
||||
|
||||
@@ -60,7 +60,7 @@ const (
|
||||
)
|
||||
|
||||
func (v *UserVariableMeta) GenSystemKV(ctx context.Context, keyword string) (*kvmemory.KVItem, error) {
|
||||
if keyword != sysUUIDKey { // 外场暂时只支持这一个变量
|
||||
if keyword != sysUUIDKey { // The outfield only supports this one variable for the time being
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ func (v *UserVariableMeta) genUUID(ctx context.Context) (*kvmemory.KVItem, error
|
||||
}
|
||||
|
||||
func (v *UserVariableMeta) encryptSysUUIDKey(ctx context.Context) string {
|
||||
// 拼接四个字段,中间用特殊分隔符(如 | )
|
||||
// Combine four fields with a special delimiter (e.g. |)
|
||||
plain := fmt.Sprintf("%d|%s|%s|%d", v.BizType, v.BizID, v.ConnectorUID, v.ConnectorID)
|
||||
return base64.StdEncoding.EncodeToString([]byte(plain))
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ func (v *VariableMetaSchema) nameValidate() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// 检查是否符合后面的部分正则规则
|
||||
// Check if some of the following regular rules are met
|
||||
pattern := `^[a-zA-Z_][a-zA-Z_$0-9]*$`
|
||||
match, _ := regexp.MatchString(pattern, identifier)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user