Documentation ¶
Index ¶
Constants ¶
View Source
const AuthTableName string = "users_auth"
View Source
const DepartmentTableName string = "department"
View Source
const ProfileTableName string = "users_profile"
View Source
const UserTableName string = "users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { Base Status bool `gorm:"column:status;type:bool;not null;"` ProfileID uint `gorm:"column:profile_id;type:bigint;not null;index;" validate:"required,min=1"` Profile *Profile Token *string `gorm:"column:token;type:varchar(255);unique;index"` Password *string `gorm:"column:password;type:varchar(255);"` }
type AuthService ¶
type AuthService interface { Login(context.Context, *dto.AuthInputDTO, string) (*dto.AuthOutputDTO, error) Refresh(*User, string) *dto.AuthOutputDTO Me(*User) *dto.UserOutputDTO }
type Department ¶
type Department struct { Base Name string `gorm:"column:name;type:varchar(100);unique;index;not null;" validate:"required,min=2"` }
func (*Department) Bind ¶
func (s *Department) Bind(p *dto.DepartmentInputDTO) error
func (*Department) TableName ¶
func (s *Department) TableName() string
func (*Department) ToMap ¶
func (s *Department) ToMap() map[string]any
type DepartmentRepository ¶
type DepartmentRepository interface { CountDepartments(context.Context, *filter.Filter) (int64, error) GetDepartmentByID(context.Context, uint) (*Department, error) GetDepartments(context.Context, *filter.Filter) (*[]Department, error) CreateDepartment(context.Context, *dto.DepartmentInputDTO) (*Department, error) UpdateDepartment(context.Context, *Department, *dto.DepartmentInputDTO) error DeleteDepartments(context.Context, []uint) error }
type DepartmentService ¶
type DepartmentService interface { GenerateDepartmentOutputDTO(*Department) *dto.DepartmentOutputDTO GetDepartmentByID(context.Context, uint) (*dto.DepartmentOutputDTO, error) GetDepartments(context.Context, *filter.Filter) (*dto.ItemsOutputDTO[dto.DepartmentOutputDTO], error) CreateDepartment(context.Context, *dto.DepartmentInputDTO) (*dto.DepartmentOutputDTO, error) UpdateDepartment(context.Context, uint, *dto.DepartmentInputDTO) (*dto.DepartmentOutputDTO, error) DeleteDepartments(context.Context, []uint) error }
type Profile ¶
type ProfileRepository ¶
type ProfileRepository interface { CountProfiles(context.Context, *filter.Filter) (int64, error) GetProfileByID(context.Context, uint) (*Profile, error) GetProfiles(context.Context, *filter.Filter) (*[]Profile, error) CreateProfile(context.Context, *dto.ProfileInputDTO) (*Profile, error) UpdateProfile(context.Context, *Profile, *dto.ProfileInputDTO) error DeleteProfiles(context.Context, []uint) error }
type ProfileService ¶
type ProfileService interface { GenerateProfileOutputDTO(*Profile) *dto.ProfileOutputDTO GetProfileByID(context.Context, uint) (*dto.ProfileOutputDTO, error) GetProfiles(context.Context, *filter.Filter) (*dto.ItemsOutputDTO[dto.ProfileOutputDTO], error) CreateProfile(context.Context, *dto.ProfileInputDTO) (*dto.ProfileOutputDTO, error) UpdateProfile(context.Context, uint, *dto.ProfileInputDTO) (*dto.ProfileOutputDTO, error) DeleteProfiles(context.Context, []uint) error }
type User ¶
type User struct { Base Name string `gorm:"column:name;type:varchar(90);not null;" validate:"required,min=5"` Email string `gorm:"column:mail;type:varchar(50);not null;unique;index;" validate:"required,email"` PhotoPath *string `gorm:"column:photo;type:varchar(150);null;default:null;"` AuthID uint `gorm:"column:auth_id;type:bigint;not null;index;"` Auth *Auth `gorm:"constraint:OnDelete:CASCADE"` }
func (*User) GenerateToken ¶
func (*User) ValidatePassword ¶
type UserRepository ¶
type UserRepository interface { CountUsers(context.Context, *filters.UserFilter) (int64, error) GetUsers(context.Context, *filters.UserFilter) (*[]User, error) GetUserByID(context.Context, uint) (*User, error) GetUserByMail(context.Context, string) (*User, error) GetUserByToken(context.Context, string) (*User, error) CreateUser(context.Context, *dto.UserInputDTO) (*User, error) UpdateUser(context.Context, *User, *dto.UserInputDTO) error DeleteUsers(context.Context, []uint) error ResetUserPassword(context.Context, *User) error SetUserPassword(context.Context, *User, *dto.PasswordInputDTO) error SetUserPhoto(context.Context, *User, *File) error GenerateUserPhotoURL(context.Context, *User) (string, error) }
type UserService ¶
type UserService interface { GenerateUserOutputDTO(*User) *dto.UserOutputDTO GetUserByID(context.Context, uint) (*dto.UserOutputDTO, error) GetUsers(context.Context, *filters.UserFilter) (*dto.ItemsOutputDTO[dto.UserOutputDTO], error) CreateUser(context.Context, *dto.UserInputDTO) (*dto.UserOutputDTO, error) UpdateUser(context.Context, uint, *dto.UserInputDTO) (*dto.UserOutputDTO, error) DeleteUsers(context.Context, []uint) error ResetUserPassword(context.Context, string) error SetUserPassword(context.Context, string, *dto.PasswordInputDTO) error SetUserPhoto(context.Context, uint, *File) error GenerateUserPhotoURL(context.Context, uint) (string, error) }
Click to show internal directories.
Click to hide internal directories.