You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
754 B
31 lines
754 B
package rpc
|
|
|
|
import (
|
|
"context"
|
|
"github.com/TremblingV5/DouTok/kitex_gen/relation"
|
|
"github.com/TremblingV5/DouTok/kitex_gen/relation/relationservice"
|
|
"github.com/TremblingV5/DouTok/pkg/dtviper"
|
|
"github.com/TremblingV5/DouTok/pkg/initHelper"
|
|
)
|
|
|
|
var relationClient relationservice.Client
|
|
|
|
func InitRelationRpc() {
|
|
|
|
config := dtviper.ConfigInit("DOUTOK_RELATION", "relation")
|
|
|
|
c, err := relationservice.NewClient(
|
|
config.Viper.GetString("Server.Name"),
|
|
initHelper.InitRPCClientArgs(config)...,
|
|
)
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
relationClient = c
|
|
}
|
|
|
|
func GetFollowCount(ctx context.Context, req *relation.DouyinRelationCountRequest) (resp *relation.DouyinRelationCountResponse, err error) {
|
|
return relationClient.GetFollowCount(ctx, req)
|
|
}
|
|
|