system

package
v0.0.0-...-5eafb47 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 7

Documentation

Overview

自动生成模板SysDictionary

自动生成模板SysDictionaryDetail

自动生成模板SysOperationRecord

Index

Constants

View Source
const (
	SystemUser_Common string = "common"
	SystemUser_Admin  string = "admin"
)
View Source
const (
	ProjectBuildStatus_Empty    uint32 = 0
	ProjectBuildStatus_Building uint32 = 1
	ProjectBuildStatus_Failed   uint32 = 2
	ProjectBuildStatus_Success  uint32 = 3
)
View Source
const (
	ProjectDeployStatus_Empty    uint32 = 0
	ProjectDeployStatus_Building uint32 = 1
	ProjectDeployStatus_Failed   uint32 = 2
	ProjectDeployStatus_Success  uint32 = 3
)
View Source
const (
	AssociationTagType_Asset      string = "asset"
	AssociationTagType_SystemUser string = "systemuser"
)

Variables

View Source
var ErrAutoMove error = errors.New("创建代码成功并移动文件成功")

Functions

This section is empty.

Types

type AnsibleDynamicInventory

type AnsibleDynamicInventory struct {
	All  AnsibleHosts           `json:"all"`
	Meta map[string]interface{} `json:"_meta"`
}

type AnsibleHost

type AnsibleHost struct {
	IP      string
	Admin   string
	Port    uint
	User    []string
	AssetId string
}

type AnsibleHostVars

type AnsibleHostVars struct {
	AnsiblePort uint   `json:"ansible_port"`
	AnsibleUser string `json:"ansible_user"`
}

type AnsibleHosts

type AnsibleHosts struct {
	Hosts []string `json:"hosts"`
}

type AnsibleInventory

type AnsibleInventory struct {
	Hosts []AnsibleHost
}

type Asset

type Asset struct {
	kokoModel.Asset
	Network  string `json:"network"`
	RegionId string `json:"regionId" gorm:"column:RegionId;ype:varchar(128);comment:地区"`
}

资产信息

func (*Asset) GetSSHPort

func (a *Asset) GetSSHPort() int

type AssetManager

type AssetManager struct {
	Name      string `json:"name" gorm:"column:Name;type:varchar(64);comment:AssetManager名字;uniqueIndex"`
	Vendor    string `json:"vendor" gorm:"column:Vendor;type:varchar(16);comment:供应商名"`
	AssessID  string `json:"assessID" gorm:"column:AssessID;type:varchar(64);comment:AccessID;uniqueIndex"`
	AssessKey string `json:"assessKey" gorm:"column:AssessKey;type:varchar(64);comment:AssessKey;uniqueIndex"`
	Comment   string `json:"comment" gorm:"column:Comment;type:varchar(1024);comment:描述"`
	IsDefault bool   `json:"isDefault" gorm:"colunm:IsDefault;type:bool;default:false;"`
	global.GVA_MODEL
}

资产管理员信息

type AssetUserAssociate

type AssetUserAssociate struct {
	AssetId      string `json:"assetId" gorm:"column:AssetId;varchar(128);comment:资产Id"`
	SystemUser   string `json:"userId" gorm:"column:UserId;varchar(128);comment:系统用户id"`
	AssetNetwork string `json:"assetNetwork" gorm:"column:AssetNetwork;varchar(64);comment:资产所处环境"`
	global.GVA_MODEL
}

资产与系统用户的关联

type AutoCodeStruct

type AutoCodeStruct struct {
	StructName         string   `json:"structName"`         // Struct名称
	TableName          string   `json:"tableName"`          // 表名
	PackageName        string   `json:"packageName"`        // 文件名称
	HumpPackageName    string   `json:"humpPackageName"`    // go文件名称
	Abbreviation       string   `json:"abbreviation"`       // Struct简称
	Description        string   `json:"description"`        // Struct中文名称
	AutoCreateApiToSql bool     `json:"autoCreateApiToSql"` // 是否自动创建api
	AutoCreateResource bool     `json:"autoCreateResource"` // 是否自动创建资源标识
	AutoMoveFile       bool     `json:"autoMoveFile"`       // 是否自动移动文件
	BusinessDB         string   `json:"businessDB"`         // 业务数据库
	Fields             []*Field `json:"fields,omitempty"`
	HasTimer           bool
	DictTypes          []string `json:"-"`
	Package            string   `json:"package"`
	PackageT           string   `json:"-"`
	NeedValid          bool     `json:"-"`
}

AutoCodeStruct 初始版本自动化代码工具

func (*AutoCodeStruct) KeyWord

func (a *AutoCodeStruct) KeyWord()

KeyWord 是go关键字的处理加上 _ ,防止编译报错 Author [SliverHorn](https://github.com/SliverHorn)

func (*AutoCodeStruct) Pretreatment

func (a *AutoCodeStruct) Pretreatment()

func (*AutoCodeStruct) SuffixTest

func (a *AutoCodeStruct) SuffixTest()

SuffixTest 处理_test 后缀 Author [SliverHorn](https://github.com/SliverHorn)

type AutoPlugInfo

type AutoPlugInfo struct {
	Key  string `json:"key"`
	Type string `json:"type"`
	Desc string `json:"desc"`
}

func (AutoPlugInfo) Effective

func (a AutoPlugInfo) Effective() bool

type AutoPlugReq

type AutoPlugReq struct {
	PlugName    string         `json:"plugName"` // 必然大写开头
	Snake       string         `json:"snake"`    // 后端自动转为 snake
	RouterGroup string         `json:"routerGroup"`
	HasGlobal   bool           `json:"hasGlobal"`
	HasRequest  bool           `json:"hasRequest"`
	HasResponse bool           `json:"hasResponse"`
	NeedModel   bool           `json:"needModel"`
	Global      []AutoPlugInfo `json:"global,omitempty"`
	Request     []AutoPlugInfo `json:"request,omitempty"`
	Response    []AutoPlugInfo `json:"response,omitempty"`
}

func (*AutoPlugReq) CheckList

func (a *AutoPlugReq) CheckList()

type BaseServer

type BaseServer struct {
	ServerDetail
	IP       string `json:"IP" gorm:"column:IP;type:varchar(16);comment:IP地址(内网)"`
	Port     int    `json:"Port" gorm:"column:Port;type:uint;comment:SSH端口"`
	HostName string `json:"HostName" gorm:"column:HostName;type:varchar(32);common:主机名;uniqueIndex"`
}

type BuildHistories

type BuildHistories []*ProjectBuildHistory

func (*BuildHistories) Len

func (his *BuildHistories) Len() int

func (*BuildHistories) Less

func (his *BuildHistories) Less(i, j int) bool

func (*BuildHistories) Swap

func (his *BuildHistories) Swap(i, j int)

type CloudServer

type CloudServer struct {
	BaseServer
	PublicIpAddress    string `json:"PublicIpAddress" gorm:"column:PublicIpAddress;type:varchar(128);comment:外网IP, 可能保存多个,|分割"`
	Vendor             string `json:"Vendor" gorm:"column:Vendor;type:varchar(64);comment:供应商名"`
	RegionId           string `json:"RegionId" gorm:"column:RegionId;type:varchar(128);comment:地区"`
	InstanceId         string `json:"InstanceId" gorm:"column:InstanceId;type:varchar(64);comment:实例ID;uniqueIndex"`
	InstanceStatus     string `json:"InstanceStatus" gorm:"column:InstanceStatus;comment:实例状态"`
	ExpiredTime        string `json:"ExpiredTime" gorm:"column:ExpiredTime;type:date;"`
	InstanceTypeFamily string `json:"InstanceTypeFamily" gorm:"column:InstanceTypeFamily;varchar(16);comment:实例族"`
	ZoneId             string `json:"ZoneId" gorm:"column:ZoneId;type:varchar(32);comment:可用区"`
	InstanceType       string `json:"InstanceType" gorm:"column:InstanceType;type:varchar(64);comment:实例规格"`
	SecurityGroupIds   string `json:"SecurityGroupIds" gorm:"column:SecurityGroupIds;type:varchar(512);comment:所属安全组,可能有多个,|分割"`
	global.GVA_MODEL
}

外网主机信息

type ECSLaunchTemplateModel

type ECSLaunchTemplateModel struct {
	TemplateId           string `json:"TemplateId" gorm:"column:TemplateId;type:varchar(64);uniqueIndex;comment:模板ID;"`
	TemplateName         string `json:"TemplateName" gorm:"column:TemplateName;type:text;comment:模板名;"`
	DefaultVersionNumber int64  `json:"DefaultVersionNumber" gorm:"column:DefaultVersionNumber;type:int;comment:默认版本号;"`
	VersionNumber        int64  `json:"VersionNumber" gorm:"column:VersionNumber;type:int;"`
	VersionContent       string `json:"versionContent" gorm:"column:VersionContent;type:text;"`
	Comment              string `json:"Comment" gorm:"column:Comment;type:text;comment:备注内容;"`
	global.GVA_MODEL
}

ECS启动模板

type Field

type Field struct {
	FieldName       string `json:"fieldName"`       // Field名
	FieldDesc       string `json:"fieldDesc"`       // 中文名
	FieldType       string `json:"fieldType"`       // Field数据类型
	FieldJson       string `json:"fieldJson"`       // FieldJson
	DataTypeLong    string `json:"dataTypeLong"`    // 数据库字段长度
	Comment         string `json:"comment"`         // 数据库字段描述
	ColumnName      string `json:"columnName"`      // 数据库字段
	FieldSearchType string `json:"fieldSearchType"` // 搜索条件
	DictType        string `json:"dictType"`        // 字典
	Require         bool   `json:"require"`         // 是否必填
	ErrorText       string `json:"errorText"`       // 校验失败文字
	Clearable       bool   `json:"clearable"`       // 是否可清空
}

type GameServerIdCMDB

type GameServerIdCMDB struct {
	ServerId  uint32 `json:"serverId" gorm:"column:ServerId;type:int auto_increment;comment:服务器ID;uniqueIndex;"`
	UniqueKey string `json:"uniqueKey" gorm:"column:UniqueKey;type:varchar(256);comment:用户名@IP组成的键;uniqueIndex;"`
	User      string `json:"user" gorm:"column:User;type:varchar(256);comment:用户名"`
	HostIP    string `json:"hostIp" gorm:"column:HostIP;type:varchar(256);comment:主机IP"`
	Env       string `json:"env" gorm:"column:Env;type:varchar(64);comment:环境"`
	Machine   string `json:"machine" gorm:"column:Machine;type:varchar(64);comment:环境参数启动什么进程"`
	Network   string `json:"network" gorm:"column:Network;type:varchar(64);comment:内外网"`
}

type InternalServer

type InternalServer struct {
	BaseServer
	global.GVA_MODEL
}

内网主机信息

type JwtBlacklist

type JwtBlacklist struct {
	global.GVA_MODEL
	Jwt string `gorm:"type:text;comment:jwt"`
}

type Meta

type Meta struct {
	ActiveName  string `json:"activeName" gorm:"comment:高亮菜单"`
	KeepAlive   bool   `json:"keepAlive" gorm:"comment:是否缓存"`           // 是否缓存
	DefaultMenu bool   `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"` // 是否是基础路由(开发中)
	Title       string `json:"title" gorm:"comment:菜单名"`                // 菜单名
	Icon        string `json:"icon" gorm:"comment:菜单图标"`                // 菜单图标
	CloseTab    bool   `json:"closeTab" gorm:"comment:自动关闭tab"`         // 自动关闭tab
}

type PlayBook

type PlayBook struct {
	PlayBookName    string `json:"PlayBookName" gorm:"column:PlayBookName;type:varchar(256);uniqueIndex;"`
	PlayBookContent string `json:"PlayBookContent" gorm:"column:PlayBookContent;type:mediumtext;"`
	Comment         string `json:"Comment" gorm:"column:PlayBookName;type:varchar(2048);"`
	global.GVA_MODEL
}

剧本模型

type PlayBookModel

type PlayBookModel struct {
	Hosts string      `json:"hosts" yaml:"hosts,omitempty"`
	Tasks []TaskModel `json:"tasks" yaml:"tasks,omitempty"`
}

type PlayBookUsers

type PlayBookUsers struct {
	Host  string   `json:"host"`
	Users []string `json:"users"`
}

type Project

type Project struct {
	ProjectName    string `json:"projectName" gorm:"column:ProjectName;type:varchar(64);comment:项目名;primaryKey"`
	BranchName     string `json:"branchName" gorm:"column:BranchName;type:varchar(64);comment:分支名;primaryKey"`
	VCTool         string `json:"vcTool" gorm:"column:VCTool;type:varchar(32);comment:版本管理工具(git,svn)"`
	BranchRemote   string `json:"branchRemote" gorm:"column:BranchRemote;type:text;comment:分支地址"`
	CompileAssetId string `json:"compileAssetId" gorm:"column:CompileAssetId;type:varchar(64);comment:负责编译的资产ID"`
	CompileUser    string `json:"compileUser" gorm:"column:CompileUser;type:varchar(32);comment:编译资产用户名"`
	BuildStatus    uint32 `json:"buildStatus" gorm:"column:BuildStatus;type:int;comment:构建状态;"`
	BuildRequestId string `json:"buildRequestId" gorm:"column:BuildRequestId;type:varchar(256);comment:构建ID"`
	Network        string `json:"network" gorm:"column:Network;type:varchar(64);comment:网络环境,区分内外网;primaryKey"`
}

项目数据

type ProjectBuildHistory

type ProjectBuildHistory struct {
	ProjectName    string `json:"projectName" gorm:"column:ProjectName;type:varchar(64);comment:项目名"`
	BranchName     string `json:"branchName" gorm:"column:BranchName;type:varchar(64);comment:分支名"`
	RequestId      string `json:"requestId" gorm:"column:RequestId;type:varchar(256);comment:构建ID;uniqueIndex"`
	Env            string `json:"env" gorm:"column:Env;type:varchar(256);comment:环境"`
	Network        string `json:"network" gorm:"column:Network;type:varchar(64);comment:网络环境,区分内外网"`
	Status         uint32 `json:"status" gorm:"column:Status;type:int;comment:构建状态:1:构建中,2:构建失败,3:构建成功"`
	Output         string `json:"output" gorm:"column:Output;type:LONGTEXT;comment:构建输出"`
	Comment        string `json:"comment" gorm:"column:Comment;type:text;comment:构建说明;"`
	Version        string `json:"version" gorm:"column:Version;type:string;comment:版本号"`
	VersionMessage string `json:"versionMessage" gorm:"column:versionMessage;type:text;comment:版本消息;"`
	PackageUrl     string `json:"packageUrl" gorm:"column:PackageUrl;type:varchar(1024);comment:构建包下载地址;"`
	global.GVA_MODEL
}

项目构建记录

type ProjectDeployHistory

type ProjectDeployHistory struct {
	AssetId    string `json:"assetId" gorm:"column:AssetId;type:varchar(256);comment:资产Id"`
	SystemUser string `json:"systemUser" gorm:"column:SystemUser;type:varchar(256);comment:系统用户"`
	RequestId  string `json:"requestId" gorm:"column:RequestId;type:varchar(256);comment:请求Id;uniqueIndex"`
	PackageUrl string `json:"packageUrl" gorm:"column:PackageUrl;type:varchar(1024);comment:构建包下载地址;"`
	Output     string `json:"output" gorm:"column:Output;type:LONGTEXT;comment:构建输出"`
	Status     uint32 `json:"status" gorm:"column:Status;type:int;comment:构建状态:1:构建中,2:构建失败,3:构建成功"`
	Network    string `json:"network" gorm:"column:Network;type:varchar(64);comment:网络环境,区分内外网"`
}

项目部署记录

type ProjectDeployInfo

type ProjectDeployInfo struct {
	Network        string `json:"network" gorm:"column:Network;type:varchar(64);comment:网络环境,区分内外网"`
	ProjectName    string `json:"projectName" gorm:"column:ProjectName;type:varchar(64);comment:项目名"`
	BranchName     string `json:"branchName" gorm:"column:BranchName;type:varchar(64);comment:分支名"`
	AssetId        string `json:"assetId" gorm:"column:AssetId;type:varchar(256);comment:资产Id"`
	SystemUser     string `json:"userId" gorm:"column:UserId;varchar(128);comment:系统用户id"`
	Version        string `json:"version" gorm:"column:Version;type:string;comment:版本号"`
	VersionMessage string `json:"versionMessage" gorm:"column:versionMessage;type:text;comment:版本消息;"`
	PackageUrl     string `json:"packageUrl" gorm:"column:PackageUrl;type:varchar(1024);comment:构建包下载地址;"`
}

func (*ProjectDeployInfo) GetKey

func (m *ProjectDeployInfo) GetKey() string

type SecureGroup

type SecureGroup struct {
	GroupId   string `json:"groupId" gorm:"column:GroupId;type:varchar(64);uniqueIndex"`
	GroupName string `json:"groupName" gorm:"column:GroupName;type:varchar(128);"`
	GroupType string `json:"groupType" gorm:"column:GroupType;type:varchar(32);"`
	RegionId  string `json:"regionId" gorm:"column:RegoinId;type:varchar(64)"`
}

type ServerDetail

type ServerDetail struct {
	CPU    uint32 `json:"CPU" gorm:"column:CPU;type:uint;comment:cpu核心数"`
	OSName string `json:"OSName" gorm:"column:OSName;type:varchar(128);"`
	Memory int32  `json:"Memory" gorm:"column:Memory;type:int;comment:内存大小"`
	Disk   int64  `json:"Disk" gorm:"column:Disk;type:bigint;comment:磁盘大小"`
	OSType string `json:"OSType" gorm:"column:OSType;type:varchar(16);comment:操作系统信息"`
}

type ShellArgsModel

type ShellArgsModel struct {
	Executable string `json:"executable,omitempty" yaml:"executable,omitempty"`
}

type SysApi

type SysApi struct {
	global.GVA_MODEL
	Path        string `json:"path" gorm:"comment:api路径"`             // api路径
	Description string `json:"description" gorm:"comment:api中文描述"`    // api中文描述
	ApiGroup    string `json:"apiGroup" gorm:"comment:api组"`          // api组
	Method      string `json:"method" gorm:"default:POST;comment:方法"` // 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE
}

func (SysApi) TableName

func (SysApi) TableName() string

type SysAuthority

type SysAuthority struct {
	CreatedAt       time.Time       // 创建时间
	UpdatedAt       time.Time       // 更新时间
	DeletedAt       *time.Time      `sql:"index"`
	AuthorityId     uint            `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID
	AuthorityName   string          `json:"authorityName" gorm:"comment:角色名"`                                    // 角色名
	ParentId        uint            `json:"parentId" gorm:"comment:父角色ID"`                                       // 父角色ID
	DataAuthorityId []*SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id;"`
	Children        []SysAuthority  `json:"children" gorm:"-"`
	SysBaseMenus    []SysBaseMenu   `json:"menus" gorm:"many2many:sys_authority_menus;"`
	Users           []SysUser       `json:"-" gorm:"many2many:sys_user_authority;"`
	DefaultRouter   string          `json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"` // 默认菜单(默认dashboard)
}

func (SysAuthority) TableName

func (SysAuthority) TableName() string

type SysAuthorityBtn

type SysAuthorityBtn struct {
	AuthorityId      uint           `gorm:"comment:角色ID"`
	SysMenuID        uint           `gorm:"comment:菜单ID"`
	SysBaseMenuBtnID uint           `gorm:"comment:菜单按钮ID"`
	SysBaseMenuBtn   SysBaseMenuBtn ` gorm:"comment:按钮详情"`
}

type SysAuthorityMenu

type SysAuthorityMenu struct {
	MenuId      string `json:"menuId" gorm:"comment:菜单ID;column:sys_base_menu_id"`
	AuthorityId string `json:"-" gorm:"comment:角色ID;column:sys_authority_authority_id"`
}

func (SysAuthorityMenu) TableName

func (s SysAuthorityMenu) TableName() string

type SysAutoCode

type SysAutoCode struct {
	global.GVA_MODEL
	PackageName string `json:"packageName" gorm:"comment:包名"`
	Label       string `json:"label" gorm:"comment:展示名"`
	Desc        string `json:"desc" gorm:"comment:描述"`
}

type SysAutoCodeHistory

type SysAutoCodeHistory struct {
	global.GVA_MODEL
	Package       string `json:"package"`
	BusinessDB    string `json:"businessDB"`
	TableName     string `json:"tableName"`
	RequestMeta   string `gorm:"type:text" json:"requestMeta,omitempty"`   // 前端传入的结构化信息
	AutoCodePath  string `gorm:"type:text" json:"autoCodePath,omitempty"`  // 其他meta信息 path;path
	InjectionMeta string `gorm:"type:text" json:"injectionMeta,omitempty"` // 注入的内容 RouterPath@functionName@RouterString;
	StructName    string `json:"structName"`
	StructCNName  string `json:"structCNName"`
	ApiIDs        string `json:"apiIDs,omitempty"` // api表注册内容
	Flag          int    `json:"flag"`             // 表示对应状态 0 代表创建, 1 代表回滚 ...
}

SysAutoCodeHistory 自动迁移代码记录,用于回滚,重放使用

func (*SysAutoCodeHistory) ToRequestIds

func (m *SysAutoCodeHistory) ToRequestIds() request.IdsReq

ToRequestIds ApiIDs 转换 request.IdsReq Author [SliverHorn](https://github.com/SliverHorn)

type SysBaseMenu

type SysBaseMenu struct {
	global.GVA_MODEL
	MenuLevel     uint                                       `json:"-"`
	ParentId      string                                     `json:"parentId" gorm:"comment:父菜单ID"`     // 父菜单ID
	Path          string                                     `json:"path" gorm:"comment:路由path"`        // 路由path
	Name          string                                     `json:"name" gorm:"comment:路由name"`        // 路由name
	Hidden        bool                                       `json:"hidden" gorm:"comment:是否在列表隐藏"`     // 是否在列表隐藏
	Component     string                                     `json:"component" gorm:"comment:对应前端文件路径"` // 对应前端文件路径
	Sort          int                                        `json:"sort" gorm:"comment:排序标记"`          // 排序标记
	Meta          `json:"meta" gorm:"embedded;comment:附加属性"` // 附加属性
	SysAuthoritys []SysAuthority                             `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
	Children      []SysBaseMenu                              `json:"children" gorm:"-"`
	Parameters    []SysBaseMenuParameter                     `json:"parameters"`
	MenuBtn       []SysBaseMenuBtn                           `json:"menuBtn"`
}

func (SysBaseMenu) TableName

func (SysBaseMenu) TableName() string

type SysBaseMenuBtn

type SysBaseMenuBtn struct {
	global.GVA_MODEL
	Name          string `json:"name" gorm:"comment:按钮关键key"`
	Desc          string `json:"desc" gorm:"按钮备注"`
	SysBaseMenuID uint   `json:"sysBaseMenuID" gorm:"comment:菜单ID"`
}

type SysBaseMenuParameter

type SysBaseMenuParameter struct {
	global.GVA_MODEL
	SysBaseMenuID uint
	Type          string `json:"type" gorm:"comment:地址栏携带参数为params还是query"` // 地址栏携带参数为params还是query
	Key           string `json:"key" gorm:"comment:地址栏携带参数的key"`            // 地址栏携带参数的key
	Value         string `json:"value" gorm:"comment:地址栏携带参数的值"`            // 地址栏携带参数的值
}

type SysDictionary

type SysDictionary struct {
	global.GVA_MODEL
	Name                 string                `json:"name" form:"name" gorm:"column:name;comment:字典名(中)"`   // 字典名(中)
	Type                 string                `json:"type" form:"type" gorm:"column:type;comment:字典名(英)"`   // 字典名(英)
	Status               *bool                 `json:"status" form:"status" gorm:"column:status;comment:状态"` // 状态
	Desc                 string                `json:"desc" form:"desc" gorm:"column:desc;comment:描述"`       // 描述
	SysDictionaryDetails []SysDictionaryDetail `json:"sysDictionaryDetails" form:"sysDictionaryDetails"`
}

如果含有time.Time 请自行import time包

func (SysDictionary) TableName

func (SysDictionary) TableName() string

type SysDictionaryDetail

type SysDictionaryDetail struct {
	global.GVA_MODEL
	Label           string `json:"label" form:"label" gorm:"column:label;comment:展示值"`                                  // 展示值
	Value           int    `json:"value" form:"value" gorm:"column:value;comment:字典值"`                                  // 字典值
	Status          *bool  `json:"status" form:"status" gorm:"column:status;comment:启用状态"`                              // 启用状态
	Sort            int    `json:"sort" form:"sort" gorm:"column:sort;comment:排序标记"`                                    // 排序标记
	SysDictionaryID int    `json:"sysDictionaryID" form:"sysDictionaryID" gorm:"column:sys_dictionary_id;comment:关联标记"` // 关联标记
}

如果含有time.Time 请自行import time包

func (SysDictionaryDetail) TableName

func (SysDictionaryDetail) TableName() string

type SysMenu

type SysMenu struct {
	SysBaseMenu
	MenuId      string                 `json:"menuId" gorm:"comment:菜单ID"`
	AuthorityId uint                   `json:"-" gorm:"comment:角色ID"`
	Children    []SysMenu              `json:"children" gorm:"-"`
	Parameters  []SysBaseMenuParameter `json:"parameters" gorm:"foreignKey:SysBaseMenuID;references:MenuId"`
	Btns        map[string]uint        `json:"btns" gorm:"-"`
}

type SysOperationRecord

type SysOperationRecord struct {
	global.GVA_MODEL
	Ip           string        `json:"ip" form:"ip" gorm:"column:ip;comment:请求ip"`                                   // 请求ip
	Method       string        `json:"method" form:"method" gorm:"column:method;comment:请求方法"`                       // 请求方法
	Path         string        `json:"path" form:"path" gorm:"column:path;comment:请求路径"`                             // 请求路径
	Status       int           `json:"status" form:"status" gorm:"column:status;comment:请求状态"`                       // 请求状态
	Latency      time.Duration `json:"latency" form:"latency" gorm:"column:latency;comment:延迟" swaggertype:"string"` // 延迟
	Agent        string        `json:"agent" form:"agent" gorm:"column:agent;comment:代理"`                            // 代理
	ErrorMessage string        `json:"error_message" form:"error_message" gorm:"column:error_message;comment:错误信息"`  // 错误信息
	Body         string        `json:"body" form:"body" gorm:"type:text;column:body;comment:请求Body"`                 // 请求Body
	Resp         string        `json:"resp" form:"resp" gorm:"type:text;column:resp;comment:响应Body"`                 // 响应Body
	UserID       int           `json:"user_id" form:"user_id" gorm:"column:user_id;comment:用户id"`                    // 用户id
	User         SysUser       `json:"user"`
}

如果含有time.Time 请自行import time包

type SysUser

type SysUser struct {
	global.GVA_MODEL
	UUID        uuid.UUID      `json:"uuid" gorm:"index;comment:用户UUID"`                                                     // 用户UUID
	Username    string         `json:"userName" gorm:"index;comment:用户登录名"`                                                  // 用户登录名
	Password    string         `json:"-"  gorm:"comment:用户登录密码"`                                                             // 用户登录密码
	NickName    string         `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`                                            // 用户昵称
	SideMode    string         `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"`                                          // 用户侧边主题
	HeaderImg   string         `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像
	BaseColor   string         `json:"baseColor" gorm:"default:#fff;comment:基础颜色"`                                           // 基础颜色
	ActiveColor string         `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"`                                      // 活跃颜色
	AuthorityId uint           `json:"authorityId" gorm:"default:888;comment:用户角色ID"`                                        // 用户角色ID
	Authority   SysAuthority   `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
	Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"`
	Phone       string         `json:"phone"  gorm:"comment:用户手机号"`                     // 用户手机号
	Email       string         `json:"email"  gorm:"comment:用户邮箱"`                      // 用户邮箱
	Enable      int            `json:"enable" gorm:"default:1;comment:用户是否被冻结 1正常 2冻结"` //用户是否被冻结 1正常 2冻结
}

func (SysUser) TableName

func (SysUser) TableName() string

type SysUserAuthority

type SysUserAuthority struct {
	SysUserId               uint `gorm:"column:sys_user_id"`
	SysAuthorityAuthorityId uint `gorm:"column:sys_authority_authority_id"`
}

SysUserAuthority 是 sysUser 和 sysAuthority 的连接表

func (*SysUserAuthority) TableName

func (s *SysUserAuthority) TableName() string

type System

type System struct {
	Config config.Server `json:"config"`
}

配置文件结构体

type SystemUser

type SystemUser struct {
	kokoModel.SystemUser
	Type string `json:"type" gorm:"column:Type;type:varchar(32);"`
}

系统用户

type Tag

type Tag struct {
	TagName  string `json:"tagName" gorm:"column:TagName;type:varchar(128);comment:tag名;"`
	TagValue string `json:"tagValue" gorm:"column:TagValue;type:varchar(128);comment:tag值;"`
	Comment  string `json:"comment" gorm:"column:Comment;type:longtext;comment:备注;"`
	global.GVA_MODEL
}

资产标签

type TagAssociation

type TagAssociation struct {
	AssociationType string `json:"associationType" gorm:"column:AssociationType;type:varchar(256);comment:关联的事务, 比如asset, user等"`
	AssociatedID    string `json:"associatedID" gorm:"column:AssociatedID;type:varchar(256);comment:关联事务的Id"`
	TagIds          string `json:"tagIds" gorm:"column:TagIds;comment:标签ID"`
	global.GVA_MODEL

	IDMap map[uint]bool `json:"-" gorm:"-"`
}

func (*TagAssociation) AddTagId

func (tag *TagAssociation) AddTagId(tagId uint) bool

func (*TagAssociation) GetTagIdsString

func (tag *TagAssociation) GetTagIdsString() string

func (*TagAssociation) InitIDMap

func (tag *TagAssociation) InitIDMap()

func (*TagAssociation) IsTagExist

func (tag *TagAssociation) IsTagExist(tagId uint) bool

type TaskModel

type TaskModel struct {
	Name         string         `json:"name,omitempty" yaml:"name,omitempty"`
	IgnoreErrors string         `json:"ignore_errors" yaml:"ignore_errors,omitempty"`
	Shell        string         `json:"shell,omitempty" yaml:"shell,omitempty"`
	Args         ShellArgsModel `json:"args,omitempty" yaml:"args,omitempty"`
	Register     string         `json:"register,omitempty" yaml:"register,omitempty"`
	Debug        string         `json:"debug,omitempty"  yaml:"debug,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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