Documentation ¶
Index ¶
- func AccessCreate(ctx context.Context, db *gorm.DB, data *Access) (err error)
- func AccessDeleteX(ctx context.Context, db *gorm.DB, conds egorm.Conds) (err error)
- func AuthorizeCreate(ctx context.Context, db *gorm.DB, data *Authorize) (err error)
- func AuthorizeDeleteX(ctx context.Context, db *gorm.DB, conds egorm.Conds) (err error)
- func ExpiresCreate(ctx context.Context, db *gorm.DB, data *Expires) (err error)
- func ExpiresDeleteX(ctx context.Context, db *gorm.DB, conds egorm.Conds) (err error)
- func RefreshCreate(ctx context.Context, db *gorm.DB, data *Refresh) (err error)
- func RefreshDeleteX(ctx context.Context, db *gorm.DB, conds egorm.Conds) (err error)
- type Access
- type App
- type Authorize
- type Expires
- type Refresh
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessCreate ¶
AccessCreate insert a new Access into database and returns last inserted Id on success.
func AccessDeleteX ¶
AccessDeleteX Delete的扩展方法,根据Cond删除一条或多条记录。如果有delete_time则软删除,否则硬删除。
func AuthorizeCreate ¶
AuthorizeCreate insert a new Authorize into database and returns last inserted Id on success.
func AuthorizeDeleteX ¶
func ExpiresCreate ¶
ExpiresCreate insert a new Expires into database and returns last inserted Id on success.
func ExpiresDeleteX ¶
ExpiresDeleteX Delete的扩展方法,根据Cond删除一条或多条记录。如果有delete_time则软删除,否则硬删除。
func RefreshCreate ¶
Types ¶
type Access ¶
type Access struct { Id int `gorm:"not null;primary_key;AUTO_INCREMENT" json:"id" form:"id"` // FormID Client string `gorm:"not null" json:"client" form:"client"` // client Authorize string `gorm:"not null" json:"authorize" form:"authorize"` // authorize Previous string `gorm:"not null" json:"previous" form:"previous"` // previous AccessToken string `gorm:"not null" json:"accessToken" form:"accessToken"` // access_token RefreshToken string `gorm:"not null" json:"refreshToken" form:"refreshToken"` // refresh_token ExpiresIn int `gorm:"not null" json:"expiresIn" form:"expiresIn"` // expires_in Scope string `gorm:"not null" json:"scope" form:"scope"` // scope RedirectUri string `gorm:"not null" json:"redirectUri" form:"redirectUri"` // redirect_uri Extra string `gorm:"not null;type:longtext" json:"extra" form:"extra"` // extra Ctime int64 `gorm:"not null" json:"ctime" form:"ctime"` // 创建时间 }
func AccessInfoX ¶
AccessInfoX Info的扩展方法,根据Cond查询单条记录
type App ¶
type App struct { Aid int `gorm:"not null;primary_key;AUTO_INCREMENT" json:"aid" form:"aid"` // 应用id ClientId string `gorm:"not null" json:"clientId" form:"clientId"` // 客户端 Name string `gorm:"not null" json:"name" form:"name"` // 名称 Secret string `gorm:"not null" json:"secret" form:"secret"` // 秘钥 RedirectUri string `gorm:"not null" json:"redirectUri" form:"redirectUri"` // 跳转地址 Url string `gorm:"not null" json:"url" form:"url"` // 访问地址 Extra string `gorm:"not null;type:longtext" json:"extra" form:"extra"` // 额外信息 CntCall int `gorm:"not null" json:"cntCall" form:"cntCall"` // 调用次数 State int `gorm:"not null" json:"state" form:"state"` // 状态 Ctime int64 `gorm:"not null" json:"ctime" form:"ctime"` // 创建时间 Utime int64 `gorm:"not null" json:"utime" form:"utime"` // 更新时间 Dtime int64 `gorm:"not null" json:"dtime" form:"dtime"` // 删除时间 }
type Authorize ¶
type Authorize struct { Id int `gorm:"not null;primary_key;AUTO_INCREMENT" json:"id" form:"id"` // FormID Client string `gorm:"not null" json:"client" form:"client"` // 客户端 Code string `gorm:"not null" json:"code" form:"code"` // 状态码 ExpiresIn int32 `gorm:"not null" json:"expiresIn" form:"expiresIn"` // 过期时间 Scope string `gorm:"not null" json:"scope" form:"scope"` // 范围 RedirectUri string `gorm:"not null" json:"redirectUri" form:"redirectUri"` // 跳转地址 State string `gorm:"not null" json:"state" form:"state"` // 状态 Extra string `gorm:"not null;type:longtext" json:"extra" form:"extra"` // 额外信息 Ctime int64 `gorm:"not null" json:"ctime" form:"ctime"` // 创建时间 }
type Expires ¶
type Expires struct { Id int `gorm:"not null;primary_key;AUTO_INCREMENT" json:"id" form:"id"` // 客户端 Token string `gorm:"not null" json:"token" form:"token"` // token ExpiresAt int64 `gorm:"not null" json:"expiresAt" form:"expiresAt"` // 过期时间 Ptoken string `gorm:"not null" json:"ptoken" form:"ptoken"` // parent token信息 }
type Refresh ¶
type Refresh struct { Id int `gorm:"not null;primary_key;AUTO_INCREMENT" json:"id" form:"id"` // FormID Token string `gorm:"not null" json:"token" form:"token"` // token Access string `gorm:"not null" json:"access" form:"access"` // access }
func RefreshInfoX ¶
RefreshInfoX Info的扩展方法,根据Cond查询单条记录
Click to show internal directories.
Click to hide internal directories.