1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- package backend
- import (
- "context"
- "kpt-pasture/config"
- "kpt-pasture/service/wechat"
- "kpt-pasture/store/kptstore"
- pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
- operationPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/operation"
- "gitee.com/xuyiping_admin/pkg/di"
- "go.uber.org/dig"
- )
- var Module = di.Options(di.Provide(NewStore))
- type Hub struct {
- dig.In
- OpsService KptService
- }
- type StoreEntry struct {
- dig.In
- Cfg *config.AppConfig
- DB *kptstore.DB
- HttpClient *wechat.ClientService
- }
- func NewStore(store StoreEntry) KptService {
- return &store
- }
- func NewStoreEntry(cfg *config.AppConfig, Db *kptstore.DB) *StoreEntry {
- return &StoreEntry{
- Cfg: cfg,
- DB: Db,
- HttpClient: nil,
- }
- }
- //go:generate mockgen -destination mock/kptservice.go -package kptservicemock kpt-pasture/module/backend KptService
- type KptService interface {
- SystemService // 系统相关操作
- }
- //go:generate mockgen -destination mock/SystemService.go -package kptservicemock kpt-pasture/module/backend SystemService
- type SystemService interface {
- // Login 系统用户相关
- Login(ctx context.Context, req *pasturePb.SearchUserRequest) (*pasturePb.SystemUserResponse, error)
- SearchSystemUserList(ctx context.Context, req *pasturePb.SearchUserRequest) (*pasturePb.SearchUserResponse, error)
- IsShowSystemUser(ctx context.Context, userId int64) error
- DeleteSystemUser(ctx context.Context, userId int64) error
- SystemUserCreateOrUpdate(ctx context.Context, req *pasturePb.SearchUserRequest) error
- ResetPasswordSystemUser(ctx context.Context, req *pasturePb.ResetUserPasswordRequest) error
- GetCurrentUserName(ctx context.Context) (string, error)
- GetUserInfo(ctx context.Context, token string) (*operationPb.UserAuth, error)
- DetailsSystemUser(ctx context.Context, userId int64) (*operationPb.UserDetails, error)
- GetSystemUserPermissions(ctx context.Context, token string) (*operationPb.SystemUserMenuPermissions, error)
- // SearchSystemRoleList 系统角色相关
- SearchSystemRoleList(ctx context.Context, req *pasturePb.SearchRoleRequest) (*pasturePb.SearchRoleResponse, error)
- DeleteSystemRole(ctx context.Context, roleId int64) error
- IsShowSystemRole(ctx context.Context, roleId int64) error
- SystemRoleCreateOrUpdate(ctx context.Context, req *pasturePb.SearchRoleRequest) error
- GetRolePermissions(ctx context.Context, roleId int64) (*operationPb.RolePermissionsList, error)
- // SearchSystemMenuList 系统菜单权限
- SearchSystemMenuList(ctx context.Context, req *pasturePb.SearchMenuRequest) (*pasturePb.SearchMenuResponse, error)
- DeleteSystemMenu(ctx context.Context, menuId int64) error
- CreateOrUpdateSystemMenu(ctx context.Context, req *pasturePb.SearchMenuRequest) error
- // SearchSystemDeptList 部门列表
- SearchSystemDeptList(ctx context.Context, req *pasturePb.SearchDeptRequest) (*pasturePb.SearchDeptResponse, error)
- SystemDepDelete(ctx context.Context, id int64) error
- SystemDeptCreateOrUpdate(ctx context.Context, req *pasturePb.SearchDeptRequest) error
- }
|