role_user.go 1016 字节
package domain

import (
	"time"
)

type RoleUser struct {
	Id        int64      `json:"id,string"`
	RoleId    int64      `json:"roleId,string"`
	UserId    int64      `json:"userId,string"`
	CompanyId int64      `json:"companyId,string"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt"`
}

type RoleContainUser struct {
	RoleId    int64  `json:"roleId,string"`
	UserId    int64  `json:"userId,string"`
	UserName  string `json:"userName"`
	UserEmail string `json:"userEmail"`
}

type RoleUserRepository interface {
	Insert(role *RoleUser) (*RoleUser, error)
	Remove(role *RoleUser) (*RoleUser, error)
	FindOne(queryOptions map[string]interface{}) (*RoleUser, error)
	Find(queryOptions map[string]interface{}) (int64, []*RoleUser, error)
	Count(queryOptions map[string]interface{}) (int64, error)
	BatchDeleteById(ids []int64) error
	FindAllContainUser(pageSize int, pageNumber int, companyId int64, roleId int64) ([]*RoleContainUser, error)
}