ulflow_phattt2901 f4ef71b63b
Some checks failed
CI Pipeline / Security Scan (push) Failing after 5m24s
CI Pipeline / Lint (push) Failing after 5m30s
CI Pipeline / Test (push) Has been skipped
CI Pipeline / Build (push) Has been skipped
CI Pipeline / Notification (push) Successful in 1s
feat: implement user authentication system with JWT and role-based access control
2025-05-24 11:24:19 +07:00

26 lines
635 B
Go

package role
import "time"
// Role đại diện cho một vai trò trong hệ thống
type Role struct {
ID int `json:"id" gorm:"primaryKey"`
Name string `json:"name" gorm:"size:50;uniqueIndex;not null"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
// TableName specifies the table name for the Role model
func (Role) TableName() string {
return "roles"
}
// Constants for role names
const (
Admin = "admin"
Manager = "manager"
User = "user"
Guest = "guest"
)