Shioriko/pkg/models/create_update.go

43 lines
1.2 KiB
Go
Raw Permalink Normal View History

2021-05-09 15:07:23 +00:00
package models
type UserCreateModel struct {
Email string `json:"email" validate:"required,email"`
Username string `json:"username" validate:"required"`
Password string `json:"password" validate:"required"`
}
type UserUpdateModel struct {
2022-04-15 19:20:14 +00:00
Email string `json:"email" validate:"required,email"`
Username string `json:"username" validate:"required"`
OldPassword string `json:"oldPassword"`
NewPassword string `json:"newPassword"`
2021-05-09 15:07:23 +00:00
}
type TagTypeCreateModel struct {
Name string `json:"name" validate:"required,ascii"`
}
type TagCreateModel struct {
Name string `json:"name" validate:"required,ascii"`
TagTypeID uint `json:"tagTypeId" validate:"required"`
}
type TagUpdateModel struct {
Name string `json:"name" validate:"required,ascii"`
TagTypeID uint `json:"tagTypeId" validate:"required"`
}
2022-04-15 19:20:14 +00:00
type TagNoteUpdateModel struct {
Note string `json:"note" validate:"required"`
}
2021-05-09 15:07:23 +00:00
type PostCreateModel struct {
BlobID string `json:"blob_id" validate:"required"`
SourceURL string `json:"source_url"`
2021-05-11 11:00:05 +00:00
Tags []string `json:"tags"`
2021-05-09 15:07:23 +00:00
}
type PostUpdateModel struct {
SourceURL string `json:"source_url"`
2021-05-11 11:00:05 +00:00
Tags []string `json:"tags"`
2021-05-09 15:07:23 +00:00
}