审查视图

pkg/domain/role.go 858 字节
1 2 3 4 5 6 7 8 9 10 11 12
package domain

import "time"

const (
	RoleTypeCommon int = 0 // 角色类型-后台添加角色
	RoleTypeSystem int = 1 // 角色类型-系统预制角色(不可删除、编辑)
)

type Role struct {
	Id          int64      `json:"id,string"`
	Name        string     `json:"name"`
郑周 authored
13
	Type        int        `json:"type" pg:",use_zero"`
14 15 16 17 18 19 20 21 22 23 24 25 26 27
	Description string     `json:"description"`
	CompanyId   int64      `json:"companyId,string"`
	CreatedAt   time.Time  `json:"createdAt"`
	UpdatedAt   time.Time  `json:"updatedAt"`
	DeletedAt   *time.Time `json:"deletedAt"`
}

type RoleRepository interface {
	Insert(role *Role) (*Role, error)
	Remove(role *Role) (*Role, error)
	FindOne(queryOptions map[string]interface{}) (*Role, error)
	Find(queryOptions map[string]interface{}) (int64, []*Role, error)
	Count(queryOptions map[string]interface{}) (int64, error)
}