ms-auth/internal/users/usecase.go

21 lines
899 B
Go
Raw Normal View History

2024-10-09 17:07:38 +00:00
package users
import (
"context"
"git.sch9.ru/new_gate/ms-auth/internal/models"
)
type UseCase interface {
2024-12-30 15:04:26 +00:00
CreateUser(ctx context.Context, username string, password string, role models.Role) (int32, error)
ReadUserById(ctx context.Context, id int32) (*models.User, error)
2024-10-09 17:07:38 +00:00
ReadUserByUsername(ctx context.Context, username string) (*models.User, error)
2024-12-30 15:04:26 +00:00
UpdateUser(ctx context.Context, id int32, username *string, role *models.Role) error
2024-10-09 17:07:38 +00:00
DeleteUser(ctx context.Context, id int32) error
2024-12-30 15:04:26 +00:00
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)
2024-10-09 17:07:38 +00:00
}