domain

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	domain.AuditingEnabled
	ButtonInfo
}

func (*Button) TableName

func (b *Button) TableName() string

表名

type ButtonArray

type ButtonArray []struct {
	MenuId           int64  `json:"menu_id"`
	ButtonId         int64  `json:"button_id"`
	RequestUrl       string `json:"request_url"`
	RequestMethod    string `json:"request_method"`
	Remark           string `json:"remark,omitempty"`
	Status           int64  `json:"status"`
	CreatedTime      string
	LastModifiedTime string
}

数据类型被使用时,shouldbindjson 对于数字是可以接受 int int64 float64, shouldbind 函数对于数字只能接受 float64

type ButtonInfo

type ButtonInfo struct {
	OperationInfo
	Color       string `gorm:"column:color" json:"color,omitempty"`
	AllowMethod string `gorm:"column:allow_method" json:"allowMethod,omitempty"`
}
type Menu struct {
	domain.AuditingEnabled
	MenuInfo
	Children []*Menu   `gorm:"-" json:"children,omitempty"`
	Buttons  []*Button `gorm:"foreignkey:Fid" json:"buttons,omitempty"`
}
func (a *Menu) TableName() string

表名

type MenuCreate struct {
	MenuInfo
	ButtonArray  `json:"button_array"`
	ButtonDelete string `json:"button_delete"`
}

系统菜单以及子表数据结构

type MenuEdit struct {
	MenuInfo
	ButtonArray  `json:"button_array"`
	ButtonDelete string `json:"button_delete"`
	Id           int64  `json:"id"`
}

菜单主表以及子表修改的数据结构

type MenuInfo struct {
	OperationInfo
	domain.ParametersEnabled
	Path      string `gorm:"column:path" json:"path,omitempty"`
	Component string `gorm:"column:component" json:"component,omitempty"`
	OutPage   bool   `gorm:"column:out_page" json:"outPage"`
	Hidden    bool   `gorm:"column:hidden;default:0" json:"hidden"`
}

type Module

type Module struct {
	domain.AuditingModel
	ModuleInfo

	Leaf     bool      `gorm:"-" json:"leaf"`
	Children []*Module `gorm:"-" json:"children,omitempty"`
}

func (*Module) TableName

func (*Module) TableName() string

type ModuleInfo

type ModuleInfo struct {
	Name        string `gorm:"column:name" json:"name"`
	Title       string `gorm:"column:title" json:"title,omitempty" i18n:"yes"`
	Description string `gorm:"column:description" json:"description,omitempty" i18n:"yes"`
	Type        string `gorm:"column:type;default:MODULE" json:"type"`
	Oid         int64  `gorm:"column:oid;default:null" json:"oid,omitempty"`
	Fid         int64  `gorm:"column:fid;default:null" json:"fid,omitempty"`
	Fids        string `gorm:"column:fids" json:"fids"`
	Path        string `gorm:"column:path" json:"path"`
	Status      int    `gorm:"column:status;default:1" json:"status"`
}

type Operation

type Operation struct {
	OperationInfo
	Children []*Operation `gorm:"-" json:"children,omitempty"`
}

type OperationInfo

type OperationInfo struct {
	domain.PropertiesEnabled
	Id     int64  `gorm:"primaryKey" json:"id" primaryKey:"yes"`
	Fid    int64  `gorm:"column:fid;default:0" json:"fid" fid:"Id"`
	Name   string `gorm:"column:name" json:"name"`
	Icon   string `gorm:"column:icon" json:"icon,omitempty"`
	Title  string `gorm:"column:title" json:"title,omitempty" i18n:"yes"`
	Type   string `gorm:"column:type;->" json:"type"`
	Tags   string `gorm:"column:tags" json:"tags,omitempty"`
	Sort   int    `gorm:"column:sort;default:100" json:"sort"`
	Status int    `gorm:"column:status;default:1" json:"status"`
	Remark string `gorm:"column:remark" json:"remark,omitempty"`
	Level  int    `gorm:"column:level;default:0" json:"level"`
	Expand bool   `gorm:"column:expand;->" json:"expand"`
	Leaf   bool   `gorm:"column:leaf;->" json:"leaf"`
	Checks string `gorm:"column:cks;->" json:"checks"`
}

菜单分配文件相关的数据类型 Type: [menu | button]

Jump to

Keyboard shortcuts

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