Documentation ¶
Index ¶
- Constants
- func ForBeforeCreate(scope *gorm.Scope)
- func ForBeforeUpdate(scope *gorm.Scope)
- type Admin
- type AdminOnline
- type AdminShow
- type Auth
- type CommonResp
- type LoginInfo
- type MailConf
- type MailTest
- type NodeResp
- type NodesResp
- type OperForm
- type OperLog
- type OperationType
- type Role
- type RoleAuth
- type RoleEditShow
- type RoleShow
- type SiteConf
- type SysConf
- type SysType
Constants ¶
View Source
const ( SUCCESS = 0 // 成功 ERROR = 500 //错误 UNAUTHORIZED = 403 //无权限 FAIL = -1 //失败 )
响应结果
Variables ¶
This section is empty.
Functions ¶
func ForBeforeCreate ¶
func ForBeforeUpdate ¶
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 (*Admin) BeforeUpdate ¶
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 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 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 (*Role) BeforeUpdate ¶
type RoleEditShow ¶
管理员信息修改页面展示
Source Files ¶
Click to show internal directories.
Click to hide internal directories.