mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
ce434b496e
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>
22 lines
490 B
Go
22 lines
490 B
Go
package dbmodel
|
|
|
|
type UserRole struct {
|
|
Base
|
|
UserID int64 `gorm:"user_id"`
|
|
RoleID int64 `gorm:"role_id"`
|
|
|
|
User User `gorm:"foreignKey:UserID"`
|
|
Role Role `gorm:"foreignKey:RoleID"`
|
|
}
|
|
|
|
func (u *UserRole) TableName() string {
|
|
return "user_role"
|
|
}
|
|
|
|
//go:generate mockery --name=IUserRoleDb
|
|
type IUserRoleDb interface {
|
|
GetUserRoles(tenantID string, userID int64, roleID int64) ([]*UserRole, error)
|
|
Insert(in *UserRole) error
|
|
Delete(tenantID string, userID int64, roleID int64) error
|
|
}
|