sys_user_role.go 1.1 KB
package domain

import (
	"context"
	"gitlab.fjmaimaimai.com/allied-creation/su-micro/pkg/transaction"
)

type SysUserRole struct {
	Id         int64 // 唯一标识
	CompanyId  int64 `json:",omitempty"` // 公司ID
	UserId     int64 `json:",omitempty"` // 用户ID
	EmployeeId int64 `json:",omitempty"` // 职工ID
	RoleId     int64 `json:",omitempty"` // 角色ID
	CreatedAt  int64 `json:",omitempty"`
}

type SysUserRoleRepository interface {
	Insert(ctx context.Context, conn transaction.Conn, dm *SysUserRole) (*SysUserRole, error)
	Update(ctx context.Context, conn transaction.Conn, dm *SysUserRole) (*SysUserRole, error)
	//UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *SysUserRole) (*SysUserRole, error)
	Delete(ctx context.Context, conn transaction.Conn, dm *SysUserRole) (*SysUserRole, error)
	FindOne(ctx context.Context, conn transaction.Conn, id int64) (*SysUserRole, error)
	Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*SysUserRole, error)
}

func (m *SysUserRole) Identify() interface{} {
	if m.Id == 0 {
		return nil
	}
	return m.Id
}