sysmodel

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminPermissions

type AdminPermissions struct {
	Id                int64  `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
	UserId            int64  `gorm:"column:user_id;type:int" json:"userId"`
	PermissionId      int64  `gorm:"column:permission_id;type:int" json:"permissionId"`
	TenantsId         int64  `gorm:"column:tenants_id;type:int" json:"tenantsId"`
	AppId             int64  `gorm:"column:app_id;type:int" json:"appId"`
	RoleId            int64  `gorm:"column:role_id;type:int(11);NOT NULL" json:"role_id"`
	RouteNameMd5Value string `gorm:"type:varchar(255);not null;" json:"route_name_md5_value" form:"route_name_md5_value"`
	RouteName         string `gorm:"type:varchar(255);not null;" json:"route_name" form:"route_name"`
}

func (*AdminPermissions) TableName

func (s *AdminPermissions) TableName() string

type AppInfo

type AppInfo struct {
	Id          int64  `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
	Key         string `gorm:"type:varchar(20);not null;size:20;unique" json:"key" form:"key"`      // 应用key
	Name        string `gorm:"type:varchar(255);not null;" json:"name" form:"name"`                 // 应用名称
	IsCreated   int64  `gorm:"type:int(1);not null;default:2;" json:"is_created" form:"is_created"` // 是否创建DB实例
	Status      int64  `gorm:"type:int(1);not null;default:0;" json:"status" form:"status"`         // 应用名称
	Description string `gorm:"type:varchar(255)" json:"description" form:"description"`             // 应用描述
	AppName     string `gorm:"type:varchar(255)" json:"app_name" form:"app_name"`
	Port        string `gorm:"type:varchar(255)" json:"port" form:"port"`
	No          int64  `gorm:"type:int(11)" json:"no" form:"no"`

	CreatedAt zone.Time `gorm:"column:created_at"`
	UpdatedAt zone.Time `gorm:"column:updated_at"`
}

AppInfo 应用信息表

func (*AppInfo) TableName

func (appInfo *AppInfo) TableName() string

TableName 指定表

type Authority

type Authority struct {
	Id                int64     `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
	Pid               int64     `gorm:"type:int(11);not null;size:11" json:"pid" form:"pid"`
	AppId             int64     `gorm:"type:int(11);not null;size:11" json:"app_id" form:"app_id"`
	Name              string    `gorm:"type:varchar(255);not null;" json:"name" form:"name"`
	MenuName          string    `gorm:"type:varchar(255);" json:"menu_name" form:"menu_name"`
	Description       string    `gorm:"type:varchar(255);not null;" json:"description" form:"description"`
	RegisterFileName  string    `gorm:"type:varchar(255);not null;" json:"register_file_name" form:"register_file_name"`
	MainHandlerName   string    `gorm:"type:varchar(255);not null;" json:"main_handler_name" form:"main_handler_name"`
	Method            string    `gorm:"type:varchar(255);not null;" json:"method" form:"method"`
	FormattedPath     string    `gorm:"type:varchar(255);not null;" json:"formatted_path" form:"formatted_path"`
	StaticPath        string    `gorm:"type:varchar(255);not null;" json:"static_path" form:"static_path"`
	Path              string    `gorm:"type:varchar(255);not null;" json:"path" form:"path"`
	SourceFileName    string    `gorm:"type:varchar(255);not null;" json:"source_file_name" form:"source_file_name"`
	RouteName         string    `gorm:"type:varchar(255);not null;" json:"route_name" form:"route_name"`
	Status            int64     `gorm:"type:int(11);not null;default:0;" json:"status" form:"status"`
	Md5Value          string    `gorm:"type:varchar(255);not null;" json:"md5_value" form:"md5_value"`
	RouteNameMd5Value string    `gorm:"type:varchar(255);not null;" json:"route_name_md5_value" form:"route_name_md5_value"`
	CreatedAt         zone.Time `gorm:"column:created_at"`
	UpdatedAt         zone.Time `gorm:"column:updated_at"`
}

Authority 权限模型

func (*Authority) TableName

func (Auth *Authority) TableName() string

TableName 指定表

type InstanceDb

type InstanceDb struct {
	ID                 int64     `gorm:"column:id;primary_key;auto_increment"`
	Code               string    `gorm:"column:code;type:varchar(255);not null"`
	AppName            string    `gorm:"column:app_name;type:varchar(255);not null"`
	UseType            string    `gorm:"column:use_type;type:varchar(255);not null"`
	AppId              int64     `gorm:"column:app_id;type:int unsigned;not null"`
	Host               string    `gorm:"column:host;type:varchar(255);not null"`
	DriverName         string    `gorm:"column:drivername;type:varchar(255);not null"`
	Port               int       `gorm:"column:port;type:int unsigned;not null"`
	Prefix             string    `gorm:"column:prefix;type:varchar(255);not null"`
	DbName             string    `gorm:"column:dbname;type:varchar(255);not null"`
	Dbuser             string    `gorm:"column:dbuser;type:varchar(255);not null"`
	Charset            string    `gorm:"column:charset;type:varchar(255);not null"`
	Collation          string    `gorm:"column:collation;type:varchar(255);not null"`
	SetmaxIdleconns    int       `gorm:"column:setmaxIdleconns;type:int unsigned;not null"`
	Setmaxopenconns    int       `gorm:"column:setmaxopenconns;type:int unsigned;not null"`
	Setconnmaxlifetime int       `gorm:"column:setconnmaxlifetime;type:int unsigned;not null"`
	Status             int       `gorm:"column:status;type:int(1);"`
	NetSwitch          int       `gorm:"column:net_switch;type:int(1);"`
	Password           string    `gorm:"column:password;type:varchar(255);not null"`
	Intranet           string    `gorm:"column:intranet;type:varchar(255);not null"`  //内网访问地址
	OuterNet           string    `gorm:"column:outer_net;type:varchar(255);not null"` //外网访问地址
	CreatedAt          zone.Time `gorm:"column:created_at"`
	UpdatedAt          zone.Time `gorm:"column:updated_at"`
}

InstanceDb 租户数据信息模型

func (*InstanceDb) TableName

func (instanceDb *InstanceDb) TableName() string

TableName 指定表

type InstanceObjectDB

type InstanceObjectDB struct {
	DbName     string   // 数据库连接名称
	AppName    string   //应用名
	AppId      int64    // 应用id
	ConnStr    string   // 连接串
	DriverName string   // 驱动名称
	Db         *gorm.DB // 数据库连接对象
	Dber       *sql.DB  // 数据库连接对象
	Prefix     string   //表前缀
}

type Permissions

type Permissions struct {
	Id                int64  `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
	PermissionId      int64  `gorm:"column:permission_id;type:int(11);NOT NULL;uniqueIndex" json:"permission_id"`
	Pid               int64  `gorm:"type:int(11);not null;size:11" json:"pid" form:"pid"`
	AppId             int64  `gorm:"type:int(11);not null;size:11" json:"app_id" form:"app_id"`
	Name              string `gorm:"type:varchar(255);not null;" json:"name" form:"name"`
	MenuName          string `gorm:"type:varchar(255);" json:"menu_name" form:"menu_name"`
	Description       string `gorm:"type:varchar(255);not null;" json:"description" form:"description"`
	RegisterFileName  string `gorm:"type:varchar(255);not null;" json:"register_file_name" form:"register_file_name"`
	MainHandlerName   string `gorm:"type:varchar(255);not null;" json:"main_handler_name" form:"main_handler_name"`
	Method            string `gorm:"type:varchar(255);not null;" json:"method" form:"method"`
	FormattedPath     string `gorm:"type:varchar(255);not null;" json:"formatted_path" form:"formatted_path"`
	StaticPath        string `gorm:"type:varchar(255);not null;" json:"static_path" form:"static_path"`
	Path              string `gorm:"type:varchar(255);not null;" json:"path" form:"path"`
	SourceFileName    string `gorm:"type:varchar(255);not null;" json:"source_file_name" form:"source_file_name"`
	RouteName         string `gorm:"type:varchar(255);not null;" json:"route_name" form:"route_name"`
	Status            int64  `gorm:"type:int(1);not null;default:0;" json:"status" form:"status"`
	Md5Value          string `gorm:"type:varchar(255);not null;" json:"md5_value" form:"md5_value"`
	RouteNameMd5Value string `gorm:"type:varchar(255);not null;" json:"route_name_md5_value" form:"route_name_md5_value"`

	CreatedAt zone.Time `gorm:"column:created_at"`
	UpdatedAt zone.Time `gorm:"column:updated_at"`
}

Permissions 权限明细表

func (*Permissions) TableName

func (s *Permissions) TableName() string

TableName 指定表

type PlatformAdmin

type PlatformAdmin struct {
	Id               int64  `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
	Mobile           string `gorm:"size:11;unique;" json:"mobile" form:"mobile"`               // 手机
	UserName         string `gorm:"size:100;" json:"username" form:"username"`                 // 用户名
	Email            string `gorm:"size:255;" json:"email" form:"email"`                       // 邮箱
	EmailVerified    bool   `gorm:"default:false" json:"emailVerified" form:"emailVerified"`   // 邮箱是否验证
	Nickname         string `gorm:"size:255;" json:"nickname" form:"nickname"`                 // 昵称
	Avatar           string `gorm:"type:text" json:"avatar" form:"avatar"`                     // 头像
	BackgroundImage  string `gorm:"type:text" json:"backgroundImage" form:"backgroundImage"`   // 个人中心背景图片
	Password         string `gorm:"size:512" json:"-" form:"password"`                         // 密码
	HomePage         string `gorm:"size:1024" json:"homePage" form:"homePage"`                 // 个人主页
	Description      string `gorm:"type:text" json:"description" form:"description"`           // 个人描述
	Score            int64  `gorm:"not null;" json:"score" form:"score"`                       // 积分
	Status           int64  `gorm:"not null" json:"status" form:"status"`                      // 状态
	TopicCount       int64  `gorm:"not null" json:"topicCount" form:"topicCount"`              // 帖子数量
	CommentCount     int64  `gorm:"not null" json:"commentCount" form:"commentCount"`          // 跟帖数量
	Roles            string `gorm:"type:text" json:"roles" form:"roles"`                       // 角色
	UserType         int64  `gorm:"not null" json:"type" form:"type"`                          // 用户类型
	ForbiddenEndTime int64  `gorm:"default:0" json:"forbiddenEndTime" form:"forbiddenEndTime"` // 禁言结束时间
	CreateTime       int64  `json:"createTime" form:"createTime"`                              // 创建时间
	UpdateTime       int64  `json:"updateTime" form:"updateTime"`                              // 更新时间
}

func (*PlatformAdmin) Default added in v1.0.4

func (ad *PlatformAdmin) Default() interface{}

func (*PlatformAdmin) GetTypeAttribute

func (ad *PlatformAdmin) GetTypeAttribute(value interface{}) interface{}

func (*PlatformAdmin) Scan added in v1.0.4

func (ad *PlatformAdmin) Scan(userId int64) error

func (*PlatformAdmin) TableName

func (ad *PlatformAdmin) TableName() string

TableName 指定表

func (*PlatformAdmin) User added in v1.0.4

func (ad *PlatformAdmin) User() *PlatformAdmin

func (*PlatformAdmin) Value added in v1.0.4

func (ad *PlatformAdmin) Value() interface{}

type RetrieveDB

type RetrieveDB struct {
	AppId   int64 // 应用id
	UseType string
	Status  int64  // 状态
	Code    string // 状态
}

RetrieveDB 检索租户对象

type RolePermissions

type RolePermissions struct {
	Id           int64 `gorm:"column:id;type:int(11) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
	PermissionId int64 `gorm:"column:permission_id;type:int(11);index:idx_permission_id" json:"permission_id"`
	RoleId       int64 `gorm:"column:role_id;type:int(11);NOT NULL" json:"role_id"`
	TenantsId    int64 `gorm:"column:tenants_id;type:int(11);NOT NULL" json:"tenants_id"`
	AppId        int64 `gorm:"column:app_id;type:int(11);NOT NULL" json:"app_id"`
}

RolePermissions 角色拥有权限

func (*RolePermissions) TableName

func (s *RolePermissions) TableName() string

TableName 指定表

type SysRoles

type SysRoles struct {
	Id          int64             `gorm:"column:id;type:int(11) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
	Name        string            `gorm:"column:name;type:varchar(255);NOT NULL" json:"name"`
	AppId       int64             `gorm:"column:app_id;type:int(11) unsigned;NOT NULL" json:"app_id"`
	CreatedAt   zone.Time         `gorm:"column:created_at"`
	UpdatedAt   zone.Time         `gorm:"column:updated_at"`
	Permissions []RolePermissions `gorm:"foreignKey:RoleId"`
}

SysRoles 角色表

func (*SysRoles) TableName

func (s *SysRoles) TableName() string

TableName 指定表

type Token

type Token struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	UserId   int64  `json:"UserId"`
	TenantId int64  `json:"TenantId"`
	Mobile   string `json:"Mobile"`
	UserType int    `json:"type"`
	Iss      string `json:"iss"`
	Iat      int64  `json:"iat"`
	Exp      int64  `json:"exp"`
}

type UserRoles

type UserRoles struct {
	Id     int64 `gorm:"primaryKey;autoIncrement" json:"id"`
	RoleId int64 `gorm:"column:role_id;type:int(11) UNSIGNED" json:"roleId"`
	UserId int64 `gorm:"column:user_id;type:int(11)" json:"userId"`
	AppId  int64 `gorm:"column:app_id;type:int(11) UNSIGNED" json:"app_id"`
}

func (*UserRoles) TableName

func (u *UserRoles) TableName() string

type UserToken

type UserToken struct {
	Id         int64  `gorm:"primaryKey;autoIncrement;" json:"id" form:"id"`
	Mobile     string `gorm:"size:11;;embeddedPrefix:my_" json:"mobile" form:"mobile"` // 手机
	Token      string `gorm:"type:text;" json:"token" form:"token"`
	UserId     int64  `gorm:"not null;index:idx_user_token_user_id;" json:"userId" form:"userId"`
	ExpiredAt  int64  `gorm:"not null;" json:"expiredAt" form:"expiredAt"`
	Status     int    `gorm:"not null;" json:"status" form:"status"`
	CreateTime int64  `gorm:"not null" json:"createTime" form:"createTime"`
	Md5Token   string `gorm:"size:255;unique;" json:"md5_token" form:"md5_token"` // token MD5
}

func (*UserToken) TableName

func (this *UserToken) TableName() string

Jump to

Keyboard shortcuts

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