mirror of
https://github.com/emo2007/block-accounting.git
synced 2025-04-12 08:56:28 +00:00
tmp
This commit is contained in:
parent
21dce23d0e
commit
a7719708fb
@ -3,4 +3,35 @@ package models
|
|||||||
type UserIdentity interface {
|
type UserIdentity interface {
|
||||||
Id() string
|
Id() string
|
||||||
Mnemonic() string
|
Mnemonic() string
|
||||||
|
IsAdmin() bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type User struct {
|
||||||
|
id string
|
||||||
|
mnemonic string
|
||||||
|
isAdmin bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUser(id string, mnemonic string) *User {
|
||||||
|
return &User{
|
||||||
|
id: id,
|
||||||
|
mnemonic: mnemonic,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *User) Id() string {
|
||||||
|
return u.id
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *User) Mnemonic() string {
|
||||||
|
return u.mnemonic
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *User) IsAdmin() bool {
|
||||||
|
return u.isAdmin
|
||||||
|
}
|
||||||
|
|
||||||
|
type OrganizationUser struct {
|
||||||
|
User
|
||||||
|
// add org info
|
||||||
}
|
}
|
||||||
|
22
backend/internal/usecase/repository/users/repository.go
Normal file
22
backend/internal/usecase/repository/users/repository.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package users
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/emochka2007/block-accounting/internal/pkg/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetParams struct {
|
||||||
|
Id string
|
||||||
|
OrganizationId string
|
||||||
|
Seed []byte
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo implement
|
||||||
|
type Repository interface {
|
||||||
|
Get(ctx context.Context, params GetParams) (*models.User, error)
|
||||||
|
Create(ctx context.Context, user *models.User) error
|
||||||
|
Activate(ctx context.Context, id string) error
|
||||||
|
Update(ctx context.Context, user *models.User) error
|
||||||
|
Delete(ctx context.Context, id string) error
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user