You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dataset.go 1.0 kB

5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435
  1. package auth
  2. import (
  3. "gitea.com/macaron/binding"
  4. "gitea.com/macaron/macaron"
  5. )
  6. // CreateDatasetForm form for dataset page
  7. type CreateDatasetForm struct {
  8. Title string `binding:"Required"`
  9. Category string `binding:"Required"`
  10. Description string `binding:"Required;MaxSize(254)"`
  11. License string `binding:"Required;MaxSize(64)"`
  12. Task string `binding:"Required;MaxSize(64)"`
  13. ReleaseID int64 `xorm:"INDEX"`
  14. Status bool
  15. Files []string
  16. }
  17. type EditDatasetForm struct {
  18. ID int64 `binding:"Required"`
  19. Title string `binding:"Required"`
  20. Category string `binding:"Required"`
  21. Description string `binding:"Required;MaxSize(254)"`
  22. License string `binding:"Required;MaxSize(64)"`
  23. Task string `binding:"Required;MaxSize(64)"`
  24. Status bool
  25. ReleaseID int64 `xorm:"INDEX"`
  26. Files []string
  27. }
  28. // Validate validates the fields
  29. func (f *CreateDatasetForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  30. return validate(errs, ctx.Data, f, ctx.Locale)
  31. }