sqlDomain

package
v0.0.0-...-65df244 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicSQL

type BasicSQL struct {
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time     `json:"updatedAt" bson:"updatedAt"`
	Status    domain.Status `json:"status" bson:"status"`
}

type Company

type Company struct {
	Id    uint64 `json:"id" bson:"id" gorm:"primary_key" `
	Name  string `json:"name" bson:"name"`
	Image string `json:"image" bson:"image"`
	BasicSQL
}

func (Company) GetId

func (p Company) GetId() interface{}

type MotionUser

type MotionUser struct {
	Id          uint64    `json:"id" gorm:"primary_key"`
	Name        string    `json:"name,omitempty"`
	Email       string    `json:"email" gorm:"unique"`
	Password    string    `json:"-"`
	LastName    string    `json:"lastName,omitempty"`
	Birthday    time.Time `json:"bithday,omitempty"`
	LastLogin   time.Time `json:"lastLogin,omitempty"`
	LoginCount  uint64    `json:"loginCount"`
	LoginAttemp uint8     `json:"loginAttemp,omitempty"`
	BasicSQL
}

func (MotionUser) GetId

func (user MotionUser) GetId() interface{}

type Profile

type Profile struct {
	Id         uint64     `json:"id" gorm:"primary_key"`
	Name       string     `json:"name"`
	FamilyName string     `json:"familyName"`
	Age        uint8      `json:"age"`
	Birthday   time.Time  `json:"birthday"`
	UserId     uint64     `json:"userId"`
	User       MotionUser `json:"user,omitempty"  gorm:"foreignkey:Id"`
	Roles      []Role     `json:"roles,omitempty" gorm:"many2many:profile_roles;"`
	BasicSQL
}

func (Profile) GetId

func (p Profile) GetId() interface{}

func (Profile) HaveRole

func (p Profile) HaveRole(role RoleEnum) bool

type Role

type Role struct {
	Id   uint     `json:"id" gorm:"primary_key"`
	Name RoleEnum `json:"name" gorm:"unique"`
}

func (Role) GetId

func (r Role) GetId() interface{}

type RoleEnum

type RoleEnum string
const (
	ADMIN RoleEnum = "ADMIN"
	USER  RoleEnum = "USER"
)

type RoleList

type RoleList []string

type Session

type Session struct {
	Id        uint64    `json:"id" gorm:"primary_key"`
	SessionId string    `json:"sessionId" gorm:"foreignkey:Id"`
	ProfileId uint64    `json:"profileId"`
	LastLogin time.Time `json:"lastLogin"`
	BasicSQL
}

func (Session) GetId

func (s Session) GetId() interface{}

Jump to

Keyboard shortcuts

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