2023-02-15 01:10:11 +00:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"dubbo.apache.org/dubbo-go/v3/config"
|
2023-02-26 11:57:42 +00:00
|
|
|
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
|
|
|
"github.com/fonchain/fonchain-artistinfo/pb/artwork_query"
|
|
|
|
|
2023-02-24 02:51:35 +00:00
|
|
|
//_ "dubbo.apache.org/dubbo-go/v3/imports"
|
2023-02-23 13:45:59 +00:00
|
|
|
"github.com/fonchain/fonchain-artistinfo/pb/account"
|
2023-02-20 04:51:50 +00:00
|
|
|
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
2023-03-10 09:58:13 +00:00
|
|
|
contractMicroservice "github.com/fonchain/fonchain-artistinfo/pb/contract_microservice"
|
2023-02-15 01:10:11 +00:00
|
|
|
)
|
|
|
|
|
2023-02-23 13:45:59 +00:00
|
|
|
var (
|
2023-03-10 09:58:13 +00:00
|
|
|
GrpcArtistImpl = new(artist.ArtistClientImpl)
|
2023-02-26 11:57:42 +00:00
|
|
|
AccountProvider = new(account.AccountClientImpl)
|
|
|
|
ArtworkImpl = new(artwork.ArtworkClientImpl)
|
|
|
|
ArtworkQueryImpl = new(artwork_query.ArtworkQueryClientImpl)
|
2023-03-14 05:19:20 +00:00
|
|
|
ContractImpl = new(contractMicroservice.ContractClientImpl)
|
2023-02-23 13:45:59 +00:00
|
|
|
)
|
2023-02-15 01:10:11 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
config.SetConsumerService(GrpcArtistImpl)
|
2023-02-24 02:51:35 +00:00
|
|
|
config.SetConsumerService(AccountProvider)
|
2023-02-26 11:57:42 +00:00
|
|
|
config.SetConsumerService(ArtworkImpl)
|
|
|
|
config.SetConsumerService(ArtworkQueryImpl)
|
2023-03-10 09:58:13 +00:00
|
|
|
config.SetConsumerService(ContractImpl)
|
2023-02-24 02:51:35 +00:00
|
|
|
//if os.Args[len(os.Args)-1] == "unit-test" {
|
|
|
|
// _ = os.Setenv(constant.ConfigFileEnvKey, "../../conf/dubbogo.yaml")
|
|
|
|
//}
|
|
|
|
//fmt.Println(os.Getenv(constant.ConfigFileEnvKey))
|
|
|
|
//if err := config.Load(); err != nil {
|
|
|
|
// panic(err)
|
|
|
|
//}
|
2023-02-15 01:10:11 +00:00
|
|
|
}
|