add swagger

This commit is contained in:
kandrusyak
2023-08-02 22:49:48 +03:00
parent a1705758df
commit fe09a32bbc
4 changed files with 319 additions and 9 deletions

View File

@@ -2,12 +2,23 @@ package model
import "github.com/google/uuid"
// swagger:model PersonalInformation
type PersonalInformation struct {
ID uuid.UUID `json:"id,omitempty" validate:"required_without_all=FirstName LastName Patronymic Phone"`
FirstName string `json:"first_name,omitempty" validate:"required_without=ID"`
LastName string `json:"last_name,omitempty" validate:"required_without=ID"`
Patronymic string `json:"patronymic,omitempty" validate:"required_without=ID"`
Phone string `json:"phone,omitempty" validate:"required_without=ID"`
// The UUID of a person
// example: 6204037c-30e6-408b-8aaa-dd8219860b4b
ID uuid.UUID `json:"id,omitempty" validate:"required_without_all=FirstName LastName Patronymic Phone"`
// The first name of a person
// example: Иван
FirstName string `json:"first_name,omitempty" validate:"required_without=ID"`
// The last name of a person
// example: Иванов
LastName string `json:"last_name,omitempty" validate:"required_without=ID"`
// The patronymic of a person
// example: Иванович
Patronymic string `json:"patronymic,omitempty" validate:"required_without=ID"`
// The first name of a person
// example: 79206321370
Phone string `json:"phone,omitempty" validate:"required_without=ID"`
}
type PersonalInformationCreate struct {