service

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CasbinService

type CasbinService struct {
	Enforcer    *casbin.SyncedEnforcer `inject:"enforcer"`
	UserService *UserService           `inject:"userService"`
	RoleService *RoleService           `inject:"roleService"`
}

CasbinService负责更新Casbin Enforce数据至

func (*CasbinService) LoadAllPolicy

func (s *CasbinService) LoadAllPolicy() error

LoadAllPolicy 加载所有的角色策略

func (*CasbinService) LoadPolicy

func (s *CasbinService) LoadPolicy(id string) error

LoadPolicy 加载角色权限策略

type CommonUserService added in v0.0.3

type CommonUserService struct{}

func (*CommonUserService) CreateUser added in v0.0.3

func (s *CommonUserService) CreateUser(user *CommonDTO.User) (*CommonDTO.User, error)

func (*CommonUserService) GetByEmail added in v0.0.3

func (s *CommonUserService) GetByEmail(email string) (*CommonDTO.User, error)

func (*CommonUserService) GetById added in v0.0.3

func (s *CommonUserService) GetById(id string) (*CommonDTO.User, error)

func (*CommonUserService) GetByMobile added in v0.0.3

func (s *CommonUserService) GetByMobile(mobile string) (*CommonDTO.User, error)

type InviteCodeService

type InviteCodeService struct {
	service.BaseService
	InviteCodeRepository *repository.InviteCodeRepository `inject:"inviteCodeRepository"`
	UserRepository       *repository.UserRepository       `inject:"userRepository"`
}

func (*InviteCodeService) FindByInviteCode

func (s *InviteCodeService) FindByInviteCode(inviteCode string) (*domain.InviteCode, error)

func (*InviteCodeService) GetUserInviteCode

func (s *InviteCodeService) GetUserInviteCode(userId string, channel string) (*domain.InviteCode, error)

type OrganizationService

type OrganizationService struct {
	service.BaseService
	OrganizationRepository *repository.OrganizationRepository `inject:"organizationRepository"`
}

func GetOrganizationService

func GetOrganizationService() *OrganizationService

func (*OrganizationService) CreateOrganization

func (s *OrganizationService) CreateOrganization(organization *domain.Organization) (*domain.Organization, error)

func (*OrganizationService) DeleteOrganization

func (s *OrganizationService) DeleteOrganization(id int64) (bool, error)

func (*OrganizationService) GetById

func (s *OrganizationService) GetById(id int64) (*domain.Organization, error)

func (*OrganizationService) GetSubList

func (s *OrganizationService) GetSubList(fid int64) []domain.Organization

func (*OrganizationService) HasSubNode

func (s *OrganizationService) HasSubNode(fid int64) int64

func (*OrganizationService) List

func (s *OrganizationService) List(fid int64, name string, pageable query.Pageable) (total int64, list []domain.Organization)

func (*OrganizationService) UpdateOrganization

func (s *OrganizationService) UpdateOrganization(organization *domain.Organization) (*domain.Organization, error)

type OrganizationUserService

type OrganizationUserService struct {
	service.BaseService
	OrganizationUserRepository *repository.OrganizationUserRepository `inject:"organizationUserRepository"`
	OrganizationRepository     *repository.OrganizationRepository     `inject:"organizationRepository"`
}

func (*OrganizationUserService) GetUserOrganizationIds

func (u *OrganizationUserService) GetUserOrganizationIds(userId string) []int

根据用户id查询所有可能的岗位节点id

func (*OrganizationUserService) ListMembers

func (u *OrganizationUserService) ListMembers(organizationId int64, userName string, pageable query.Pageable) (int64, []domain.OrganizationMember)

type RoleService

type RoleService struct {
	service.BaseService
	RoleRepository *repository.RoleRepository `inject:"roleRepository"`
}

func (*RoleService) Add

func (s *RoleService) Add(role *dto.Role) (*domain.Role, error)

func (*RoleService) Count

func (s *RoleService) Count(role *dto.Role) (int64, error)

func (*RoleService) Delete

func (s *RoleService) Delete(id string) error

func (*RoleService) Edit

func (s *RoleService) Edit(role *dto.Role) error

func (*RoleService) ExistByID

func (s *RoleService) ExistByID(id string) (bool, error)

func (*RoleService) Get

func (s *RoleService) Get(id string) (*domain.Role, error)

func (*RoleService) GetAll

func (s *RoleService) GetAll(role *dto.Role, pageable query.Pageable) ([]*domain.Role, error)

func (*RoleService) GetUserRoles

func (s *RoleService) GetUserRoles(userId string) ([]*domain.Role, error)

type RoleUserService

type RoleUserService struct {
	service.BaseService
	RoleUserRepository *repository.RoleUserRepository `inject:"roleUserRepository"`
	RoleRepository     *repository.RoleRepository     `inject:"roleRepository"`
}

func (*RoleUserService) GetUserRoleIds

func (u *RoleUserService) GetUserRoleIds(userId string) []string

根据用户id查询所有可能的岗位节点id

func (*RoleUserService) ListMembers

func (u *RoleUserService) ListMembers(roleId string, userName string, pageable query.Pageable) (int64, []domain.RoleMember)

type SocialUserService

type SocialUserService struct {
	service.BaseService
	SocialUserRepository *repository.SocialUserRepository `inject:"socialUserRepository"`
}

func GetSocialUserService

func GetSocialUserService() *SocialUserService

func (*SocialUserService) BoundSocialUser

func (s *SocialUserService) BoundSocialUser(socialUserId string, userId string, socialUser *domain.SocialUser) (*domain.SocialUser, error)

func (*SocialUserService) CreateSocialUser

func (s *SocialUserService) CreateSocialUser(socialUser *domain.SocialUser) (*domain.SocialUser, error)

func (*SocialUserService) GetById

func (s *SocialUserService) GetById(id string) (*domain.SocialUser, error)

func (*SocialUserService) GetBySocialId

func (s *SocialUserService) GetBySocialId(socialType string, socialId string) (*domain.SocialUser, error)

func (*SocialUserService) GetByUserId

func (s *SocialUserService) GetByUserId(socialType string, userId string) (*domain.SocialUser, error)

func (*SocialUserService) UpdateSocialUser

func (s *SocialUserService) UpdateSocialUser(socialUser *domain.SocialUser) (*domain.SocialUser, error)

type SysOptionService

type SysOptionService struct {
	service.BaseService
	SysOptionRepository *repository.SysOptionRepository `inject:"sysOptionRepository"`
}

func (*SysOptionService) AddSysOption

func (s *SysOptionService) AddSysOption(option *domain.SysOption) (*domain.SysOption, error)

func (*SysOptionService) AddSysOptions

func (s *SysOptionService) AddSysOptions(options []domain.SysOption) (*[]domain.SysOption, error)

func (*SysOptionService) DeleteSysOption

func (s *SysOptionService) DeleteSysOption(option *domain.SysOption) (*domain.SysOption, error)

func (*SysOptionService) GetDefaultOptions

func (s *SysOptionService) GetDefaultOptions(tenantId string) (*domain.SysOptions, error)

func (*SysOptionService) GetSystemOptions

func (s *SysOptionService) GetSystemOptions() (*domain.SysOptions, error)

func (*SysOptionService) GetTenantOptions

func (s *SysOptionService) GetTenantOptions(tenantId string) (*domain.SysOptions, error)

func (*SysOptionService) RemoveAllTenantOptions

func (s *SysOptionService) RemoveAllTenantOptions(tenantId string) error

func (*SysOptionService) RemoveTenantOption

func (s *SysOptionService) RemoveTenantOption(tenantId string, key string) (*domain.SysOption, error)

func (*SysOptionService) SetTenantOption

func (s *SysOptionService) SetTenantOption(tenantId string, key string, value string) (*domain.SysOption, error)

func (*SysOptionService) SetTenantOptions

func (s *SysOptionService) SetTenantOptions(tenantOptions *domain.SysOptions) (*domain.SysOptions, error)

type TenantService

type TenantService struct {
	service.BaseService
	TenantRepository *repository.TenantRepository `inject:"tenantRepository"`
}

func GetTenantService

func GetTenantService() *TenantService

func (*TenantService) Create

func (s *TenantService) Create(tenant *domain.Tenant) (*domain.Tenant, error)

func (*TenantService) DeleteById

func (s *TenantService) DeleteById(id string) (bool, error)

func (*TenantService) DeleteTenant

func (s *TenantService) DeleteTenant(tenant *domain.Tenant) (bool, error)

func (*TenantService) Find

func (s *TenantService) Find(conds map[string]interface{}, pageable query.Pageable) (total int64, list []*domain.Tenant)

func (*TenantService) GetById

func (s *TenantService) GetById(id string) (*domain.Tenant, error)

func (*TenantService) GetByIds

func (s *TenantService) GetByIds(ids []string) ([]*domain.Tenant, error)

func (*TenantService) Patch

func (s *TenantService) Patch(id string, column string, value interface{}) (*domain.Tenant, error)

func (*TenantService) PatchAll

func (s *TenantService) PatchAll(id string, kv map[string]interface{}) (*domain.Tenant, error)

func (*TenantService) Update

func (s *TenantService) Update(tenant *domain.Tenant) (*domain.Tenant, error)

type UserOptionService

type UserOptionService struct {
	service.BaseService
	UserOptionRepository *repository.UserOptionRepository `inject:"userOptionRepository"`
}

func (*UserOptionService) AddUserOption

func (s *UserOptionService) AddUserOption(option *domain.UserOption) (*domain.UserOption, error)

func (*UserOptionService) AddUserOptions

func (s *UserOptionService) AddUserOptions(options []domain.UserOption) (*[]domain.UserOption, error)

func (*UserOptionService) GetDefaultUserOptions

func (s *UserOptionService) GetDefaultUserOptions() (*domain.UserOptions, error)

func (*UserOptionService) GetUserOptions

func (s *UserOptionService) GetUserOptions(userId string) (*domain.UserOptions, error)

func (*UserOptionService) RemoveAllUserOptions

func (s *UserOptionService) RemoveAllUserOptions(userId string) error

func (*UserOptionService) RemoveUserOption

func (s *UserOptionService) RemoveUserOption(userId string, key string) (*domain.UserOption, error)

func (*UserOptionService) SetUserOption

func (s *UserOptionService) SetUserOption(userId string, key string, value string) (*domain.UserOption, error)

func (*UserOptionService) SetUserOptions

func (s *UserOptionService) SetUserOptions(userOptions *domain.UserOptions) (*domain.UserOptions, error)

type UserService

type UserService struct {
	service.BaseService
	UserRepository *repository.UserRepository `inject:"userRepository"`
	Enforcer       *casbin.SyncedEnforcer     `inject:"enforcer"`
}

func GetUserService

func GetUserService() *UserService

func (*UserService) Check

func (s *UserService) Check(username, password string) (bool, error)

func (*UserService) Count

func (s *UserService) Count(user *dto.User) (int64, error)

func (*UserService) Create

func (s *UserService) Create(user *dto.User) (*domain.User, error)

func (*UserService) Delete

func (s *UserService) Delete(user *domain.User) error

func (*UserService) DeleteById

func (s *UserService) DeleteById(id string) error

func (*UserService) ExistByID

func (s *UserService) ExistByID(id string) (bool, error)

func (*UserService) Find

func (a *UserService) Find(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.User)

func (*UserService) Get

func (s *UserService) Get(username string) (*domain.User, error)

func (*UserService) GetAll

func (s *UserService) GetAll(user *dto.User, pageable query.Pageable) (int64, []domain.User)

func (*UserService) GetAllWithOrganization

func (a *UserService) GetAllWithOrganization(name string, pageable query.Pageable) (int64, []domain.UserWithOrganization)

查询用户信息(带岗位)

func (*UserService) GetByEmail

func (s *UserService) GetByEmail(email string) (*domain.User, error)

func (*UserService) GetById

func (s *UserService) GetById(id string) (*domain.User, error)

func (*UserService) GetByLogin

func (s *UserService) GetByLogin(login string) (*domain.User, error)

func (*UserService) GetByMobile

func (s *UserService) GetByMobile(mobile string) (*domain.User, error)

func (*UserService) Patch

func (s *UserService) Patch(id string, column string, value interface{}) (*domain.User, error)

func (*UserService) PatchAll

func (s *UserService) PatchAll(id string, kv map[string]interface{}) (*domain.User, error)

func (*UserService) Update

func (s *UserService) Update(user *dto.User) (*domain.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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