test

package
v0.0.0-...-e7a313f Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func InitDb

func InitDb()

InitDb 初始化数据库连接

Types

type Device

type Device struct {
	gorm.Model
	DeviceName string `gorm:"column:device_name;comment:设备名称"`
	NickName   string
	Status     *int   `gorm:"size:1;default:1;comment:状态(0-离线 1-在线)"`
	Flag       int    `gorm:"size:1;default:0;comment:标志位"`
	Ip         string `gorm:"-"`
	// contains filtered or unexported fields
}

type MInEnd

type MInEnd struct {
	RulexModel
	// UUID for origin source ID
	UUID        string `gorm:"not null"`
	Type        string `gorm:"not null"`
	Name        string `gorm:"not null"`
	Description string
	Config      string
	XDataModels string
}

type MRule

type MRule struct {
	RulexModel
	UUID        string `gorm:"not null"`
	Name        string `gorm:"not null"`
	Description string
	FromSource  stringList `gorm:"not null type:string[]"`
	FromDevice  stringList `gorm:"not null type:string[]"`
	Actions     string     `gorm:"not null"`
	Success     string     `gorm:"not null"`
	Failed      string     `gorm:"not null"`
}

type RulexModel

type RulexModel struct {
	ID        uint `gorm:"primarykey"`
	CreatedAt time.Time
}

type User

type User struct {
	Id       int64  `gorm:"primaryKey"`
	Username string `gorm:"size:255;comment:用户名"`
	Password string `gorm:"size:8;comment:密码"`
	Address  string `gorm:"size:255;comment:地址"`
	Tel      string `gorm:"size:11;comment:电话号码"`
	Admin    *bool  `gorm:"default:false;comment:管理员(0-否 1-是)"` //数据库默认会将bool转化为tinyint(1)
}

Jump to

Keyboard shortcuts

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