Files
online-backend/internal/identity/auth/dto.go
GuwandykA d1a6fcaadc
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled
ch some
2026-09-04 19:33:26 +05:00

120 lines
3.1 KiB
Go
Executable File

package auth
import "time"
type LoginDTO struct {
Name string `json:"name"`
Phone string `json:"phone"`
Password string `json:"password" binding:"required"`
}
type RefreshTokenDTO struct {
RefreshToken string `json:"refreshToken" binding:"required"`
}
type LocalizedText struct {
En string `json:"en"`
Ru string `json:"ru"`
Tm string `json:"tm"`
}
type ProfileRoleDTO struct {
Id int64 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
GuardName string `json:"guardName"`
}
type ProfileBranchDTO struct {
Id int64 `json:"id"`
UniqueCode string `json:"uniqueCode"`
Name LocalizedText `json:"name"`
}
type ProfilePermissionDTO struct {
Id int64 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
GuardName string `json:"guardName"`
Module string `json:"module"`
}
type ProfileModuleDTO struct {
Module string `json:"module"`
Permissions []ProfilePermissionDTO `json:"permissions"`
}
type UserProfileDTO struct {
Id int `json:"id"`
Name string `json:"name"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
Role *ProfileRoleDTO `json:"role"`
Branches []ProfileBranchDTO `json:"branches"`
Modules []ProfileModuleDTO `json:"modules"`
Permissions []ProfilePermissionDTO `json:"permissions"`
CreatedAt time.Time `json:"createdAt"`
}
type UpdateProfileDTO struct {
Name string `json:"name" binding:"required"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
}
type UserCredentials struct {
Id int
Password string
}
type RegisterDTO struct {
Name string `json:"name" binding:"required"`
Phone string `json:"phone" binding:"required"`
Username string `json:"username" binding:"required,min=3"`
Password string `json:"password" binding:"required,min=6"`
PasswordConfirm string `json:"passwordConfirm" binding:"required"`
}
type VerifyDTO struct {
Phone string `json:"phone" binding:"required"`
Code string `json:"code" binding:"required,len=6"`
}
type ForgotPasswordDTO struct {
Name string `json:"name" binding:"required"`
}
type ResetPasswordDTO struct {
Name string `json:"name" binding:"required"`
Code string `json:"code" binding:"required,len=6"`
Password string `json:"password" binding:"required,min=6"`
PasswordConfirm string `json:"passwordConfirm" binding:"required"`
}
type UserIdentity struct {
Id int
Name string
Username string
Phone string
}
type RegisterResult struct {
Phone string `json:"phone"`
ExpiresIn int `json:"expiresIn"`
}
type Verification struct {
ID int64
Name string
Username string
Phone string
Password string
CodeHash string
Attempts int
ExpiresAt time.Time
}