Skip to content

Commit

Permalink
fixed upload validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Jan 18, 2024
1 parent cd77bb2 commit 2b49789
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions models/UploadChunck.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ type UploadChunck struct {
}

type UploadChunckValidation struct {
Index *uint `validate:"required,min=0,max=10000"`
SessionJwtToken string `validate:"required,jwt"`
Index *uint `validate:"required,min=0,max=10000" json:"Index" form:"Index"`
SessionJwtToken string `validate:"required,jwt" json:"SessionJwtToken" form:"SessionJwtToken"`
}
2 changes: 1 addition & 1 deletion models/UploadFile.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package models

type UploadFileValidation struct {
SessionJwtToken string `validate:"required,min=1"`
SessionJwtToken string `validate:"required,min=1" json:"SessionJwtToken" form:"SessionJwtToken"`
}
8 changes: 4 additions & 4 deletions models/UploadSession.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ type UploadSessionClaims struct {
}

type UploadSessionValidation struct {
Name string `validate:"required,min=1,max=128"`
Size int64 `validate:"required,number,min=1"`
ParentFolderID uint `validate:"number"`
Name string `validate:"required,min=1,max=128" json:"Name" form:"Name"`
Size int64 `validate:"required,number,min=1" json:"Size" form:"Size"`
ParentFolderID uint `validate:"number" json:"ParentFolderID" form:"ParentFolderID"`
}

type DeleteUploadSessionValidation struct {
UploadSessionUUID string `validate:"required,uuid_rfc4122"`
UploadSessionUUID string `validate:"required,uuid_rfc4122" json:"UploadSessionUUID" form:"UploadSessionUUID"`
}

0 comments on commit 2b49789

Please sign in to comment.