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.
32 lines
668 B
32 lines
668 B
2 months ago
|
package rpc
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"github.com/TremblingV5/DouTok/pkg/dtviper"
|
||
|
"github.com/TremblingV5/DouTok/pkg/initHelper"
|
||
|
|
||
|
"github.com/TremblingV5/DouTok/kitex_gen/feed"
|
||
|
"github.com/TremblingV5/DouTok/kitex_gen/feed/feedservice"
|
||
|
)
|
||
|
|
||
|
var feedClient feedservice.Client
|
||
|
|
||
|
func InitRelationRpc() {
|
||
|
config := dtviper.ConfigInit("DOUTOK_FEED", "feed")
|
||
|
|
||
|
c, err := feedservice.NewClient(
|
||
|
config.Viper.GetString("Server.Name"),
|
||
|
initHelper.InitRPCClientArgs(config)...,
|
||
|
)
|
||
|
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
feedClient = c
|
||
|
}
|
||
|
|
||
|
func GetVideoById(ctx context.Context, req *feed.VideoIdRequest) (resp *feed.Video, err error) {
|
||
|
return feedClient.GetVideoById(ctx, req)
|
||
|
}
|