1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 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 {
- CreateSystemRoleList(ctx context.Context, req []*operationPb.AddRoleRequest) error
- // CreatePastureList 牧场管理相关
- CreatePastureList(ctx context.Context, req []*operationPb.AddPastureRequest) error
- SearchPastureList(ctx context.Context, req *operationPb.SearchPastureRequest) (*model.GroupPastureResponse, error)
- }
- type SystemOperation interface {
- 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
- }
|