system

package
v0.0.0-...-997d260 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	global.Model
	OrganizationId uint   `json:"organizationId" gorm:"comment:组织id"`
	Code           string `json:"code" gorm:"comment:应用名称"`
	Name           string `json:"name" gorm:"comment:显示名称"`
	ClientId       string `json:"clientId" gorm:"comment:ClientId"`
	ClientSecret   string `json:"clientSecret" gorm:"comment:ClientSecret"`
	RedirectUris   string `json:"redirectUris" gorm:"comment:重定向url列表"`
}

func (*Application) BeforeCreate

func (app *Application) BeforeCreate(tx *gorm.DB) error

func (*Application) CompareHashAndSecret

func (app *Application) CompareHashAndSecret(secret string) bool

CompareHashAndPassword 密码检查 false 校验失败, true 校验成功

func (*Application) TableName

func (app *Application) TableName() string

type ApplicationOauthProvider

type ApplicationOauthProvider struct {
	global.Model
	ApplicationId  uint   `json:"applicationId" gorm:"comment:应用id"`
	OrganizationId uint   `json:"organizationId" gorm:"comment:组织id"`
	Provider       string `json:"provider" gorm:"comment:第三方授权类型"`
	NotBoundPolicy string `` /* 138-byte string literal not displayed */
}

func (*ApplicationOauthProvider) TableName

func (u *ApplicationOauthProvider) TableName() string

type Casbin

type Casbin struct {
	PType      string `gorm:"column:p_type"`
	RoleId     string `gorm:"column:v0"`
	Permission string `gorm:"column:v1"`
}

func (*Casbin) BeforeCreate

func (c *Casbin) BeforeCreate(tx *gorm.DB) error

func (*Casbin) TableName

func (c *Casbin) TableName() string

type OauthBound

type OauthBound struct {
	global.Model
	ApplicationId  uint   `json:"applicationId" gorm:"comment:应用id"`
	OrganizationId uint   `json:"organizationId" gorm:"comment:组织id"`
	UserId         uint   `json:"userId" gorm:"comment:用户id"`
	Provider       string `json:"provider" gorm:"comment:第三方类型"`
	OpenId         string `json:"openId" gorm:"comment:第三方id"`
}

func (*OauthBound) TableName

func (u *OauthBound) TableName() string

type OperationLog

type OperationLog struct {
	global.Model
	Status       int           `json:"status" gorm:"column:status;comment:请求状态"`
	Ip           string        `json:"ip" gorm:"column:ip;comment:请求ip"`
	Path         string        `json:"path" gorm:"column:path;comment:请求路径"`
	Method       string        `json:"method" gorm:"column:method;comment:请求方法"`
	Agent        string        `json:"agent" gorm:"column:agent;comment:代理"`
	Latency      time.Duration `json:"latency" gorm:"column:latency;comment:延迟" swaggertype:"string"`
	Request      string        `json:"body" gorm:"type:text;column:request;comment:请求body"`
	Response     string        `json:"resp" gorm:"type:text;column:response;comment:响应Body"`
	ErrorMessage string        `json:"errorMessage" gorm:"column:error_message;comment:错误信息"`
	UserId       uint          `json:"userId" gorm:"column:user_id;comment:用户id"`
}

func (*OperationLog) TableName

func (o *OperationLog) TableName() string

type Organization

type Organization struct {
	global.Model
	Code                 string `json:"code" gorm:"comment:组织名称"`
	Name                 string `json:"name" gorm:"comment:显示名称"`
	PhoneCodeSupports    string `json:"phoneCodeSupports" gorm:"comment:手机区号支持,为空则支持所有"`
	RegisterTypeSupports bool   `json:"RegisterTypeSupports" gorm:"comment:注册类型支持"`
}

func (*Organization) BeforeCreate

func (org *Organization) BeforeCreate(tx *gorm.DB) error

func (*Organization) TableName

func (org *Organization) TableName() string

type Permission

type Permission struct {
	global.Model
	ApplicationId  uint   `json:"applicationId" gorm:"comment:应用id"`
	OrganizationId uint   `json:"organizationId" gorm:"comment:组织id"`
	ParentId       uint   `json:"parentId" gorm:"comment:父权限id"`
	Title          string `json:"title" gorm:"not null;comment:资源标题;size:200"`
	Code           string `json:"Code" gorm:"not null;comment:权限代码;size:200"`
}

func (*Permission) BeforeCreate

func (a *Permission) BeforeCreate(tx *gorm.DB) error

func (*Permission) TableName

func (a *Permission) TableName() string

type Provider

type Provider struct {
	global.Model
	Name     string `json:"name" gorm:"comment:名称"`
	Type     string `json:"type" gorm:"comment:类型"`
	Provider string `json:"provider" gorm:"comment:提供商"`
	Content  string `json:"content"  gorm:"comment:json配置"`
}

func (*Provider) TableName

func (u *Provider) TableName() string

type Role

type Role struct {
	global.Model
	ApplicationId  uint         `json:"applicationId" gorm:"comment:应用id"`
	OrganizationId uint         `json:"organizationId" gorm:"comment:组织id"`
	Code           string       `json:"code" gorm:"comment:角色名"`  // 角色名
	Name           string       `json:"name" gorm:"comment:显示名称"` // 角色名
	Permissions    []Permission `json:"permissions" gorm:"many2many:a_role_permission;"`
}

func (*Role) BeforeCreate

func (a *Role) BeforeCreate(tx *gorm.DB) error

func (*Role) TableName

func (a *Role) TableName() string

type User

type User struct {
	global.Model
	ApplicationId  uint   `json:"applicationId" gorm:"comment:应用id"`
	OrganizationId uint   `json:"organizationId" gorm:"comment:组织id"`
	Avatar         string `json:"avatar" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"`
	Username       string `json:"userName" gorm:"comment:用户登录名"`
	Password       string `json:"-"  gorm:"comment:用户登录密码"`
	NickName       string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`
	PhoneCode      string `json:"phoneCode"  gorm:"comment:手机区号"`
	Phone          string `json:"phone"  gorm:"comment:手机号"`
	Email          string `json:"email"  gorm:"comment:邮箱"`
	Roles          []Role `json:"roles" gorm:"many2many:a_user_role;"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) error

func (*User) CompareHashAndPassword

func (u *User) CompareHashAndPassword(password string) bool

CompareHashAndPassword 密码检查 false 校验失败, true 校验成功

func (*User) EncryptedPassword

func (u *User) EncryptedPassword() error

EncryptedPassword 加密密码

func (*User) TableName

func (u *User) TableName() string

Jump to

Keyboard shortcuts

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