package gmodel

import (
	"gorm.io/gorm"
)

// fs_auth_item 用户角色和权限信息
type FsAuthItem struct {
	Name        string  `gorm:"primary_key;default:'';" json:"name"` // 角色或权限名称
	Type        *int64  `gorm:"index;default:0;" json:"type"`        // 权限类型:1 表示角色,2 表示权限
	Description *string `gorm:"default:'';" json:"description"`      // 角色或权限描述
	RuleName    *string `gorm:"index;default:'';" json:"rule_name"`  //
	Data        *[]byte `gorm:"default:'';" json:"data"`             // 角色或权限的额外数据
	CreatedAt   *int64  `gorm:"default:0;" json:"created_at"`        //
	UpdatedAt   *int64  `gorm:"default:0;" json:"updated_at"`        //
	// FsAuthItemIbfk1 foreign  `gorm:"" json:"fs_auth_item_ibfk_1"`//
}
type FsAuthItemModel struct {
	db   *gorm.DB
	name string
}

func NewFsAuthItemModel(db *gorm.DB) *FsAuthItemModel {
	return &FsAuthItemModel{db: db, name: "fs_auth_item"}
}