Files
mayfly-go/server/internal/sys/domain/entity/role.go

53 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package entity
import (
"mayfly-go/pkg/model"
"time"
)
const (
RoleTypeCommon int = 1 // 公共角色类型
RoleTypeSpecial int = 2 // 特殊角色类型
)
type Role struct {
model.Model
Status int `json:"status"` // 1可用-1不可用
Name string `json:"name"`
Remark string `json:"remark"`
Code string `json:"code"`
Type int `json:"type"`
}
func (a *Role) TableName() string {
return "t_sys_role"
}
// 角色资源
type RoleResource struct {
Id uint64 `json:"id"`
RoleId uint64 `json:"roleId"`
ResourceId uint64 `json:"resourceId"`
CreateTime *time.Time `json:"createTime"`
CreatorId uint64 `json:"creatorId"`
Creator string `json:"creator"`
}
func (a *RoleResource) TableName() string {
return "t_sys_role_resource"
}
// 账号角色
type AccountRole struct {
Id uint64 `json:"id"`
AccountId uint64 `json:"accountId"`
RoleId uint64 `json:"roleId"`
CreateTime *time.Time `json:"createTime"`
CreatorId uint64 `json:"creatorId"`
Creator string `json:"creator"`
}
func (a *AccountRole) TableName() string {
return "t_sys_account_role"
}