12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- package backend
- import (
- "context"
- "kpt-tmr-group/config"
- "kpt-tmr-group/model"
- "kpt-tmr-group/pkg/di"
- operationPb "kpt-tmr-group/proto/go/backend/operation"
- "kpt-tmr-group/store/kptstore"
- "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
- //SSO *sso.Cache
- // AsynqClient asynqsvc.Client
- // Cache *redis.Client
- }
- func NewStore(store StoreEntry) KptService {
- return &store
- }
- type KptService interface {
- Operation
- SystemOperation
- }
- type Operation interface {
- // CreatePasture 牧场管理相关
- CreatePasture(ctx context.Context, req *operationPb.AddPastureRequest) error
- SearchPastureList(ctx context.Context, req *operationPb.SearchPastureRequest) (*model.GroupPastureResponse, error)
- }
- type SystemOperation interface {
- // Auth 系统用户相关
- Auth(ctx context.Context, auth *operationPb.UserAuth) (*operationPb.SystemToken, error)
- GetUserInfo(ctx context.Context, token string) (*operationPb.UserAuth, error)
- CreateSystemUser(ctx context.Context, req *operationPb.AddSystemUser) error
- SearchSystemUserList(ctx context.Context, req *operationPb.SearchUserRequest) (*model.SystemUserResponse, error)
- EditSystemUser(ctx context.Context, req *operationPb.AddSystemUser) error
- DeleteSystemUser(ctx context.Context, userId int64) error
- IsShowSystemUser(ctx context.Context, req *operationPb.IsShowSystemUserRequest) error
- // CreateSystemRole 系统角色相关
- CreateSystemRole(ctx context.Context, req *operationPb.AddRoleRequest) error
- EditSystemRole(ctx context.Context, req *operationPb.AddRoleRequest) error
- DeleteSystemRole(ctx context.Context, roleId int64) error
- SearchSystemRoleList(ctx context.Context, req *operationPb.SearchRoleRequest) (*model.SystemRoleResponse, error)
- // CreateSystemMenu 系统菜单权限
- CreateSystemMenu(ctx context.Context, req *operationPb.AddMenuRequest) error
- EditSystemMenu(ctx context.Context, req *operationPb.AddMenuRequest) error
- IsShowSystemMenu(ctx context.Context, req *operationPb.IsShowSystemMenuRequest) error
- SearchSystemMenuList(ctx context.Context, req *operationPb.SearchMenuRequest) (*model.SystemMenuResponse, error)
- DeleteSystemMenu(ctx context.Context, menuId int64) error
- }
|