mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
24 lines
856 B
Go
24 lines
856 B
Go
package validation
|
|
|
|
type FcrStandard struct {
|
|
Weight float64 `json:"weight" validate:"required,gte=0"`
|
|
FcrNumber float64 `json:"fcr_number" validate:"required,gte=0"`
|
|
Mortality float64 `json:"mortality" validate:"required,gte=0"`
|
|
}
|
|
|
|
type Create struct {
|
|
Name string `json:"name" validate:"required_strict,min=3,max=50"`
|
|
FcrStandards []FcrStandard `json:"fcr_standards" validate:"required,min=1,dive"`
|
|
}
|
|
|
|
type Update struct {
|
|
Name *string `json:"name,omitempty" validate:"omitempty_strict,min=3,max=50"`
|
|
FcrStandards []FcrStandard `json:"fcr_standards,omitempty" validate:"omitempty,min=1,dive"`
|
|
}
|
|
|
|
type Query struct {
|
|
Page int `query:"page" validate:"omitempty,number,min=1"`
|
|
Limit int `query:"limit" validate:"omitempty,number,min=1,max=100"`
|
|
Search string `query:"search" validate:"omitempty,max=50"`
|
|
}
|