vo.go 976 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package devicesrv
  2. import (
  3. "Cold_Logistic/internal/server/infra/models"
  4. validation "github.com/go-ozzo/ozzo-validation/v4"
  5. "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core"
  6. )
  7. type DeviceSensorListReqVO struct {
  8. SnCode string `json:"snCode"`
  9. }
  10. func (r *DeviceSensorListReqVO) Validate() error {
  11. return validation.ValidateStruct(r, validation.Field(&r.SnCode, validation.Required))
  12. }
  13. type DeviceSensorListRespVO struct {
  14. SnCode string `json:"snCode"`
  15. SnIds interface{} `json:"snIds"`
  16. }
  17. type SnDataListReqVO struct {
  18. UserTokey string `json:"userTokey"`
  19. SnId string `json:"snId"`
  20. Page core.Page `json:"page"`
  21. Search struct {
  22. TimeStart models.MyTime `json:"timeStart"` // 2023-03-14 00:00:00
  23. TimeEnd models.MyTime `json:"timeEnd"`
  24. }
  25. }
  26. func (r *SnDataListReqVO) Validate() error {
  27. return validation.ValidateStruct(r,
  28. validation.Field(&r.SnId, validation.Required),
  29. validation.Field(&r.UserTokey, validation.Required),
  30. )
  31. }