Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewUserUsecase, NewRoleUsecase, NewPermissionUsecase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type Permission ¶
type Permission struct { ID uint64 Name string Memo string Path string Method string ParentID uint64 ParentIDS string CreateAt string UpdateAt string }
Permission 角色
func (*Permission) ToProtoPermission ¶
func (permission *Permission) ToProtoPermission() *v1.PermissionInfoResponse
ToProtoPermission 转换为proto结构体
type PermissionRepo ¶
type PermissionRepo interface { Create(context.Context, *Permission) (*Permission, error) Update(context.Context, *Permission) (*Permission, error) Delete(context.Context, uint64) (*Permission, error) Get(context.Context, map[string]interface{}) (*Permission, error) List(context.Context, map[string]interface{}, map[string]bool, int64, int64) ([]*Permission, int64, error) }
PermissionRepo 注意这一行新增的 mock 数据的命令
type PermissionUsecase ¶
type PermissionUsecase interface { Create(context.Context, *v1.CreatePermissionRequest) (*Permission, error) Update(context.Context, *v1.UpdatePermissionRequest) (*Permission, error) Delete(context.Context, uint64) (*Permission, error) Get(context.Context, *v1.GetPermissionRequest) (*Permission, error) List(context.Context, *v1.ListPermissionRequest) ([]*Permission, int64, error) }
PermissionUsecase UserUsecase 角色业务逻辑接口
func NewPermissionUsecase ¶
func NewPermissionUsecase(repo PermissionRepo, logger log.Logger) PermissionUsecase
NewPermissionUsecase 创建用户业务逻辑
type Role ¶
Role 角色
func (Role) ToProtoRole ¶
func (role Role) ToProtoRole() *v1.RoleInfoResponse
ToProtoRole 转换为proto结构体
type RoleRepo ¶
type RoleRepo interface { Create(context.Context, *Role) (*Role, error) Update(context.Context, *Role) (*Role, error) Delete(context.Context, uint64) (*Role, error) Get(context.Context, map[string]interface{}) (*Role, error) Query(context.Context, map[string]interface{}) ([]*Role, error) List(context.Context, map[string]interface{}, map[string]bool, int64, int64) ([]*Role, int64, error) }
RoleRepo 注意这一行新增的 mock 数据的命令
type RoleUsecase ¶
type RoleUsecase interface { Create(context.Context, *v1.CreateRoleRequest) (*Role, error) Update(context.Context, *v1.UpdateRoleRequest) (*Role, error) Delete(context.Context, uint64) (*Role, error) Get(context.Context, *v1.GetRoleRequest) (*Role, error) List(context.Context, *v1.ListRoleRequest) ([]*Role, int64, error) }
RoleUsecase UserUsecase 角色业务逻辑接口
func NewRoleUsecase ¶
func NewRoleUsecase(repo RoleRepo, logger log.Logger) RoleUsecase
NewRoleUsecase 创建用户业务逻辑
type User ¶
type User struct { ID uint64 Name string Email string Password string Status int CreateAt string UpdateAt string }
User 定义返回数据结构体
func (*User) ToProtoUser ¶
func (user *User) ToProtoUser() *v1.UserInfoResponse
ToProtoUser 转换为proto结构体
type UserRepo ¶
type UserRepo interface { CreateUser(context.Context, *User) (*User, error) UpdateUser(context.Context, *User) (*User, error) DeleteUser(context.Context, uint64) (*User, error) GetUser(context.Context, map[string]interface{}) (*User, error) ListUser(ctx context.Context, where map[string]interface{}, page, pageSize int64) ([]*User, int64, error) QueryUserRole(ctx context.Context, where map[string]interface{}) (*UserRole, error) CreateUserRole(ctx context.Context, ur *UserRole) (*UserRole, error) DeleteUserRole(ctx context.Context, id uint64) error }
UserRepo 注意这一行新增的 mock 数据的命令
type UserUsecase ¶
type UserUsecase interface { Create(ctx context.Context, user *User) (*User, error) Update(ctx context.Context, user *User) (*User, error) Delete(ctx context.Context, id uint64) (*User, error) Get(ctx context.Context, where map[string]interface{}) (*User, error) List(ctx context.Context, where map[string]interface{}, page, pageSize int64) ([]*User, int64, error) CreateToken(ctx context.Context, email, password string) (string, error) SetUserRole(ctx context.Context, userId uint64, roleIds []uint64) error DeleteUserRole(ctx context.Context, userId uint64, roleIds []uint64) error }
UserUsecase 用户业务逻辑接口
func NewUserUsecase ¶
NewUserUsecase 创建用户业务逻辑
Click to show internal directories.
Click to hide internal directories.