package models

import (
	"errors"

	"github.com/jinzhu/gorm"
)

// Role 角色表
type Role struct {
	gorm.Model
	RecordId string `gorm:"column:record_id;size:32;index"`
	RoleName string `gorm:"size:50;not null"`
	RoleCode int32
	MenuList string `gorm:"size:100000;"`
}

// Validate ``
func (a *Role) Validate() error {
	if a.RoleName == "" {
		return errors.New("角色名为空")
	}
	return nil
}
