models

package
v0.0.0-...-8b29af2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	ID        uint           `json:"id" gorm:"primary_key"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	Name      *string        `json:"name"`
	Desc      *string        `json:"desc"`
	Host      string         `json:"host"`
	Port      string         `json:"port"`
	Username  *string        `json:"username"`
	Password  *string        `json:"password"`
	Driver    string         `json:"driver"`
}

type Job

type Job struct {
	ID          uint           `json:"id" gorm:"primary_key"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Active      bool           `json:"active"`
}

type Model

type Model struct{}

func New

func New() *Model

func (*Model) Migrate

func (m *Model) Migrate(db *gorm.DB) error

func (*Model) Seeds

func (m *Model) Seeds(db *gorm.DB) error

type Permission

type Permission struct {
	ID        uint           `json:"id" gorm:"primary_key"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	Slug      string         `json:"slug"`
	Name      string         `json:"name"`
}

func (*Permission) Seed

func (*Permission) Seed(db *gorm.DB)

type Role

type Role struct {
	ID        uint           `json:"id" gorm:"primary_key"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	Slug      string         `json:"slug"`
	Name      string         `json:"name"`
}

func (*Role) Seed

func (*Role) Seed(db *gorm.DB)

type RolePermission

type RolePermission struct {
	ID           uint           `json:"id" gorm:"primary_key"`
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
	DeletedAt    gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	RoleID       uint           `json:"role_id"`
	PermissionID uint           `json:"permission_id"`
	Role         Role           `json:"role"`
	Permission   Permission     `json:"permission"`
}

func (*RolePermission) Seed

func (*RolePermission) Seed(db *gorm.DB)

type User

type User struct {
	ID          uint           `json:"id" gorm:"primary_key"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	PhoneNumber string         `json:"phone_number"`
	Name        string         `json:"name"`
	RoleID      uint           `json:"role_id"`
	Role        Role           `json:"role"`
	Token       *string        `json:"token"`
	ExpiredAt   *string        `json:"expired_at"`
}

func (*User) Seed

func (*User) Seed(db *gorm.DB)

Jump to

Keyboard shortcuts

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