Documentation ¶
Index ¶
- Variables
- type KeyboardBinding
- type Macro
- type MacroAction
- type MacroRepo
- type MacroUseCase
- func (uc *MacroUseCase) CreateMacro(ctx context.Context, macro *Macro) error
- func (uc *MacroUseCase) DeleteMacro(ctx context.Context, id int64) error
- func (uc *MacroUseCase) GetMacro(ctx context.Context, id int64) (*Macro, error)
- func (uc *MacroUseCase) ListMacro(ctx context.Context, userId int64, page, pageSize int32) ([]*Macro, int32, error)
- type User
- type UserKeyboardBinding
- type UserKeyboardBindingRepo
- type UserKeyboardBindingUseCase
- func (uc *UserKeyboardBindingUseCase) CreateKeyboardBinding(ctx context.Context, ub *UserKeyboardBinding) error
- func (uc *UserKeyboardBindingUseCase) DeleteKeyboardBinding(ctx context.Context, id int64) error
- func (uc *UserKeyboardBindingUseCase) GetKeyboardBinding(ctx context.Context, id int64) (*UserKeyboardBinding, error)
- func (uc *UserKeyboardBindingUseCase) ListUserKeyboardBinding(ctx context.Context, userId int64, page, pageSize int32) ([]*UserKeyboardBinding, int32, error)
- func (uc *UserKeyboardBindingUseCase) UpdateKeyboardBinding(ctx context.Context, ub *UserKeyboardBinding) error
- type UserRepo
- type UserUseCase
- func (uc *UserUseCase) CreateUser(ctx context.Context, user *User) error
- func (uc *UserUseCase) GetUser(ctx context.Context, id int64) (*User, error)
- func (uc *UserUseCase) GetUserByName(ctx context.Context, name string) (*User, error)
- func (uc *UserUseCase) UpdateUser(ctx context.Context, user *User) error
- func (uc *UserUseCase) VerifyPassword(ctx context.Context, name string, password string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewUserUseCase, NewUserKeyboardBindingUseCase, NewMacroUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type KeyboardBinding ¶
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
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 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) GetUserByName ¶
func (*UserUseCase) UpdateUser ¶
func (uc *UserUseCase) UpdateUser(ctx context.Context, user *User) error
func (*UserUseCase) VerifyPassword ¶
Click to show internal directories.
Click to hide internal directories.