model

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

数据库实体层

应用启动引擎层

Index

Constants

View Source
const (
	MysqlDbTyp  = "mysql"
	SqliteDbTyp = "sqlite3"
)

Variables

View Source
var EsLinkList = []EsLinkModel{}

Functions

This section is empty.

Types

type Config

type Config struct {
	Log struct {
		StorageDays int    `json:"storageDays"`
		LogDir      string `json:"logDir"`
	} `json:"log"`
	Port   int    `json:"port"`
	DbType string `json:"dbType"`
	Sqlite struct {
		DbPath string `json:"dbPath"`
	} `json:"sqlite"`
	Mysql struct {
		Username     string `json:"username"`
		Pwd          string `json:"pwd"`
		IP           string `json:"ip"`
		Port         string `json:"port"`
		DbName       string `json:"dbName"`
		MaxOpenConns int    `json:"maxOpenConns"`
		MaxIdleConns int    `json:"maxIdleConns"`
	} `json:"mysql"`
	AppSecret   string `json:"appSecret"`
	Version     string `json:"version"`
	DeBug       bool   `json:"deBug"`
	EsPwdSecret string `json:"esPwdSecret"`
}

全局配置结构体

var GlobConfig Config

func (*Config) GetDbType

func (this *Config) GetDbType() string

type DataxLinkInfoModel

type DataxLinkInfoModel struct {
	Id       int    `db:"id" json:"id"`
	Ip       string `db:"ip" json:"ip"`
	Port     int    `db:"port" json:"port"`
	DbName   string `db:"db_name" json:"db_name"`
	Username string `db:"username" json:"username"`
	Pwd      string `db:"pwd" json:"pwd"`
	Remark   string `db:"remark" json:"remark"`
	Typ      string `db:"typ" json:"typ"`
	Updated  string `db:"updated" json:"updated"`
	Created  string `db:"created" json:"created"`
}

type DataxListModel

type DataxListModel struct {
	Id          int    `json:"id" db:"id"`
	FormData    string `json:"form_data" db:"form_data"`
	Remark      string `json:"remark" db:"remark"`
	Table_name  string `json:"table_name" db:"table_name"`
	Index_name  string `json:"index_name" db:"index_name"`
	Error_msg   string `json:"error_msg" db:"error_msg"`
	Status      string `json:"status" db:"status"`
	Dbcount     int    `json:"dbcount" db:"dbcount"  `
	Escount     int    `json:"escount" db:"escount"  `
	Updated     string `json:"updated" db:"updated"`
	Created     string `json:"created" db:"created"`
	EsConnect   int    `json:"es_connect" db:"es_connect"`
	CrontabSpec string `json:"crontab_spec" db:"crontab_spec"`
}

type EsLinkModel

type EsLinkModel struct {
	ID      int64  `gorm:"column:id" json:"id" db:"id"`
	Ip      string `gorm:"column:ip" json:"ip" db:"ip"`
	User    string `gorm:"column:user" json:"user" db:"user"`
	Pwd     string `gorm:"column:pwd" json:"pwd" db:"pwd"`
	Created string `gorm:"column:created" json:"created" db:"created"`
	Updated string `gorm:"column:updated" json:"updated" db:"updated"`
	Remark  string `gorm:"column:remark" json:"remark" db:"remark"`
	Version int    `json:"version" db:"version"`
}

EsLinkModel es连接信息表

func (this *EsLinkModel) FlushEsLinkList() (err error)

刷新eslink表数据到内存

func (*EsLinkModel) GetListAction

func (this *EsLinkModel) GetListAction() (esLinkList []EsLinkModel, err error)

获取列表信息

type GmDslHistoryModel

type GmDslHistoryModel struct {
	ID         int      `gorm:"column:id" json:"id" form:"id" db:"id"`
	Uid        int      `gorm:"column:uid" json:"uid" form:"uid" db:"uid"`
	Method     string   `gorm:"column:method" json:"method" form:"method" db:"method"`
	Path       string   `gorm:"column:path" json:"path" form:"path" db:"path"`
	Body       string   `gorm:"column:body" json:"body" form:"body" db:"body"`
	Created    string   `gorm:"column:created" json:"created" form:"created" db:"created"`
	FilterDate []string `json:"date"`
	IndexName  string   `json:"indexName"`
	Page       int      `json:"page"`
	Limit      int      `json:"limit"`
}
http://sql2struct.atotoa.com 根据表结构生成 go结构体

GmDslHistoryModel DSL历史记录

func (*GmDslHistoryModel) Clean

func (this *GmDslHistoryModel) Clean() (err error)

Clean

func (*GmDslHistoryModel) Count

func (this *GmDslHistoryModel) Count() (count int, err error)

Count

func (*GmDslHistoryModel) Insert

func (this *GmDslHistoryModel) Insert() (err error)

Insert

func (*GmDslHistoryModel) List

func (this *GmDslHistoryModel) List() (gmDslHistoryModelList []GmDslHistoryModel, err error)

List

func (*GmDslHistoryModel) TableName

func (this *GmDslHistoryModel) TableName() string

表名

type GmGuidModel

type GmGuidModel struct {
	ID       int    `json:"id"`
	Uid      int    `json:"uid" db:"uid"`
	GuidName string `json:"guid_name" db:"guid_name"`
	Created  string `json:"created" db:"created"`
}

新手引导

func (*GmGuidModel) TableName

func (this *GmGuidModel) TableName() string

TableName

type GmOperaterLog

type GmOperaterLog struct {
	ID             int64  `gorm:"column:id" json:"id" form:"id"`
	OperaterName   string `gorm:"column:operater_name" json:"operater_name" form:"operater_name"`
	OperaterId     int64  `gorm:"column:operater_id" json:"operater_id" form:"operater_id"`
	OperaterAction string `gorm:"column:operater_action" json:"operater_action" form:"operater_action"`
	Created        string `gorm:"column:created" json:"created" form:"created"`
	Method         string `gorm:"column:method" json:"method" form:"method"`
	Parmas         string `gorm:"column:parmas" json:"parmas" form:"parmas"`
	Body           string `gorm:"column:body" json:"body" form:"body"`
	OperaterRoleId int    `gorm:"column:operater_role_id" json:"operater_role_id" form:"operater_role_id"`
}

func (*GmOperaterLog) Insert

func (this *GmOperaterLog) Insert() (err error)

func (*GmOperaterLog) TableName

func (this *GmOperaterLog) TableName() string

type GmRoleModel

type GmRoleModel struct {
	ID          int    `json:"id" db:"id"`
	RoleName    string `json:"name" db:"role_name"`
	Description string `json:"description" db:"description"`
	RoleList    string `json:"routes" db:"role_list"`
}

GmRoleModel

func (*GmRoleModel) Delete

func (this *GmRoleModel) Delete() (err error)

Delete

func (*GmRoleModel) GetById

func (this *GmRoleModel) GetById(roleId int) (model GmRoleModel, err error)

GetById

func (*GmRoleModel) Insert

func (this *GmRoleModel) Insert() (id int64, err error)

Insert

func (*GmRoleModel) Select

func (this *GmRoleModel) Select() (model []GmRoleModel, err error)

Select

func (*GmRoleModel) Update

func (this *GmRoleModel) Update() (err error)

Update

type GmUserModel

type GmUserModel struct {
	ID       int32  `json:"id" db:"id"`
	Username string `json:"username" db:"username"`
	Password string `json:"password" db:"password"`
	RoleId   int32  `json:"role_id" db:"role_id"`
	Realname string `json:"realname" db:"realname"`
}

GmUserModel GM用户

func (GmUserModel) Delete

func (this GmUserModel) Delete() (err error)

Delete

func (GmUserModel) Exsit

func (this GmUserModel) Exsit() (b bool, err error)

是否存在该用户

func (GmUserModel) GetPassword

func (this GmUserModel) GetPassword() string

密码进行md5混淆

func (GmUserModel) GetUserById

func (this GmUserModel) GetUserById() (gmUser GmUserModel, err error)

通过id查询用户信息

func (GmUserModel) GetUserByUP

func (this GmUserModel) GetUserByUP() (gmUser GmUserModel, err error)

登录

func (GmUserModel) Insert

func (this GmUserModel) Insert() (id int64, err error)

新增用户

func (GmUserModel) Select

func (this GmUserModel) Select() (gmUser []GmUserModel, err error)

Select

func (GmUserModel) Update

func (this GmUserModel) Update() (err error)

Update

Jump to

Keyboard shortcuts

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