Documentation ¶
Index ¶
- Variables
- func ConvertToDeptTree(deptList []*model.SysDept) []*pb.DeptTree
- func ConvertToDeptTreeChildren(deptList []*pb.DeptTree) []*pb.DeptTree
- type AuthUseCase
- type CasbinRuleRepo
- type CasbinRuleUseCase
- type MenuSimpleTree
- type MenuTree
- type OssRepo
- type RedisRepo
- type SysApiRepo
- type SysApiUseCase
- func (a *SysApiUseCase) AllApi(ctx context.Context) ([]*model.SysAPI, error)
- func (a *SysApiUseCase) CreateApi(ctx context.Context, api *model.SysAPI) (*model.SysAPI, error)
- func (a *SysApiUseCase) DeleteApi(ctx context.Context, id int64) error
- func (a *SysApiUseCase) GetApiByID(ctx context.Context, id int64) (*model.SysAPI, error)
- func (a *SysApiUseCase) GetPolicyPathByRoleKey(ctx context.Context, roleKey string) ([][]string, error)
- func (a *SysApiUseCase) ListPage(ctx context.Context, page, size int32, path, description string, ...) ([]*model.SysAPI, int32, error)
- func (a *SysApiUseCase) UpdateApi(ctx context.Context, api *model.SysAPI) (*model.SysAPI, error)
- type SysDeptRepo
- type SysDeptUseCase
- func (d *SysDeptUseCase) CreateDept(ctx context.Context, sysDept *model.SysDept) (*model.SysDept, error)
- func (d *SysDeptUseCase) DeleteDept(ctx context.Context, id int64) error
- func (d *SysDeptUseCase) FindDeptByIDList(ctx context.Context, ids []int64) ([]*model.SysDept, error)
- func (d *SysDeptUseCase) GetDept(ctx context.Context, id int64) (*model.SysDept, error)
- func (d *SysDeptUseCase) GetDeptList(ctx context.Context) ([]*pb.DeptTree, error)
- func (d *SysDeptUseCase) ListByNameStatusId(ctx context.Context, deptName string, status int32, id int64) ([]*model.SysDept, error)
- func (d *SysDeptUseCase) RoleDeptTreeSelect(ctx context.Context, roleId int32) (*pb.RoleDeptTreeSelectReply, error)
- func (d *SysDeptUseCase) UpdateDept(ctx context.Context, sysDept *model.SysDept) (*model.SysDept, error)
- type SysDictDatumRepo
- type SysDictDatumUseCase
- func (p *SysDictDatumUseCase) CreateDictData(ctx context.Context, post *model.SysDictDatum) (*model.SysDictDatum, error)
- func (p *SysDictDatumUseCase) DeleteDictData(ctx context.Context, id []int64) error
- func (p *SysDictDatumUseCase) FindDictDataAll(ctx context.Context) ([]*model.SysDictDatum, error)
- func (p *SysDictDatumUseCase) FindDictDataByID(ctx context.Context, id int64) (*model.SysDictDatum, error)
- func (p *SysDictDatumUseCase) FindDictDataByIDList(ctx context.Context, ids []int64) ([]*model.SysDictDatum, error)
- func (p *SysDictDatumUseCase) ListDictData(ctx context.Context, dictLabel, dictType string, status int32, ...) ([]*model.SysDictDatum, int32, error)
- func (p *SysDictDatumUseCase) UpdateDictData(ctx context.Context, post *model.SysDictDatum) (*model.SysDictDatum, error)
- type SysDictTypeRepo
- type SysDictTypeUseCase
- func (p *SysDictTypeUseCase) CreateDictType(ctx context.Context, post *model.SysDictType) (*model.SysDictType, error)
- func (p *SysDictTypeUseCase) DeleteDictType(ctx context.Context, id []int64) error
- func (p *SysDictTypeUseCase) FindDictTypeAll(ctx context.Context) ([]*model.SysDictType, error)
- func (p *SysDictTypeUseCase) FindDictTypeByID(ctx context.Context, id int64) (*model.SysDictType, error)
- func (p *SysDictTypeUseCase) FindDictTypeByIDList(ctx context.Context, ids []int64) ([]*model.SysDictType, error)
- func (p *SysDictTypeUseCase) ListDictType(ctx context.Context, dictName, dictType string, status int32, page, size int32) ([]*model.SysDictType, int32, error)
- func (p *SysDictTypeUseCase) UpdateDictType(ctx context.Context, post *model.SysDictType) (*model.SysDictType, error)
- type SysLogCase
- type SysLogRepo
- type SysMenuRepo
- type SysMenuUseCase
- func (m *SysMenuUseCase) CreateMenus(ctx context.Context, menu *model.SysMenu) (*model.SysMenu, error)
- func (m *SysMenuUseCase) DeleteMenus(ctx context.Context, id int64) error
- func (m *SysMenuUseCase) GetMenus(ctx context.Context, id int64) (*model.SysMenu, error)
- func (m *SysMenuUseCase) ListByNameStatus(ctx context.Context, menuName string, status int32) ([]*model.SysMenu, error)
- func (m *SysMenuUseCase) RoleMenuTreeSelect(ctx context.Context, req *pb.RoleMenuTreeSelectRequest) (*pb.RoleMenuTreeSelectReply, error)
- func (m *SysMenuUseCase) UpdateMenus(ctx context.Context, menu *model.SysMenu) (*model.SysMenu, error)
- type SysPostRepo
- type SysPostUseCase
- func (p *SysPostUseCase) CreatePost(ctx context.Context, post *model.SysPost) (*model.SysPost, error)
- func (p *SysPostUseCase) DeletePost(ctx context.Context, ids []int64) error
- func (p *SysPostUseCase) FindPostAll(ctx context.Context) ([]*model.SysPost, error)
- func (p *SysPostUseCase) FindPostByID(ctx context.Context, id int64) (*model.SysPost, error)
- func (p *SysPostUseCase) FindPostByIDList(ctx context.Context, ids []int64) ([]*model.SysPost, error)
- func (p *SysPostUseCase) ListPost(ctx context.Context, postName, postCode string, status int32, page, size int32) ([]*model.SysPost, int32, error)
- func (p *SysPostUseCase) UpdatePost(ctx context.Context, post *model.SysPost) (*model.SysPost, error)
- type SysRoleMenuRepo
- type SysRoleMenuUseCase
- func (r *SysRoleMenuUseCase) CreateRoleMenus(ctx context.Context, role *model.SysRole, menuIDs []int64) error
- func (r *SysRoleMenuUseCase) DeleteByRoleId(ctx context.Context, roleIDs ...int64) error
- func (r *SysRoleMenuUseCase) FindMenuByRoleId(ctx context.Context, roleID int64) ([]*model.SysMenu, error)
- func (r *SysRoleMenuUseCase) GetPermission(ctx context.Context, roleID int64) ([]string, error)
- func (r *SysRoleMenuUseCase) SelectMenuRole(ctx context.Context, roleName string) ([]*pb.MenuTree, error)
- type SysRoleRepo
- type SysRoleUseCase
- func (r *SysRoleUseCase) ChangeDataScope(ctx context.Context, id int64, scope int32) error
- func (r *SysRoleUseCase) ChangeRoleStatus(ctx context.Context, id int64, status int32) error
- func (r *SysRoleUseCase) CreateRole(ctx context.Context, role *model.SysRole, menuIds []int64, apis []*pb.ApiBase) (*model.SysRole, error)
- func (r *SysRoleUseCase) DeleteRole(ctx context.Context, ids []int64) error
- func (r *SysRoleUseCase) FindRoleAll(ctx context.Context) ([]*model.SysRole, error)
- func (r *SysRoleUseCase) FindRoleByIDList(ctx context.Context, ids []int64) ([]*model.SysRole, error)
- func (r *SysRoleUseCase) GetRole(ctx context.Context, id int64) (*model.SysRole, error)
- func (r *SysRoleUseCase) GetRoleMenuId(ctx context.Context, roleId int64) ([]int32, error)
- func (r *SysRoleUseCase) ListPage(ctx context.Context, roleName, roleKey string, status int32, page, size int32) ([]*model.SysRole, int32, error)
- func (r *SysRoleUseCase) Roles(ctx context.Context) ([]*model.SysRole, error)
- func (r *SysRoleUseCase) UpdateRole(ctx context.Context, role *model.SysRole, menuIds []int64, apis []*pb.ApiBase) (*model.SysRole, error)
- type SysUserRepo
- type SysUserUseCase
- func (uc *SysUserUseCase) ChangeStatus(ctx context.Context, id int64, status int32) error
- func (uc *SysUserUseCase) CountByRoleId(ctx context.Context, roleId int64) (int64, error)
- func (uc *SysUserUseCase) CreateSysUser(ctx context.Context, u *model.SysUser) (*model.SysUser, error)
- func (uc *SysUserUseCase) DeleteSysUser(ctx context.Context, id int64) error
- func (uc *SysUserUseCase) FindByPostId(ctx context.Context, postId int64) ([]*model.SysUser, error)
- func (uc *SysUserUseCase) FindSysUserById(ctx context.Context, id int64) (*model.SysUser, error)
- func (uc *SysUserUseCase) FindSysUserByUsername(ctx context.Context, username string) (*model.SysUser, error)
- func (uc *SysUserUseCase) ListPage(ctx context.Context, req *pb.ListSysuserRequest) (users []*model.SysUser, total int32, err error)
- func (uc *SysUserUseCase) UpdateAvatar(ctx context.Context) error
- func (uc *SysUserUseCase) UpdatePassword(ctx context.Context, id int64, newPwd, oldPwd string) error
- func (uc *SysUserUseCase) UpdateSysUser(ctx context.Context, u *model.SysUser) error
- func (uc *SysUserUseCase) UploadFile(ctx context.Context) (string, error)
- type Transaction
- type UserListCondition
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errors.New(400, "user not found", "user not found") ErrPasswordInvalid = errors.New(400, "password invalid", "user not found") )
View Source
var ProviderSet = wire.NewSet( NewSysUserUseCase, NewAuthUseCase, NewSysMenusUseCase, NewSysDeptUseCase, NewSysPostUseCase, NewSysApiUseCase, NewSysRoleUseCase, NewSysRoleMenuUseCase, NewCasbinRuleUseCase, NewSysDictDatumUseCase, NewSysDictTypeUseCase, NewSysLogCase, )
ProviderSet is biz providers.
Functions ¶
Types ¶
type AuthUseCase ¶
type AuthUseCase struct {
// contains filtered or unexported fields
}
func NewAuthUseCase ¶
func NewAuthUseCase(conf *conf.Auth, userRepo SysUserRepo, roleRepo SysRoleRepo, logger log.Logger) *AuthUseCase
func (*AuthUseCase) Login ¶
func (receiver *AuthUseCase) Login(ctx context.Context, req *pb.LoginRequest) (token string, expireAt int64, pErr error)
type CasbinRuleRepo ¶
type CasbinRuleRepo interface { GetModel() model.Model GetAdapter() persist.Adapter UpdateCasbin(ctx context.Context, roleKey string, p [][]string) error ClearCasbin(v int, p ...string) error UpdateCasbinApi(ctx context.Context, oldPath string, newPath string, oldMethod string, newMethod string) error GetPolicyPathByRoleId(roleKey string) [][]string }
type CasbinRuleUseCase ¶
type CasbinRuleUseCase struct {
// contains filtered or unexported fields
}
func NewCasbinRuleUseCase ¶
func NewCasbinRuleUseCase(repo CasbinRuleRepo, logger log.Logger) *CasbinRuleUseCase
func (*CasbinRuleUseCase) ClearCasbin ¶
func (c *CasbinRuleUseCase) ClearCasbin(roleKey string) error
func (*CasbinRuleUseCase) GetPolicyPathByRoleId ¶
func (c *CasbinRuleUseCase) GetPolicyPathByRoleId(roleKey string) [][]string
func (*CasbinRuleUseCase) UpdateCasbin ¶
type MenuSimpleTree ¶
type MenuSimpleTree struct { MenuId int64 `json:"menuId"` MenuName string `json:"menuName"` Children []*MenuSimpleTree `json:"children,omitempty"` }
type RedisRepo ¶
type RedisRepo interface { SetHashKey(context.Context, string, string, interface{}) error GetHashKey(context.Context, string, string) (string, error) DelHashKey(ctx context.Context, key string, field string) error GetHashLen(ctx context.Context, key string) error Lock(context.Context, string, interface{}, time.Duration) (bool, error) IncrHashKey(context.Context, string, string, int64) error GetHashAllKeyAndVal(context.Context, string) (map[string]string, error) Set(ctx context.Context, key string, value string, expire time.Duration) error Get(ctx context.Context, key string) string SRem(ctx context.Context, key string, members ...interface{}) (int64, error) }
type SysApiRepo ¶
type SysApiRepo interface { FindByID(ctx context.Context, id int64) (*model.SysAPI, error) Create(ctx context.Context, api *model.SysAPI) error Save(ctx context.Context, api *model.SysAPI) error Delete(ctx context.Context, id int64) error FindAll(ctx context.Context) ([]*model.SysAPI, error) ListPage(ctx context.Context, page, size int32, path string, description string, group string, method string) ([]*model.SysAPI, error) ListPageCount(ctx context.Context) (int32, error) }
type SysApiUseCase ¶
type SysApiUseCase struct {
// contains filtered or unexported fields
}
func NewSysApiUseCase ¶
func NewSysApiUseCase(repo SysApiRepo, casbinRepo CasbinRuleRepo, logger log.Logger) *SysApiUseCase
func (*SysApiUseCase) DeleteApi ¶
func (a *SysApiUseCase) DeleteApi(ctx context.Context, id int64) error
func (*SysApiUseCase) GetApiByID ¶
func (*SysApiUseCase) GetPolicyPathByRoleKey ¶
type SysDeptRepo ¶
type SysDeptRepo interface { Create(ctx context.Context, dept *model.SysDept) error Save(ctx context.Context, dept *model.SysDept) error UpdateByID(ctx context.Context, id int64, dept *model.SysDept) error Delete(ctx context.Context, id int64) error FindByIDList(ctx context.Context, ids ...int64) ([]*model.SysDept, error) FindByID(ctx context.Context, id int64) (*model.SysDept, error) ListByNameStatusId(ctx context.Context, deptName string, status int32, id int64) ([]*model.SysDept, error) GetRoleDeptId(ctx context.Context, roleId int32) ([]int32, error) SelectDept(ctx context.Context) ([]*pb.DeptTree, error) SelectDeptLabel(ctx context.Context) ([]*pb.DeptLabel, error) }
type SysDeptUseCase ¶
type SysDeptUseCase struct {
// contains filtered or unexported fields
}
func NewSysDeptUseCase ¶
func NewSysDeptUseCase(repo SysDeptRepo, logger log.Logger) *SysDeptUseCase
func (*SysDeptUseCase) CreateDept ¶
func (*SysDeptUseCase) DeleteDept ¶
func (d *SysDeptUseCase) DeleteDept(ctx context.Context, id int64) error
func (*SysDeptUseCase) FindDeptByIDList ¶
func (*SysDeptUseCase) GetDeptList ¶
func (*SysDeptUseCase) ListByNameStatusId ¶
func (*SysDeptUseCase) RoleDeptTreeSelect ¶
func (d *SysDeptUseCase) RoleDeptTreeSelect(ctx context.Context, roleId int32) (*pb.RoleDeptTreeSelectReply, error)
func (*SysDeptUseCase) UpdateDept ¶
type SysDictDatumRepo ¶
type SysDictDatumRepo interface { Create(ctx context.Context, post *model.SysDictDatum) error Save(ctx context.Context, post *model.SysDictDatum) error Delete(ctx context.Context, ids []int64) error FindByID(ctx context.Context, id int64) (*model.SysDictDatum, error) FindByIDList(ctx context.Context, ids ...int64) ([]*model.SysDictDatum, error) FindAll(ctx context.Context) ([]*model.SysDictDatum, error) ListPage(ctx context.Context, dictLabel, dictType string, status int32, page, size int32) ([]*model.SysDictDatum, error) ListPageCount(ctx context.Context, dictLabel, dictType string, status int32) (int32, error) }
type SysDictDatumUseCase ¶
type SysDictDatumUseCase struct {
// contains filtered or unexported fields
}
func NewSysDictDatumUseCase ¶
func NewSysDictDatumUseCase(repo SysDictDatumRepo, logger log.Logger) *SysDictDatumUseCase
func (*SysDictDatumUseCase) CreateDictData ¶
func (p *SysDictDatumUseCase) CreateDictData(ctx context.Context, post *model.SysDictDatum) (*model.SysDictDatum, error)
func (*SysDictDatumUseCase) DeleteDictData ¶
func (p *SysDictDatumUseCase) DeleteDictData(ctx context.Context, id []int64) error
func (*SysDictDatumUseCase) FindDictDataAll ¶
func (p *SysDictDatumUseCase) FindDictDataAll(ctx context.Context) ([]*model.SysDictDatum, error)
func (*SysDictDatumUseCase) FindDictDataByID ¶
func (p *SysDictDatumUseCase) FindDictDataByID(ctx context.Context, id int64) (*model.SysDictDatum, error)
func (*SysDictDatumUseCase) FindDictDataByIDList ¶
func (p *SysDictDatumUseCase) FindDictDataByIDList(ctx context.Context, ids []int64) ([]*model.SysDictDatum, error)
func (*SysDictDatumUseCase) ListDictData ¶
func (p *SysDictDatumUseCase) ListDictData(ctx context.Context, dictLabel, dictType string, status int32, page, size int32) ([]*model.SysDictDatum, int32, error)
func (*SysDictDatumUseCase) UpdateDictData ¶
func (p *SysDictDatumUseCase) UpdateDictData(ctx context.Context, post *model.SysDictDatum) (*model.SysDictDatum, error)
type SysDictTypeRepo ¶
type SysDictTypeRepo interface { Create(ctx context.Context, post *model.SysDictType) error Save(ctx context.Context, post *model.SysDictType) error Delete(ctx context.Context, ids []int64) error FindByID(ctx context.Context, id int64) (*model.SysDictType, error) FindByIDList(ctx context.Context, ids ...int64) ([]*model.SysDictType, error) FindAll(ctx context.Context) ([]*model.SysDictType, error) ListPage(ctx context.Context, dictName, dictType string, status int32, page, size int32) ([]*model.SysDictType, error) ListPageCount(ctx context.Context, dictName, dictType string, status int32) (int32, error) }
type SysDictTypeUseCase ¶
type SysDictTypeUseCase struct {
// contains filtered or unexported fields
}
func NewSysDictTypeUseCase ¶
func NewSysDictTypeUseCase(repo SysDictTypeRepo, logger log.Logger) *SysDictTypeUseCase
func (*SysDictTypeUseCase) CreateDictType ¶
func (p *SysDictTypeUseCase) CreateDictType(ctx context.Context, post *model.SysDictType) (*model.SysDictType, error)
func (*SysDictTypeUseCase) DeleteDictType ¶
func (p *SysDictTypeUseCase) DeleteDictType(ctx context.Context, id []int64) error
func (*SysDictTypeUseCase) FindDictTypeAll ¶
func (p *SysDictTypeUseCase) FindDictTypeAll(ctx context.Context) ([]*model.SysDictType, error)
func (*SysDictTypeUseCase) FindDictTypeByID ¶
func (p *SysDictTypeUseCase) FindDictTypeByID(ctx context.Context, id int64) (*model.SysDictType, error)
func (*SysDictTypeUseCase) FindDictTypeByIDList ¶
func (p *SysDictTypeUseCase) FindDictTypeByIDList(ctx context.Context, ids []int64) ([]*model.SysDictType, error)
func (*SysDictTypeUseCase) ListDictType ¶
func (p *SysDictTypeUseCase) ListDictType(ctx context.Context, dictName, dictType string, status int32, page, size int32) ([]*model.SysDictType, int32, error)
func (*SysDictTypeUseCase) UpdateDictType ¶
func (p *SysDictTypeUseCase) UpdateDictType(ctx context.Context, post *model.SysDictType) (*model.SysDictType, error)
type SysLogCase ¶
type SysLogCase struct {
// contains filtered or unexported fields
}
func NewSysLogCase ¶
func NewSysLogCase(repo SysLogRepo) *SysLogCase
type SysLogRepo ¶
type SysMenuRepo ¶
type SysMenuRepo interface { Create(ctx context.Context, menu *model.SysMenu) error Save(ctx context.Context, menu *model.SysMenu) error Delete(ctx context.Context, id int64) error DeleteMultiple(ctx context.Context, ids []int64) error GetAllChildren(ctx context.Context, id int64) ([]int64, error) FindById(ctx context.Context, id int64) (*model.SysMenu, error) ListAll(ctx context.Context) ([]*model.SysMenu, error) FindByNameStatus(ctx context.Context, name string, status int32) ([]*model.SysMenu, error) GetRoleMenuId(ctx context.Context, roleId int64) ([]int32, error) SelectMenuLabel(data model.SysMenu) ([]*pb.MenuLabel, error) }
type SysMenuUseCase ¶
type SysMenuUseCase struct {
// contains filtered or unexported fields
}
func NewSysMenusUseCase ¶
func NewSysMenusUseCase(repo SysMenuRepo, logger log.Logger) *SysMenuUseCase
func (*SysMenuUseCase) CreateMenus ¶
func (*SysMenuUseCase) DeleteMenus ¶
func (m *SysMenuUseCase) DeleteMenus(ctx context.Context, id int64) error
func (*SysMenuUseCase) ListByNameStatus ¶
func (*SysMenuUseCase) RoleMenuTreeSelect ¶
func (m *SysMenuUseCase) RoleMenuTreeSelect(ctx context.Context, req *pb.RoleMenuTreeSelectRequest) (*pb.RoleMenuTreeSelectReply, error)
func (*SysMenuUseCase) UpdateMenus ¶
type SysPostRepo ¶
type SysPostRepo interface { Create(ctx context.Context, post *model.SysPost) error Save(ctx context.Context, post *model.SysPost) error Delete(ctx context.Context, ids []int64) error FindByID(ctx context.Context, id int64) (*model.SysPost, error) FindByIDList(ctx context.Context, ids ...int64) ([]*model.SysPost, error) FindAll(ctx context.Context) ([]*model.SysPost, error) ListPage(ctx context.Context, postName, postCode string, status int32, page, size int32) ([]*model.SysPost, error) ListPageCount(ctx context.Context, postName, postCode string, status int32) (int32, error) }
type SysPostUseCase ¶
type SysPostUseCase struct {
// contains filtered or unexported fields
}
func NewSysPostUseCase ¶
func NewSysPostUseCase(repo SysPostRepo, logger log.Logger, uc *SysUserUseCase) *SysPostUseCase
func (*SysPostUseCase) CreatePost ¶
func (*SysPostUseCase) DeletePost ¶
func (p *SysPostUseCase) DeletePost(ctx context.Context, ids []int64) error
func (*SysPostUseCase) FindPostAll ¶
func (*SysPostUseCase) FindPostByID ¶
func (*SysPostUseCase) FindPostByIDList ¶
func (*SysPostUseCase) UpdatePost ¶
type SysRoleMenuRepo ¶
type SysRoleMenuRepo interface { Create(ctx context.Context, roleMenus ...*model.SysRoleMenu) error DeleteByRoleId(ctx context.Context, roleIDs ...int64) error GetPermission(ctx context.Context, roleID int64) ([]string, error) FindMenuByRoleId(ctx context.Context, roleID int64) ([]*model.SysMenu, error) SelectMenuRole(ctx context.Context, roleName string) ([]*pb.MenuTree, error) }
type SysRoleMenuUseCase ¶
type SysRoleMenuUseCase struct {
// contains filtered or unexported fields
}
func NewSysRoleMenuUseCase ¶
func NewSysRoleMenuUseCase(repo SysRoleMenuRepo, logger log.Logger) *SysRoleMenuUseCase
func (*SysRoleMenuUseCase) CreateRoleMenus ¶
func (*SysRoleMenuUseCase) DeleteByRoleId ¶
func (r *SysRoleMenuUseCase) DeleteByRoleId(ctx context.Context, roleIDs ...int64) error
func (*SysRoleMenuUseCase) FindMenuByRoleId ¶
func (*SysRoleMenuUseCase) GetPermission ¶
func (*SysRoleMenuUseCase) SelectMenuRole ¶
type SysRoleRepo ¶
type SysRoleRepo interface { Create(ctx context.Context, role *model.SysRole) error Save(ctx context.Context, role *model.SysRole) error Delete(ctx context.Context, id ...int64) error FindByID(ctx context.Context, id int64) (*model.SysRole, error) FindByIDList(ctx context.Context, ids ...int64) ([]*model.SysRole, error) FindAll(ctx context.Context) ([]*model.SysRole, error) ListPage(ctx context.Context, name, key string, status int32, page, size int32) ([]*model.SysRole, error) Count(ctx context.Context, name, key string, status int32) (int32, error) Update(ctx context.Context, role *model.SysRole) error Roles(ctx context.Context) ([]*model.SysRole, error) }
type SysRoleUseCase ¶
type SysRoleUseCase struct {
// contains filtered or unexported fields
}
func NewSysRoleUseCase ¶
func NewSysRoleUseCase(repo SysRoleRepo, logger log.Logger, rmc *SysRoleMenuUseCase, casbin *CasbinRuleUseCase, userUseCase *SysUserUseCase, tx Transaction, menuRepo SysMenuRepo) *SysRoleUseCase
func (*SysRoleUseCase) ChangeDataScope ¶
func (*SysRoleUseCase) ChangeRoleStatus ¶
func (*SysRoleUseCase) CreateRole ¶
func (*SysRoleUseCase) DeleteRole ¶
func (r *SysRoleUseCase) DeleteRole(ctx context.Context, ids []int64) error
func (*SysRoleUseCase) FindRoleAll ¶
func (*SysRoleUseCase) FindRoleByIDList ¶
func (*SysRoleUseCase) GetRoleMenuId ¶
type SysUserRepo ¶
type SysUserRepo interface { Save(ctx context.Context, user *model.SysUser) (*model.SysUser, error) Delete(ctx context.Context, id int64) error UpdateByID(ctx context.Context, id int64, user *model.SysUser) error Create(ctx context.Context, g *model.SysUser) (*model.SysUser, error) FindByID(ctx context.Context, id int64) (*model.SysUser, error) FindByUsername(ctx context.Context, username string) (*model.SysUser, error) FindByPostId(ctx context.Context, postId int64) ([]*model.SysUser, error) ListPage(ctx context.Context, page, size int32, condition UserListCondition) ([]*model.SysUser, error) Count(ctx context.Context, condition UserListCondition) (int32, error) CountByRoleId(ctx context.Context, roleId int64) (int64, error) FindAll(ctx context.Context) ([]*model.SysUser, error) }
type SysUserUseCase ¶
type SysUserUseCase struct {
// contains filtered or unexported fields
}
SysUserUseCase is a SysUser use case.
func NewSysUserUseCase ¶
func NewSysUserUseCase(userRepo SysUserRepo, uploadRepo OssRepo, severConfig *conf.Server, logger log.Logger) *SysUserUseCase
NewSysUserUseCase new a SysUser use case.
func (*SysUserUseCase) ChangeStatus ¶
func (*SysUserUseCase) CountByRoleId ¶
func (*SysUserUseCase) CreateSysUser ¶
func (uc *SysUserUseCase) CreateSysUser(ctx context.Context, u *model.SysUser) (*model.SysUser, error)
CreateSysUser creates a SysUser, and returns the new SysUser.
func (*SysUserUseCase) DeleteSysUser ¶
func (uc *SysUserUseCase) DeleteSysUser(ctx context.Context, id int64) error
func (*SysUserUseCase) FindByPostId ¶
func (*SysUserUseCase) FindSysUserById ¶
func (*SysUserUseCase) FindSysUserByUsername ¶
func (*SysUserUseCase) ListPage ¶
func (uc *SysUserUseCase) ListPage(ctx context.Context, req *pb.ListSysuserRequest) (users []*model.SysUser, total int32, err error)
func (*SysUserUseCase) UpdateAvatar ¶
func (uc *SysUserUseCase) UpdateAvatar(ctx context.Context) error
func (*SysUserUseCase) UpdatePassword ¶
func (*SysUserUseCase) UpdateSysUser ¶
func (*SysUserUseCase) UploadFile ¶
func (uc *SysUserUseCase) UploadFile(ctx context.Context) (string, error)
type Transaction ¶
type UserListCondition ¶
Click to show internal directories.
Click to hide internal directories.