Documentation ¶
Index ¶
- func Casbin() iris.Handler
- func Check(r *http.Request, userId string) (bool, error)
- func CreateOplog(ol Oplog) error
- func CrsAuth() context.Handler
- func InitCheck() iris.Handler
- func IsMobileReg() iris.Handler
- func IsReg(mobile string) (string, error)
- func JwtHandler() iris.Handler
- func MobileScope(mobile string) func(db *gorm.DB) *gorm.DB
- func OperationRecord() iris.Handler
- type BaseUser
- type Oplog
- type Request
- type Response
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseUser ¶
type BaseUser struct { Uuid string `gorm:"type:varchar(36);" json:"uuid"` Sex string `gorm:"default:'0';not null; type:tinyint(1)" json:"sex"` Age string `gorm:"default:'0';not null; type:tinyint(2)" json:"age"` Region string `gorm:"not null; type:varchar(15)" json:"region"` Mobile string `gorm:"not null; type:varchar(20)" json:"mobile" validate:"required"` Nickname string `gorm:"not null; type:varchar(60)" json:"nickname"` Name string `gorm:"index;not null; type:varchar(60)" json:"name"` Username string `gorm:"uniqueIndex;not null;type:varchar(60)" json:"username"` Identity string `gorm:"not null; type:varchar(30)" json:"identity"` Intro string `gorm:"not null; type:varchar(512)" json:"intro"` Avatar string `gorm:"type:varchar(1024)" json:"avatar"` }
type Oplog ¶
type Oplog struct { gorm.Model Ip string `json:"ip" form:"ip" gorm:"column:ip;comment:请求ip"` Method string `json:"method" form:"method" gorm:"column:method;comment:请求方法" validate:"required"` Path string `json:"path" form:"path" gorm:"column:path;comment:请求路径" validate:"required"` Status int `json:"status" form:"status" gorm:"column:status;comment:请求状态" validate:"required"` Latency time.Duration `json:"latency" form:"latency" gorm:"column:latency;comment:延迟"` 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:longtext;column:body;comment:请求Body"` Resp string `json:"resp" form:"resp" gorm:"type:longtext;column:resp;comment:响应Body"` UserID uint `json:"user_id" form:"user_id" gorm:"column:user_id;comment:用户id"` }
Oplog 中间件 model
type Response ¶
func FindByUserName ¶
FindByName
Click to show internal directories.
Click to hide internal directories.