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 SSOAuth } 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 SSOAuth interface { Auth(ctx context.Context, auth *operationPb.UserAuth) (*operationPb.SystemToken, error) GetUserInfo(ctx context.Context, token string) (*operationPb.UserAuth, error) }