models

package
v2.8.1-0...-89a7925 Latest Latest
Warning

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

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

Documentation

Overview

********************************************* ** @Des: This file ... ** @Author: haodaquan ** @Date: 2017-09-16 15:42:43 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 11:48:17 **********************************************

********************************************* ** @Des: 权限因子 ** @Author: haodaquan ** @Date: 2017-09-09 20:50:36 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 21:42:08 **********************************************

*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-10 19:51 ** @Last Modified by: haodaquan ** @Last Modified time: 2018-06-10 19:51 ************************************************************

*********************************************************** ** @Description: models ** @Author: Bee ** @Date: 2019-02-15 20:21 ** @Last Modified by: Bee ** @Last Modified time: 2019-02-15 20:21 ************************************************************

********************************************* ** @Des: This file ... ** @Author: haodaquan ** @Date: 2017-09-14 15:24:51 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 11:48:52 **********************************************

********************************************* ** @Des: This file ... ** @Author: haodaquan ** @Date: 2017-09-15 11:44:13 ** @Last Modified by: haodaquan ** @Last Modified time: 2017-09-17 11:49:13 **********************************************

*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-09 16:11 ** @Last Modified by: haodaquan ** @Last Modified time: 2018-06-09 16:11 ************************************************************

*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-08 21:49 ** @Last Modified by: haodaquan ** @Last Modified time: 2018-06-08 21:49 ************************************************************

*********************************************************** ** @Description: models ** @Author: haodaquan ** @Date: 2018-06-11 21:26 ** @Last Modified by: Bee ** @Last Modified time: 2019-02-15 21:32 ************************************************************

Index

Constants

View Source
const (
	NotifyTplTypeSystem  = "system"
	NotifyTplTypeDefault = "default"
)
View Source
const (
	TASK_SUCCESS = 0  // 任务执行成功
	TASK_ERROR   = -1 // 任务执行出错
	TASK_TIMEOUT = -2 // 任务执行超时
)

Variables

View Source
var RunNumCache, _ = cache.NewCache("memory", `{"interval":60}`)
View Source
var StartTime int64

Functions

func AdminAdd

func AdminAdd(a *Admin) (int64, error)

func AuthAdd

func AuthAdd(auth *Auth) (int64, error)

func BanAdd

func BanAdd(obj *Ban) (int64, error)

func BanDelById

func BanDelById(id int) error

func GetLogNum

func GetLogNum(status int) (int64, error)

func GroupAdd

func GroupAdd(obj *Group) (int64, error)

func GroupDelById

func GroupDelById(id int) error

func Init

func Init(startTime int64)

func NotifyTplAdd

func NotifyTplAdd(obj *NotifyTpl) (int64, error)

func NotifyTplDelById

func NotifyTplDelById(id int) error

func RoleAdd

func RoleAdd(role *Role) (int64, error)

func RoleAuthAdd

func RoleAuthAdd(ra *RoleAuth) (int64, error)

func RoleAuthBatchAdd

func RoleAuthBatchAdd(ras *[]RoleAuth) (int64, error)

func RoleAuthDelete

func RoleAuthDelete(id int) (int64, error)

func RoleAuthGetByIds

func RoleAuthGetByIds(RoleIds string) (Authids string, err error)

获取多个

func RoleAuthMultiAdd

func RoleAuthMultiAdd(ras []*RoleAuth) (n int, err error)

func ServerGroupAdd

func ServerGroupAdd(obj *ServerGroup) (int64, error)

func ServerGroupDelById

func ServerGroupDelById(id int) error

func SumByDays

func SumByDays(limit int, status string) orm.Params

func TableName

func TableName(name string) string

func TaskAdd

func TaskAdd(task *Task) (int64, error)

func TaskDel

func TaskDel(id int) (int64, error)

修改为逻辑删除

func TaskLogAdd

func TaskLogAdd(t *TaskLog) (int64, error)

func TaskLogDelById

func TaskLogDelById(id int) error

func TaskLogDelByTaskId

func TaskLogDelByTaskId(taskId int) (int64, error)

func TaskResetGroupId

func TaskResetGroupId(groupId int) (int64, error)

func TaskServerAdd

func TaskServerAdd(obj *TaskServer) (int64, error)

func TaskServerDelById

func TaskServerDelById(id int) error

func TaskServerForActuator

func TaskServerForActuator(serverIp string, port int) int

func TaskTotalRunNum

func TaskTotalRunNum() (int64, error)

运行总次数

Types

type Admin

type Admin struct {
	Id         int
	LoginName  string
	RealName   string
	Password   string
	RoleIds    string
	Phone      string
	Email      string
	Dingtalk   string
	Wechat     string
	Salt       string
	LastLogin  int64
	LastIp     string
	Status     int
	CreateId   int
	UpdateId   int
	CreateTime int64
	UpdateTime int64
}

func AdminGetById

func AdminGetById(id int) (*Admin, error)

func AdminGetByName

func AdminGetByName(loginName string) (*Admin, error)

func AdminGetList

func AdminGetList(page, pageSize int, filters ...interface{}) ([]*Admin, int64)

func (*Admin) TableName

func (a *Admin) TableName() string

func (*Admin) Update

func (a *Admin) Update(fields ...string) error

type Auth

type Auth struct {
	Id         int
	AuthName   string
	AuthUrl    string
	UserId     int
	Pid        int
	Sort       int
	Icon       string
	IsShow     int
	Status     int
	CreateId   int
	UpdateId   int
	CreateTime int64
	UpdateTime int64
}

func AuthGetById

func AuthGetById(id int) (*Auth, error)

func AuthGetList

func AuthGetList(page, pageSize int, filters ...interface{}) ([]*Auth, int64)

func AuthGetListByIds

func AuthGetListByIds(authIds string, userId int) ([]*Auth, error)

func (*Auth) TableName

func (a *Auth) TableName() string

func (*Auth) Update

func (a *Auth) Update(fields ...string) error

type Ban

type Ban struct {
	Id         int
	Code       string
	CreateTime int64
	UpdateTime int64
	Status     int
}

func BanGetById

func BanGetById(id int) (*Ban, error)

func BanGetList

func BanGetList(page, pageSize int, filters ...interface{}) ([]*Ban, int64)

func (*Ban) TableName

func (t *Ban) TableName() string

func (*Ban) Update

func (t *Ban) Update(fields ...string) error

type Group

type Group struct {
	Id          int
	CreateId    int
	UpdateId    int
	GroupName   string
	Description string
	CreateTime  int64
	UpdateTime  int64
	Status      int
}

func GroupGetById

func GroupGetById(id int) (*Group, error)

func GroupGetList

func GroupGetList(page, pageSize int, filters ...interface{}) ([]*Group, int64)

func (*Group) TableName

func (t *Group) TableName() string

func (*Group) Update

func (t *Group) Update(fields ...string) error

type NotifyTpl

type NotifyTpl struct {
	Id         int
	Type       string
	TplName    string
	TplType    int
	Title      string
	Content    string
	Status     int
	CreateId   int
	UpdateId   int
	CreateTime int64
	UpdateTime int64
}

func NotifyTplGetById

func NotifyTplGetById(id int) (*NotifyTpl, error)

func NotifyTplGetByTplType

func NotifyTplGetByTplType(tpl_type int, typestr string) (NotifyTpl, error)

func NotifyTplGetByTplTypeList

func NotifyTplGetByTplTypeList(tpl_type int) ([]*NotifyTpl, int64, error)

func NotifyTplGetList

func NotifyTplGetList(page, pageSize int, filters ...interface{}) ([]*NotifyTpl, int64)

func (*NotifyTpl) TableName

func (t *NotifyTpl) TableName() string

func (*NotifyTpl) Update

func (t *NotifyTpl) Update(fields ...string) error

type Role

type Role struct {
	Id             int
	RoleName       string
	Detail         string
	ServerGroupIds string
	TaskGroupIds   string
	Status         int
	CreateId       int
	UpdateId       int
	CreateTime     int64
	UpdateTime     int64
}

func RoleGetById

func RoleGetById(id int) (*Role, error)

func RoleGetList

func RoleGetList(page, pageSize int, filters ...interface{}) ([]*Role, int64)

func (*Role) TableName

func (a *Role) TableName() string

func (*Role) Update

func (r *Role) Update(fields ...string) error

type RoleAuth

type RoleAuth struct {
	AuthId int `orm:"pk"`
	RoleId int64
}

func RoleAuthGetById

func RoleAuthGetById(id int) ([]*RoleAuth, error)

func (*RoleAuth) TableName

func (ra *RoleAuth) TableName() string

type ServerGroup

type ServerGroup struct {
	Id          int
	CreateId    int
	UpdateId    int
	GroupName   string
	Description string
	CreateTime  int64
	UpdateTime  int64
	Status      int
}

func ServerGroupGetList

func ServerGroupGetList(page, pageSize int, filters ...interface{}) ([]*ServerGroup, int64)

func TaskGroupGetById

func TaskGroupGetById(id int) (*ServerGroup, error)

func (*ServerGroup) TableName

func (t *ServerGroup) TableName() string

func (*ServerGroup) Update

func (t *ServerGroup) Update(fields ...string) error

type SumDays

type SumDays struct {
	Day string
	Sum int
}

type Task

type Task struct {
	Id            int
	GroupId       int
	ServerIds     string
	ServerType    int
	TaskName      string
	Description   string
	CronSpec      string
	Concurrent    int
	Command       string
	Timeout       int
	ExecuteTimes  int
	PrevTime      int64
	Status        int
	IsNotify      int
	NotifyType    int
	NotifyTplId   int
	NotifyUserIds string
	CreateId      int
	UpdateId      int
	CreateTime    int64
	UpdateTime    int64
}

func TaskGetById

func TaskGetById(id int) (*Task, error)

func TaskGetList

func TaskGetList(page, pageSize int, filters ...interface{}) ([]*Task, int64)

func (*Task) TableName

func (t *Task) TableName() string

func (*Task) Update

func (t *Task) Update(fields ...string) error

type TaskLog

type TaskLog struct {
	Id          int
	TaskId      int
	ServerId    int
	ServerName  string
	Output      string
	Error       string
	Status      int
	ProcessTime int
	CreateTime  int64
}

func TaskLogGetById

func TaskLogGetById(id int) (*TaskLog, error)

func TaskLogGetList

func TaskLogGetList(page, pageSize int, filters ...interface{}) ([]*TaskLog, int64)

func (*TaskLog) TableName

func (t *TaskLog) TableName() string

type TaskServer

type TaskServer struct {
	Id             int
	GroupId        int
	ConnectionType int
	ServerName     string
	ServerAccount  string
	ServerOuterIp  string
	ServerIp       string
	Port           int
	Password       string
	PrivateKeySrc  string
	PublicKeySrc   string
	Type           int
	Detail         string
	CreateTime     int64
	UpdateTime     int64
	Status         int
}

func TaskServerGetById

func TaskServerGetById(id int) (*TaskServer, error)

func TaskServerGetByIds

func TaskServerGetByIds(ids string) ([]*TaskServer, int64)

func TaskServerGetList

func TaskServerGetList(page, pageSize int, filters ...interface{}) ([]*TaskServer, int64)

func (*TaskServer) TableName

func (t *TaskServer) TableName() string

func (*TaskServer) Update

func (t *TaskServer) Update(fields ...string) error

Jump to

Keyboard shortcuts

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