dto

package
v0.0.0-...-29cd555 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	HttpCode int
	PgCode   string
	Message  string
}

func (*APIError) Error

func (e *APIError) Error() string

type AuthDataDTO

type AuthDataDTO struct {
	UserID      uint64
	UserName    string
	Email       string
	Permissions map[string]uint8
}

type AuthRequestDTO

type AuthRequestDTO struct {
	Login    string `json:"login"` // user email
	Password string `json:"password"`
}

type AuthResponseDTO

type AuthResponseDTO struct {
	Need2Fa      bool   `json:"need_2fa,omitempty"`
	AccessToken  string `json:"access_token,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
}

type BaseSearchRequestDto

type BaseSearchRequestDto struct {
	RawURL        string
	CreatedAtFrom time.Time `form:"created_at_from"`
	CreatedAtTo   time.Time `form:"created_at_to"`
	Page          *uint     `form:"page"`
	PerPage       *uint     `form:"per_page"`
	OrderBy       *string   `form:"order_by"`
	Offset        *uint
	Limit         *uint
}

type CreatePermissionDTO

type CreatePermissionDTO struct {
	RoleID      uint64
	ResourceID  uint64 `json:"resource_id"`
	ActionsMask string `json:"action_mask"`
	MethodMask  uint8
}

type CreateResourceDTO

type CreateResourceDTO struct {
	Name        string  `json:"name"`
	UriMask     string  `json:"uri_mask"`
	ActionsMask string  `json:"actions_mask"`
	IsActive    bool    `json:"is_active"`
	ResGroup    *string `json:"res_group,omitempty"`
	MethodMask  uint8
}

type CreateRoleDTO

type CreateRoleDTO struct {
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	IsPermitted bool   `json:"is_permitted"`
}

type CreateUserDTO

type CreateUserDTO struct {
	Email     string `json:"email"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Phone     string `json:"phone,omitempty"`
	IsActive  bool   `json:"is_active"`
	Is2fa     bool   `json:"is_2fa"`
	RoleID    uint64 `json:"role_id"`
	Password  string `json:"password"`
	Token2fa  string
}

type OTPRequestDTO

type OTPRequestDTO struct {
	Login    string `json:"login" binding:"required"`
	Password string `json:"password" binding:"required"`
	OtpKey   string `json:"otp_key" binding:"required"`
}

type PaginationInfo

type PaginationInfo struct {
	Total   uint   `json:"total"`
	Page    uint   `json:"page"`
	PerPage uint   `json:"per_page"`
	Pages   uint   `json:"pages"`
	Next    string `json:"next"`
	Prev    string `json:"prev"`
}

type PermissionDTO

type PermissionDTO struct {
	ID          uint64 `json:"id"`
	CreatedAt   string `json:"created_at"`
	RoleID      uint64 `json:"role_id"`
	ResourceID  uint64 `json:"resource_id"`
	ActionsMask string `json:"actions_mask"`
}

type PermissionsDTO

type PermissionsDTO struct {
	Pagination string `json:"-"`
	Items      []PermissionDTO
}

type RefreshRequestDTO

type RefreshRequestDTO struct {
	RefreshToken string `json:"refresh_token"`
}

type RefreshResponseDTO

type RefreshResponseDTO struct {
	AccessToken string `json:"access_token"`
}

type ResourceDTO

type ResourceDTO struct {
	ID          uint64 `json:"id"`
	CreatedAt   string `json:"created_at"`
	Name        string `json:"name"`
	UriMask     string `json:"uri_mask"`
	ActionsMask string `json:"actions_mask"`
	IsActive    bool   `json:"is_active"`
}

type ResourceGroupDTO

type ResourceGroupDTO struct {
	Name      string        `json:"name"`
	Resources []ResourceDTO `json:"resources"`
}

type ResourcesDTO

type ResourcesDTO struct {
	Items []ResourceGroupDTO
}

type RoleDTO

type RoleDTO struct {
	ID          uint64 `json:"id"`
	CreatedAt   string `json:"created_at"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	IsPermitted bool   `json:"is_permitted"`
}

type RolesDTO

type RolesDTO struct {
	Pagination string    `json:"-"`
	Items      []RoleDTO `json:"items"`
}

type SearchPermissionDTO

type SearchPermissionDTO struct {
	BaseSearchRequestDto
	RoleID     uint64
	ResourceID *uint64 `form:"resource_id"`
}

type SearchResourceDTO

type SearchResourceDTO struct {
	BaseSearchRequestDto
	ID       *uint64 `form:"id"`
	Name     *string `form:"name"`
	UriMask  *string `form:"uri_mask"`
	IsActive *bool   `form:"is_active"`
}

type SearchRoleDTO

type SearchRoleDTO struct {
	BaseSearchRequestDto
	ID          *uint64 `form:"id"`
	Name        *string `form:"name"`
	Slug        *string `form:"slug"`
	IsPermitted *bool   `form:"is_permitted"`
}

type SearchUserDTO

type SearchUserDTO struct {
	BaseSearchRequestDto
	ID        *uint64 `form:"id"`
	Email     *string `form:"email"`
	FirstName *string `form:"first_name"`
	LastName  *string `form:"last_name"`
	Phone     *string `form:"phone"`
	IsActive  *bool   `form:"is_active"`
	Is2fa     *bool   `form:"is_2fa"`
	RoleID    *uint64 `form:"role_id"`
}

type UpdatePermissionDTO

type UpdatePermissionDTO struct {
	ID          uint64  `json:"id"`
	ActionsMask *string `json:"action_mask"`
	MethodMask  uint8
}

type UpdateResourceDTO

type UpdateResourceDTO struct {
	ID          uint64
	Name        *string `json:"name,omitempty"`
	UriMask     *string `json:"uri_mask,omitempty"`
	ActionsMask *string `json:"actions_mask"`
	IsActive    *bool   `json:"is_active,omitempty"`
	ResGroup    *string `json:"res_group,omitempty"`
	MethodMask  *uint8
}

type UpdateRoleDTO

type UpdateRoleDTO struct {
	ID          uint64
	Name        *string `json:"name,omitempty"`
	Slug        *string `json:"slug,omitempty"`
	IsPermitted *bool   `json:"is_permitted,omitempty"`
}

type UpdateUserDTO

type UpdateUserDTO struct {
	ID          uint64
	Email       *string `json:"email,omitempty"`
	FirstName   *string `json:"first_name,omitempty"`
	LastName    *string `json:"last_name,omitempty"`
	Phone       *string `json:"phone,omitempty"`
	IsActive    *bool   `json:"is_active,omitempty"`
	Is2fa       *bool   `json:"is_2fa,omitempty"`
	RoleID      *uint64 `json:"role_id,omitempty"`
	LastLoginAt *time.Time
	Password    *string
}

type UserDTO

type UserDTO struct {
	ID        uint64 `json:"id"`
	CreatedAt string `json:"created_at"`
	Email     string `json:"email"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Phone     string `json:"phone"`
	IsActive  bool   `json:"is_active"`
	Is2fa     bool   `json:"is_2fa"`
	RoleID    uint64 `json:"role_id"`
}

type UsersDTO

type UsersDTO struct {
	Pagination string    `json:"-"`
	Items      []UserDTO `json:"items"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL