role

package
v0.0.0-...-3363d21 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RoleSet = wire.NewSet(wire.Struct(new(RoleRepo), "*"))

Functions

func GetRoleDB

func GetRoleDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

Types

type Role

type Role struct {
	ID       uint64 `gorm:"column:id;primary_key;AUTO_INCREMENT"`
	UserID   uint64 `gorm:"column:user_id;NOT NULL"`
	UserName string `gorm:"column:user_name"`
	Value    string `gorm:"column:value"`
}

type RoleRepo

type RoleRepo struct {
	DB *gorm.DB
}

func (*RoleRepo) Create

func (a *RoleRepo) Create(ctx context.Context, role *Role) error

func (*RoleRepo) Delete

func (a *RoleRepo) Delete(ctx context.Context, userID uint64) error

func (*RoleRepo) FindAllByUsername

func (a *RoleRepo) FindAllByUsername(ctx context.Context, userName string) (*[]*Role, error)

func (*RoleRepo) Get

func (a *RoleRepo) Get(ctx context.Context, userID uint64) (*Role, error)

func (*RoleRepo) GetPage

func (a *RoleRepo) GetPage(ctx context.Context, userID uint64) (*[]*Role, error)

func (*RoleRepo) Update

func (a *RoleRepo) Update(ctx context.Context, role *Role) error

Jump to

Keyboard shortcuts

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