24 lines
1.0 KiB
Go
24 lines
1.0 KiB
Go
package model
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// Role 角色模型
|
|
type Role struct {
|
|
gorm.Model
|
|
BaseModel `gorm:"embedded"`
|
|
|
|
RoleName string `gorm:"column:role_name;not null;size:50;comment:角色名称" json:"role_name"`
|
|
RoleDesc string `gorm:"column:role_desc;size:255;comment:角色描述" json:"role_desc"`
|
|
RoleType int `gorm:"column:role_type;not null;index;comment:角色类型 1=平台角色 2=客户角色" json:"role_type"`
|
|
Status int `gorm:"column:status;not null;default:1;comment:状态 0=禁用 1=启用" json:"status"`
|
|
DefaultCreditEnabled bool `gorm:"column:default_credit_enabled;type:boolean;not null;default:false;comment:是否启用新建代理默认信用" json:"default_credit_enabled"`
|
|
DefaultCreditLimit int64 `gorm:"column:default_credit_limit;type:bigint;not null;default:0;comment:新建代理默认信用额度(单位:分)" json:"default_credit_limit"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (Role) TableName() string {
|
|
return "tb_role"
|
|
}
|