biz

package
v0.0.0-...-771d5d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type KeyboardBinding

type KeyboardBinding struct {
	KeyboardKey string `json:"keyboardKey" bson:"keyboardKey"`
	EmulatorKey string `json:"emulatorKey" bson:"emulatorKey"`
}

type Macro

type Macro struct {
	Id          int64         `json:"id" bson:"id"`
	UserId      int64         `json:"userId" bson:"userId"`
	Name        string        `json:"name" bson:"name"`
	KeyboardKey string        `json:"keyboardKey" bson:"keyboardKey"`
	Actions     []MacroAction `json:"actions" bson:"actions"` // 宏指令的动作列表
}

Macro 宏指令,用户可按键组合

type MacroAction

type MacroAction struct {
	EmulatorKey  string `json:"emulatorKey" bson:"emulatorKey"`   // 模拟器按键名称
	ReleaseDelay int64  `json:"releaseDelay" bson:"releaseDelay"` // 按键释放延迟,毫秒
}

MacroAction 宏动作,宏指令的组成部分

type MacroRepo

type MacroRepo interface {
	CreateMacro(ctx context.Context, macro *Macro) error
	GetMacro(ctx context.Context, id int64) (*Macro, error)
	ListMacro(ctx context.Context, userId int64, page, pageSize int32) ([]*Macro, int32, error)
	DeleteMacro(ctx context.Context, id int64) error
	GetMacroByName(ctx context.Context, userId int64, name string) (*Macro, error)
}

type MacroUseCase

type MacroUseCase struct {
	// contains filtered or unexported fields
}

func NewMacroUseCase

func NewMacroUseCase(repo MacroRepo, logger log.Logger) *MacroUseCase

func (*MacroUseCase) CreateMacro

func (uc *MacroUseCase) CreateMacro(ctx context.Context, macro *Macro) error

func (*MacroUseCase) DeleteMacro

func (uc *MacroUseCase) DeleteMacro(ctx context.Context, id int64) error

func (*MacroUseCase) GetMacro

func (uc *MacroUseCase) GetMacro(ctx context.Context, id int64) (*Macro, error)

func (*MacroUseCase) ListMacro

func (uc *MacroUseCase) ListMacro(ctx context.Context, userId int64, page, pageSize int32) ([]*Macro, int32, error)

type User

type User struct {
	ID       int64  `json:"ID"`
	Name     string `json:"name"`
	Password string `json:"password"`
}

type UserKeyboardBinding

type UserKeyboardBinding struct {
	Id               int64              `json:"id" bson:"id"`
	Name             string             `json:"name" bson:"name"`
	UserId           int64              `json:"userId" bson:"userId"`
	KeyboardBindings []*KeyboardBinding `json:"keyboardBindings" bson:"keyboardBindings"`
}

type UserKeyboardBindingRepo

type UserKeyboardBindingRepo interface {
	CreateKeyboardBinding(ctx context.Context, ub *UserKeyboardBinding) error
	UpdateKeyboardBinding(ctx context.Context, ub *UserKeyboardBinding) error
	DeleteKeyboardBinding(ctx context.Context, id int64) error
	GetKeyboardBinding(ctx context.Context, id int64) (*UserKeyboardBinding, error)
	ListUserKeyboardBinding(ctx context.Context, userId int64, page, pageSize int32) ([]*UserKeyboardBinding, int32, error)
	GetBindingByName(ctx context.Context, userId int64, name string) (*UserKeyboardBinding, error)
}

type UserKeyboardBindingUseCase

type UserKeyboardBindingUseCase struct {
	// contains filtered or unexported fields
}

func NewUserKeyboardBindingUseCase

func NewUserKeyboardBindingUseCase(repo UserKeyboardBindingRepo, logger log.Logger) *UserKeyboardBindingUseCase

func (*UserKeyboardBindingUseCase) CreateKeyboardBinding

func (uc *UserKeyboardBindingUseCase) CreateKeyboardBinding(ctx context.Context, ub *UserKeyboardBinding) error

func (*UserKeyboardBindingUseCase) DeleteKeyboardBinding

func (uc *UserKeyboardBindingUseCase) DeleteKeyboardBinding(ctx context.Context, id int64) error

func (*UserKeyboardBindingUseCase) GetKeyboardBinding

func (uc *UserKeyboardBindingUseCase) GetKeyboardBinding(ctx context.Context, id int64) (*UserKeyboardBinding, error)

func (*UserKeyboardBindingUseCase) ListUserKeyboardBinding

func (uc *UserKeyboardBindingUseCase) ListUserKeyboardBinding(ctx context.Context, userId int64, page, pageSize int32) ([]*UserKeyboardBinding, int32, error)

func (*UserKeyboardBindingUseCase) UpdateKeyboardBinding

func (uc *UserKeyboardBindingUseCase) UpdateKeyboardBinding(ctx context.Context, ub *UserKeyboardBinding) error

type UserRepo

type UserRepo interface {
	GetUser(ctx context.Context, id int64) (*User, error)
	GetUserByName(ctx context.Context, name string) (*User, error)
	CreateUser(ctx context.Context, user *User) error
	UpdateUser(ctx context.Context, user *User) error
}

type UserUseCase

type UserUseCase struct {
	// contains filtered or unexported fields
}

func NewUserUseCase

func NewUserUseCase(ur UserRepo, logger log.Logger) *UserUseCase

func (*UserUseCase) CreateUser

func (uc *UserUseCase) CreateUser(ctx context.Context, user *User) error

func (*UserUseCase) GetUser

func (uc *UserUseCase) GetUser(ctx context.Context, id int64) (*User, error)

func (*UserUseCase) GetUserByName

func (uc *UserUseCase) GetUserByName(ctx context.Context, name string) (*User, error)

func (*UserUseCase) UpdateUser

func (uc *UserUseCase) UpdateUser(ctx context.Context, user *User) error

func (*UserUseCase) VerifyPassword

func (uc *UserUseCase) VerifyPassword(ctx context.Context, name string, password string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL