admin

package
v0.0.0-...-902682f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAdminRepo

func CreateAdminRepo(gormDb *gorm.DB) admin.Repository

Types

type Admin

type Admin struct {
	Id        int `gorm:"primaryKey"`
	Name      string
	Username  string `gorm:"unique"`
	Password  string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func FromDomain

func FromDomain(domain admin.Domain) Admin

func (*Admin) ToDomain

func (ad *Admin) ToDomain() admin.Domain

type AdminRepo

type AdminRepo struct {
	DB *gorm.DB
}

func (*AdminRepo) GetById

func (repo *AdminRepo) GetById(ctx context.Context, id int) (admin.Domain, error)

func (*AdminRepo) Login

func (repo *AdminRepo) Login(ctx context.Context, username string, password string) (admin.Domain, error)

Jump to

Keyboard shortcuts

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