示例#1
0
文件: report.go 项目: quid-city/api
func (r *Report) Validate(col *bongo.Collection) []error {
	_, err := valid.ValidateStruct(r)
	errs := util.ConvertGovalidatorErrors(err)
	if r.Type != REQUEST && r.Type != COMPLAIN {
		errs = append(errs, errors.New("Type: invalid type of report"))
	}
	return errs
}
示例#2
0
文件: user.go 项目: quid-city/api
func (u *User) Validate(col *bongo.Collection) []error {
	_, errs := valid.ValidateStruct(u)
	return util.ConvertGovalidatorErrors(errs)
}