model

package
v0.0.0-...-d827859 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS      = 0   // 成功
	ERROR        = 500 //错误
	UNAUTHORIZED = 403 //无权限
	FAIL         = -1  //失败
)

响应结果

Variables

This section is empty.

Functions

func ForBeforeCreate

func ForBeforeCreate(scope *gorm.Scope)

func ForBeforeUpdate

func ForBeforeUpdate(scope *gorm.Scope)

Types

type Admin

type Admin struct {
	ID        uint      `json:"id"`
	LoginName string    `json:"login_name" gorm:"unique_index"`
	RealName  string    `json:"real_name"`
	Password  string    `json:"-"`
	Level     int       `json:"level"`
	RoleIds   string    `json:"role_ids"`
	Phone     string    `json:"phone"`
	Email     string    `json:"email"`
	Avatar    string    `json:"avatar"`
	Salt      string    `json:"-"`
	LastIp    string    `json:"-"`
	LastLogin time.Time `json:"last_login"`
	Status    int       `json:"status"`
	CreateId  int       `json:"create_id"`
	UpdateId  int       `json:"update_id"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
	DeletedAt time.Time `json:"-" gorm:"default:null"`
}

func (*Admin) BeforeCreate

func (a *Admin) BeforeCreate(scope *gorm.Scope)

func (*Admin) BeforeUpdate

func (a *Admin) BeforeUpdate(scope *gorm.Scope)

type AdminOnline

type AdminOnline struct {
	SessionID      string    `json:"session_id" gorm:"not null default '' comment('用户会话id') VARCHAR(250)"`
	LoginName      string    `json:"login_name" gorm:"default '' comment('登录账号') VARCHAR(50)"`
	DeptName       string    `json:"dept_name" gorm:"default '' comment('部门名称') VARCHAR(50)"`
	IpAddr         string    `json:"ip_addr" gorm:"default '' comment('登录IP地址') VARCHAR(50)"`
	LoginLocation  string    `json:"login_location" gorm:"default '' comment('登录地点') VARCHAR(255)"`
	Browser        string    `json:"browser" gorm:"default '' comment('浏览器类型') VARCHAR(50)"`
	Os             string    `json:"os" gorm:"default '' comment('操作系统') VARCHAR(50)"`
	Status         string    `json:"status" gorm:"default '' comment('在线状态on_line在线off_line离线') VARCHAR(10)"`
	StartTimestamp time.Time `json:"start_timestamp" gorm:"comment('session创建时间') DATETIME"`
	LastAccessTime time.Time `json:"last_access_time" gorm:"comment('session最后访问时间') DATETIME"`
	ExpireTime     int       `json:"expire_time" gorm:"default 0 comment('超时时间,单位为分钟') INT(5)"`
}

type AdminShow

type AdminShow struct {
	ID        uint   `json:"id"`
	LoginName string `json:"login_name"`
	RealName  string `json:"real_name"`
	RoleIds   string `json:"role_ids"`
	Level     int    `json:"level"`
	Phone     string `json:"phone"`
	Email     string `json:"email"`
	Avatar    string `json:"avatar"`
	Status    int    `json:"status"`
	LastLogin string `json:"last_login"`
	LastIp    string `json:"last_ip"`
}

type Auth

type Auth struct {
	ID        uint
	AuthName  string
	AuthUrl   string
	UserId    int
	Pid       int
	Sort      int
	Icon      string
	IsShow    int
	Status    int
	CreateId  int
	UpdateId  int
	RoleAuths []RoleAuth `gorm:"foreignkey:AuthID"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type CommonResp

type CommonResp struct {
	Code  int           `json:"code"` //响应编码 0 成功 500 错误 403 无权限  -1  失败
	Msg   string        `json:"msg"`  //消息
	Data  interface{}   `json:"data"` //数据内容
	Type  OperationType `json:"type"` //业务类型
	Count int           `json:"count,omitempty"`
}

type LoginInfo

type LoginInfo struct {
	InfoId        int64     `json:"info_id" gorm:"primary_key"`
	LoginName     string    `json:"login_name" gorm:"default '' comment('登录账号') VARCHAR(50)"`
	IpAddr        string    `json:"ip_addr" gorm:"default '' comment('登录IP地址') VARCHAR(50)"`
	LoginLocation string    `json:"login_location" gorm:"default '' comment('登录地点') VARCHAR(255)"`
	Browser       string    `json:"browser" gorm:"default '' comment('浏览器类型') VARCHAR(50)"`
	Os            string    `json:"os" gorm:"default '' comment('操作系统') VARCHAR(50)"`
	Status        string    `json:"status" gorm:"default '0' comment('登录状态(0成功 1失败)') CHAR(1)"`
	Msg           string    `json:"msg" gorm:"default '' comment('提示消息') VARCHAR(255)"`
	LoginTime     time.Time `json:"login_time" gorm:"comment('访问时间') DATETIME"`
}

type MailConf

type MailConf struct {
	EmailName   string `json:"email_name"`
	EmailHost   string `json:"email_host"`
	EmailPort   string `json:"email_port"`
	EmailUser   string `json:"email_user"`
	EmailPwd    string `json:"email_pwd"`
	EmailStatus int    `json:"email_status"`
}

type MailTest

type MailTest struct {
	EmailTest      string `json:"email_test"`
	EmailTestTitle string `json:"email_test_title"`
	EmailTemplate  string `json:"email_template"`
}

type NodeResp

type NodeResp struct {
	ID       int    `json:"id"`
	Pid      int    `json:"pid"`
	AuthName string `json:"auth_name"`
	AuthUrl  string `json:"auth_url"`
	Sort     int    `json:"sort"`
	IsShow   int    `json:"is_show"`
	Icon     string `json:"icon"`
}

type NodesResp

type NodesResp struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Open bool   `json:"open"`
	Pid  int    `json:"pId"`
}

type OperForm

type OperForm struct {
	Title      string
	InContent  string
	OutContent *CommonResp
}

type OperLog

type OperLog struct {
	ID            uint64
	Title         string    `json:"title" gorm:"default '' comment('模块标题') VARCHAR(50)"`
	BusinessType  int       `json:"business_type" gorm:"default 0 comment('业务类型(0其它 1新增 2修改 3删除)') INT(2)"`
	Method        string    `json:"method" gorm:"default '' comment('方法名称') VARCHAR(100)"`
	RequestMethod string    `json:"request_method" gorm:"default '' comment('请求方式') VARCHAR(10)"`
	OperatorType  int       `json:"operator_type" gorm:"default 0 comment('操作类别(0其它 1后台用户 2手机端用户)') INT(1)"`
	OperName      string    `json:"oper_name" gorm:"default '' comment('操作人员') VARCHAR(50)"`
	DeptName      string    `json:"dept_name" gorm:"default '' comment('部门名称') VARCHAR(50)"`
	OperUrl       string    `json:"oper_url" gorm:"default '' comment('请求URL') VARCHAR(255)"`
	OperIp        string    `json:"oper_ip" gorm:"default '' comment('主机地址') VARCHAR(50)"`
	OperLocation  string    `json:"oper_location" gorm:"default '' comment('操作地点') VARCHAR(255)"`
	OperParam     string    `json:"oper_param" gorm:"default '' comment('请求参数') VARCHAR(2000)"`
	JsonResult    string    `json:"json_result" gorm:"default '' comment('返回参数') VARCHAR(2000)"`
	Status        int       `json:"status" gorm:"default 0 comment('操作状态(0正常 1异常)') INT(1)"`
	ErrorMsg      string    `json:"error_msg" gorm:"default '' comment('错误消息') VARCHAR(2000)"`
	OperTime      time.Time `json:"oper_time" gorm:"comment('操作时间') DATETIME"`
}

type OperationType

type OperationType int
const (
	OperOther OperationType = 0 //0其它
	OperAdd   OperationType = 1 //1新增
	OperEdit  OperationType = 2 //2修改
	OperDel   OperationType = 3 //3删除
)

业务类型

type Role

type Role struct {
	ID        uint       `json:"id"`
	RoleName  string     `json:"role_name"`
	Detail    string     `json:"detail"`
	Status    int        `json:"status"`
	CreateId  int        `json:"create_id"`
	UpdateId  int        `json:"update_id"`
	RoleAuths []RoleAuth `json:"-" gorm:"foreignkey:RoleID"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
}

func (*Role) BeforeCreate

func (r *Role) BeforeCreate(scope *gorm.Scope)

func (*Role) BeforeUpdate

func (r *Role) BeforeUpdate(scope *gorm.Scope)

type RoleAuth

type RoleAuth struct {
	AuthID uint
	RoleID uint64
}

type RoleEditShow

type RoleEditShow struct {
	ID       int
	RoleName string
	Status   int
	Checked  int
}

管理员信息修改页面展示

type RoleShow

type RoleShow struct {
	ID        int    `json:"id"`
	RoleName  string `json:"role_name"`
	Detail    string `json:"detail"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type SiteConf

type SiteConf struct {
	WebName     string `json:"web_name"`
	WebUrl      string `json:"web_url"`
	LogoUrl     string `json:"logo_url"`
	KeyWords    string `json:"key_words"`
	Description string `json:"description"`
	Copyright   string `json:"copyright"`
	Icp         string `json:"icp"`
	SiteStatus  uint8  `json:"site_status"`
}

type SysConf

type SysConf struct {
	ID        uint      `json:"id"`
	Type      SysType   `json:"type" gorm:"unique"`
	Info      string    `json:"info" gorm:"type:varchar(4000);"`
	Status    uint8     `json:"status"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type SysType

type SysType uint
const (
	SysSiteConf SysType = 1
	SysMailConf SysType = 2
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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