1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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
- // AsynqClient asynqsvc.Client
- // Cache *redis.Client
- }
- func NewStore(store StoreEntry) KptService {
- return &store
- }
- type KptService interface {
- Operation
- }
- type Operation interface {
- // CreatePastureList 牧场管理相关
- CreatePastureList(ctx context.Context, req []*operationPb.AddPastureRequest) error
- SearchPastureList(ctx context.Context, req *operationPb.SearchPastureRequest) (*model.GroupPastureResponse, error)
- }
|