ms-auth/internal/users/usecase.go
Vyacheslav1557 3b03447d2f feat(user):
2024-12-30 20:04:26 +05:00

21 lines
899 B
Go

package users
import (
"context"
"git.sch9.ru/new_gate/ms-auth/internal/models"
)
type UseCase interface {
CreateUser(ctx context.Context, username string, password string, role models.Role) (int32, error)
ReadUserById(ctx context.Context, id int32) (*models.User, error)
ReadUserByUsername(ctx context.Context, username string) (*models.User, error)
UpdateUser(ctx context.Context, id int32, username *string, role *models.Role) error
DeleteUser(ctx context.Context, id int32) error
CreateSession(ctx context.Context, userId int32, role models.Role) (string, error)
ReadSession(ctx context.Context, sessionId string) (*models.Session, error)
UpdateSession(ctx context.Context, sessionId string) error
DeleteSession(ctx context.Context, sessionId string) error
DeleteAllSessions(ctx context.Context, userId int32) error
Verify(ctx context.Context, sessionId string) (string, error)
}