get_system_setting.go
691 字节
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type GetSystemSettingQuery struct {
// 设置对应的编码
SettingCode string `json:"settingCode" valid:"Required"`
// 企业id
CompanyId int64 `json:"companyId" valid:"Required"`
}
func (getSystemSettingQuery *GetSystemSettingQuery) Valid(validation *validation.Validation) {
}
func (getSystemSettingQuery *GetSystemSettingQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(getSystemSettingQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}