Commit 816f6368 authored by resynz's avatar resynz

code: 基础表设计

parents
Pipeline #1356 failed with stages
/**
* @Author: Resynz
* @Date: 2021/9/24 14:35
*/
package model_lucifer
type Access struct {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
AppKey string `json:"app_key"`
AppSecret string `json:"app_secret"`
}
func (s *Access) GetTableName() string {
return "access"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 14:36
*/
package model_lucifer
type AccountApply struct {
Id int64 `json:"id"`
Email string `json:"email"`
Password string `json:"password"`
Salt string `json:"salt"`
AccountType AccountType `json:"account_type"`
Name string `json:"name"`
CompanyName string `json:"company_name"`
Website string `json:"website"`
Ip string `json:"ip"`
UserAgent string `json:"user_agent"`
Status ApplyStatus `json:"status"`
CreateTime int64 `json:"create_time"`
UpdateTime int64 `json:"update_time"`
}
func (s *AccountApply) GetTableName() string {
return "account_apply"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 16:15
*/
package model_lucifer
type Admin struct {
Id int64 `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Password string `json:"password"`
Salt string `json:"salt"`
RoleId int64 `json:"role_id"`
Status UserStatus `json:"status"`
Avatar string `json:"avatar"`
CreateTime int64 `json:"create_time"`
UpdateTime int64 `json:"update_time"`
}
func (s *Admin) GetTableName() string {
return "admin"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 16:17
*/
package model_lucifer
type AdminRole struct {
Id int64 `json:"id"`
AdminId int64 `json:"admin_id"`
RoleId int64 `json:"role_id"`
}
func (s *AdminRole) GetTableName() string {
return "admin_role"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 14:37
*/
package model_lucifer
type Authorization struct {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
AppId string `json:"app_id"`
AccessToken string `json:"access_token"`
ExpireTime int64 `json:"expire_time"`
RefreshToken string `json:"refresh_token"`
}
func (s *Authorization) GetTableName() string {
return "authorization"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 14:37
*/
package model_lucifer
type Authorizer struct {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
AppId string `json:"app_id"`
Status AuthorizerStatus `json:"status"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
OriginalId string `json:"original_id"`
ServiceType AuthorizerServiceType `json:"service_type"`
VerifyType int64 `json:"verify_type"`
PrincipalName string `json:"principal_name"`
Alias string `json:"alias"`
UpdateTime int64 `json:"update_time"`
}
func (s *Authorizer) GetTableName() string {
return "authorizer"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 14:36
*/
package model_lucifer
type UserStatus uint8
const (
UserStatusUnknown UserStatus = iota
UserStatusPending
UserStatusNormal
UserStatusForbidden
)
type AuthorizerStatus uint8
const (
AuthorizerStatusUnknown AuthorizerStatus = iota
AuthorizerStatusPending
AuthorizerStatusSuccess
AuthorizerStatusCancel
)
type AuthorizerServiceType uint8
const (
AuthorizerServiceTypeSubscribe AuthorizerServiceType = iota
AuthorizerServiceTypeUpgradeSubscribe
AuthorizerServiceTypeServe
)
type PreCodeStatus uint8
const (
PreCodeStatusUnknown PreCodeStatus = iota
PreCodeStatusPending
PreCodeStatusUsed
PreCodeStatusExpired
)
type AccountType uint8
const (
AccountTypeUnknown AccountType = iota
AccountTypeCompany
AccountTypePersonal
)
type ApplyStatus uint8
const (
ApplyStatusUnknown ApplyStatus = iota
ApplyStatusPending
ApplyStatusApproved
ApplyStatusRejected
)
type PermissionType uint8
const (
PermissionTypePage PermissionType = iota
PermissionTypeApi
)
/**
* @Author: Resynz
* @Date: 2021/9/24 16:18
*/
package model_lucifer
type Permission struct {
Id int64 `json:"id"`
Key string `json:"key"`
Label string `json:"label"`
Type PermissionType `json:"type"`
Route string `json:"route"`
Icon string `json:"icon"`
PKey string `json:"p_key"`
}
func (s *Permission) GetTableName() string {
return "permission"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 14:38
*/
package model_lucifer
type PreCodeRecord struct {
Id int64 `json:"id"`
Code string `json:"code"`
UserId int64 `json:"user_id"`
Status PreCodeStatus `json:"status"`
ExpireTime int64 `json:"expire_time"`
CreateTime int64 `json:"create_time"`
UpdateTime int64 `json:"update_time"`
}
func (s *PreCodeRecord) GetTableName() string {
return "pre_code_record"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 16:20
*/
package model_lucifer
type Role struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
AuthList string `json:"auth_list"`
HalfList string `json:"half_list"`
}
func (s *Role) GetTableName() string {
return "role"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 14:38
*/
package model_lucifer
type SyncPlan struct {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
AuthId int64 `json:"auth_id"`
CronNo string `json:"cron_no"`
Expression string `json:"expression"`
FetchLimit int64 `json:"fetch_limit"`
NotifyUrl string `json:"notify_url"`
UpdateTime int64 `json:"update_time"`
}
func (s *SyncPlan) GetTableName() string {
return "sync_plan"
}
/**
* @Author: Resynz
* @Date: 2021/9/24 14:38
*/
package model_lucifer
type User struct {
Id int64 `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
Status UserStatus `json:"status"`
CreateTime int64 `json:"create_time"`
UpdateTime int64 `json:"update_time"`
LastLoginTime int64 `json:"last_login_time"`
LastLoginIp string `json:"last_login_ip"`
}
func (s *User) GetTableName() string {
return "user"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment