get_column_setting.go 764 字节
package query

import (
	"fmt"

	"github.com/astaxie/beego/validation"
)

type GetColumnSettingQuery struct {
	// 栏目设置id
	ColumnSettingId int64 `json:"columnSettingId"`
	// 公司id
	CompanyId int `json:"companyId"`
	// 用户uid
	Uid int64 `json:"uid"`
}

//func (getColumnSettingQuery *GetColumnSettingQuery) Valid(validation *validation.Validation) {
//	_ = validation.SetError("CustomValid", "未实现的自定义认证")
//}

func (getColumnSettingQuery *GetColumnSettingQuery) ValidateQuery() error {
	valid := validation.Validation{}
	b, err := valid.Valid(getColumnSettingQuery)
	if err != nil {
		return err
	}
	if !b {
		for _, validErr := range valid.Errors {
			return fmt.Errorf("%s  %s", validErr.Key, validErr.Message)
		}
	}
	return nil
}