role

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEntity

func DeleteEntity(entity *Entity) int64

func Page

func Page(q PageQuery) struct {
	Page     int
	PageSize int
	Total    int64
	Data     []Entity
}

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) error

Types

type Entity

type Entity struct {
	Id        uint64     `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"`         //
	RoleName  string     `gorm:"column:role_name;type:varchar(255);" json:"roleName"`            //
	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"`
	DeletedAt *time.Time `gorm:"column:deleted_at;type:datetime;" json:"deletedAt"` //
}

func AllEffective

func AllEffective() (entities []*Entity)

func Get

func Get(id any) (entity Entity)

func GetByRoleIds

func GetByRoleIds(roleIds []uint64) (entities []*Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

type PageQuery

type PageQuery struct {
	Page, PageSize int
	RoleName       string
}

Jump to

Keyboard shortcuts

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