Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mysql): 修改mysqldump压缩获取位点失败,mysql-monitor表大小统计合并 #8926 #8927

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api

import (
"bk-dbconfig/pkg/validate"
"dbm-services/common/go-pubpkg/validate"
)

// ApplyConfigItem TODO
Expand Down
3 changes: 2 additions & 1 deletion dbm-services/common/db-config/internal/api/config_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package api

import (
"bk-dbconfig/pkg/constvar"
"bk-dbconfig/pkg/validate"

"dbm-services/common/go-pubpkg/validate"

"github.com/pkg/errors"
)
Expand Down
6 changes: 4 additions & 2 deletions dbm-services/common/db-config/internal/api/config_plat.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package api

import (
"bk-dbconfig/pkg/validate"
"bk-dbconfig/pkg/validatestruct"

"dbm-services/common/go-pubpkg/validate"
)

// UpsertConfFilePlatReq TODO
Expand Down Expand Up @@ -42,7 +44,7 @@ func (f *UpsertConfFilePlatReq) Validate() error {
if err := validate.GoValidateStruct(*c, true); err != nil {
return err
}
valueTypeSub := validate.ValueTypeDef{ValueType: c.ValueType, ValueTypeSub: c.ValueTypeSub}
valueTypeSub := validatestruct.ValueTypeDef{ValueType: c.ValueType, ValueTypeSub: c.ValueTypeSub}
if err := valueTypeSub.Validate(); err != nil {
return err
}
Expand Down
4 changes: 3 additions & 1 deletion dbm-services/common/db-config/internal/api/dbha.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package api

import "bk-dbconfig/pkg/validate"
import (
"dbm-services/common/go-pubpkg/validate"
)

// BatchGetConfigItemReq TODO
// 批量获取多个对象的某一配置项
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"bk-dbconfig/internal/handler"
"bk-dbconfig/internal/service/simpleconfig"
"bk-dbconfig/pkg/constvar"
"bk-dbconfig/pkg/validate"

"dbm-services/common/go-pubpkg/validate"

"github.com/gin-gonic/gin"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import (
"bk-dbconfig/pkg/constvar"
"bk-dbconfig/pkg/core/logger"
"bk-dbconfig/pkg/util"
"bk-dbconfig/pkg/validate"

"dbm-services/common/go-pubpkg/validate"

"github.com/gin-gonic/gin"
"github.com/pkg/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"bk-dbconfig/pkg/constvar"
"bk-dbconfig/pkg/core/logger"
"bk-dbconfig/pkg/util"
"bk-dbconfig/pkg/validate"
"bk-dbconfig/pkg/validatestruct"

"github.com/pkg/errors"
"github.com/spf13/cast"
Expand Down Expand Up @@ -141,17 +141,17 @@ func CastValueType(confName string, confValue string, f api.BaseConfFileDef, val
if valueType == "" {
return confValue
}
if valueType == validate.DTypeInt {
if valueType == validatestruct.DTypeInt {
return cast.ToInt(confValue)
} else if valueType == validate.DTypeFloat || valueType == validate.DTypeNumber {
} else if valueType == validatestruct.DTypeFloat || valueType == validatestruct.DTypeNumber {
return cast.ToFloat32(confValue)
} else if valueType == validate.DTypeBool {
} else if valueType == validatestruct.DTypeBool {
return cmutil.ToBoolExt(confValue)
} else if valueType == validate.DTypeString {
if valueSubType == validate.DTypeSubList {
} else if valueType == validatestruct.DTypeString {
if valueSubType == validatestruct.DTypeSubList {
newValue := util.SplitAnyRuneTrim(confValue, ",")
return newValue
} else if valueSubType == validate.DTypeSubMap {
} else if valueSubType == validatestruct.DTypeSubMap {
mapI := make(map[string]interface{})
err := json.Unmarshal([]byte(confValue), &mapI)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"bk-dbconfig/internal/pkg/errno"
"bk-dbconfig/internal/repository/model"
"bk-dbconfig/pkg/util"
"bk-dbconfig/pkg/validate"
"bk-dbconfig/pkg/validatestruct"

"github.com/pkg/errors"
"gorm.io/gorm"
Expand Down Expand Up @@ -59,7 +59,7 @@ func CheckConfNameAndValue(c *model.ConfigModel, checkValue bool, valueType, val
}
cn.ValueDefault = c.ConfValue
// 如果不校验 conf_name, 那么 conf_name 可能在 name_def 里没定义,value_type, value_type_sub, value_allowed 都为空
err := validate.ValidateConfValue(cn.ValueDefault, cn.ValueType, cn.ValueTypeSub, cn.ValueAllowed)
err := validatestruct.ValidateConfValue(cn.ValueDefault, cn.ValueType, cn.ValueTypeSub, cn.ValueAllowed)
if err != nil {
errors.WithMessage(err, c.ConfName)
}
Expand Down
140 changes: 0 additions & 140 deletions dbm-services/common/db-config/pkg/validate/validate.go

This file was deleted.

Loading
Loading