21 lines
439 B
Go
21 lines
439 B
Go
package svc
|
|
|
|
import (
|
|
"juwan-backend/app/search/api/internal/config"
|
|
"juwan-backend/app/search/rpc/searchservice"
|
|
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Config config.Config
|
|
SearchRpc searchservice.SearchService
|
|
}
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
return &ServiceContext{
|
|
Config: c,
|
|
SearchRpc: searchservice.NewSearchService(zrpc.MustNewClient(c.SearchRpcConf)),
|
|
}
|
|
}
|