models

package
v0.0.0-...-6134ab3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	ID    uint   `gorm:"primarykey"`
	Name  string `json:"name"`
	Users []User `json:"users" gorm:"foreignKey:RoleID;"`
}

func (*Role) TableName

func (r *Role) TableName() string

type RoleRepo

type RoleRepo interface {
	Get(id string) (*Role, error)
	List() ([]*Role, error)
	Create(*Role) error
	Update(*Role) error
	Delete(id string) error
}

type RoleUsecase

type RoleUsecase interface {
	Get(id string) (*Role, error)
	List() ([]*Role, error)
	Create(*Role) error
	Update(*Role) error
	Delete(id string) error
}

type User

type User struct {
	ID       uint   `gorm:"primarykey"`
	Email    string `json:"email"`
	Password string `json:"password"`
	RoleID   uint   `json:"-"`
	Role     *Role  `json:"Role" gorm:"foreignKey:RoleID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

func (*User) TableName

func (u *User) TableName() string

type UserRepo

type UserRepo interface {
	Get(id string) (*User, error)
	List() ([]*User, error)
	Create(*User) error
	Update(*User) error
	Delete(id string) error
}

type UserUsecase

type UserUsecase interface {
	Get(id string) (*User, error)
	List() ([]*User, error)
	Create(*User) error
	Update(*User) error
	Delete(id string) error
}

Jump to

Keyboard shortcuts

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