records

package
v0.0.0-...-4e22d16 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToArrayOfRoleV1Domain

func ToArrayOfRoleV1Domain(u *[]Roles) []V1Domains.RoleDomain

func ToArrayOfUsersV1Domain

func ToArrayOfUsersV1Domain(u *[]Users) []V1Domains.UserDomain

func ToProductV1Domain

func ToProductV1Domain(a *Products) V1Domains.ProductDomain

func ToRoleV1Domain

func ToRoleV1Domain(a *Roles) V1Domains.RoleDomain

Types

type Accounts

type Accounts struct {
	gorm.Model
	Username string   `gorm:"type:varchar(200);unique;"` // unique
	Password string   `gorm:"type:varchar(200);"`
	Email    string   `gorm:"type:varchar(200);unique;"` // unique
	Roles    []*Roles `gorm:"many2many:account_roles;"`
}

type Authorizations

type Authorizations struct {
	gorm.Model
	ID          uint     `gorm:"primaryKey;autoIncrement;"`
	Name        string   `gorm:"type:varchar(200);"`
	Description string   `gorm:"type:varchar(200);"`
	Roles       []*Roles `gorm:"many2many:role_authorizations;"`
}

func FromAuthorizationV1Domain

func FromAuthorizationV1Domain(u *V1Domains.AuthorizationDomain) Authorizations

func (*Authorizations) ToV1Domain

type Products

type Products struct {
	gorm.Model
	ID          int    `gorm:"primaryKey;autoIncrement;"`
	Name        string `gorm:"type:varchar(200);"`
	Description string `gorm:"type:varchar(200);"`
}

func FromProductV1Domain

func FromProductV1Domain(u *V1Domains.ProductDomain) Products

func (*Products) ToV1Domain

func (u *Products) ToV1Domain() V1Domains.ProductDomain

type RoleAuthorizations

type RoleAuthorizations struct {
	RolesID          int `gorm:"primaryKey;autoIncrement:false;"`
	AuthorizationsID int `gorm:"primaryKey;autoIncrement:false;"`
}

func (*RoleAuthorizations) ToV1Domain

type Roles

type Roles struct {
	gorm.Model
	ID             int               `gorm:"primaryKey;autoIncrement;"`
	Name           string            `gorm:"type:varchar(200);unique;"`
	Description    string            `gorm:"type:varchar(200);"`
	Accounts       []*Accounts       `gorm:"many2many:account_roles;"`
	Authorizations []*Authorizations `gorm:"many2many:role_authorizations;"`
}

func FromRoleV1Domain

func FromRoleV1Domain(u *V1Domains.RoleDomain) Roles

func (*Roles) ToV1Domain

func (u *Roles) ToV1Domain() V1Domains.RoleDomain

type Users

type Users struct {
	gorm.Model
	ID       string `gorm:"type:uuid;default:uuid_generate_v4();primaryKey;"`
	Username string `json:"username" gorm:"type:varchar(200);"`
	Email    string `json:"email" gorm:"type:varchar(200);"`
	Password string `json:"password" gorm:"type:varchar(200);"`
	Active   bool   `json:"active" gorm:"type:boolean;"`
	RoleId   int    `json:"role_id" gorm:"type:integer;"`
}

func FromUsersV1Domain

func FromUsersV1Domain(u *V1Domains.UserDomain) Users

func (*Users) ToV1Domain

func (u *Users) ToV1Domain() V1Domains.UserDomain

Jump to

Keyboard shortcuts

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