userRoleRs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoleGroupByUserIds

func GetRoleGroupByUserIds(userIds []uint64) map[uint64][]role.Entity

func GetRoleIdsByUserId

func GetRoleIdsByUserId(userId uint64) []uint64

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) error

Types

type Entity

type Entity struct {
	Id        uint64    `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"`                //
	UserId    uint64    `gorm:"column:user_id;type:bigint unsigned;not null;default:0;" json:"userId"` //
	RoleId    uint64    `gorm:"column:role_id;type:bigint unsigned;not null;default:0;" json:"roleId"` //
	Effective int       `gorm:"column:effective;type:int;not null;default:0;" json:"effective"`        //
	CreatedAt time.Time `gorm:"column:created_at;index;autoCreateTime;" json:"createdAt"`              //
	UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}

func Get

func Get(id any) (entity Entity)

func GetByUserId

func GetByUserId(userId uint64) (entities []*Entity)

func GetByUserIdAndRoleId

func GetByUserIdAndRoleId(userId, roleId uint64) (entities Entity)

func GetByUserIds

func GetByUserIds(userIds []uint64) (entities []*Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

Jump to

Keyboard shortcuts

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