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.
 
 
 
 
 
 

828 lines
21 KiB

// Code generated by Kitex v0.4.4. DO NOT EDIT.
package relationservice
import (
"context"
"fmt"
relation "github.com/TremblingV5/DouTok/kitex_gen/relation"
client "github.com/cloudwego/kitex/client"
kitex "github.com/cloudwego/kitex/pkg/serviceinfo"
streaming "github.com/cloudwego/kitex/pkg/streaming"
proto "google.golang.org/protobuf/proto"
)
func serviceInfo() *kitex.ServiceInfo {
return relationServiceServiceInfo
}
var relationServiceServiceInfo = NewServiceInfo()
func NewServiceInfo() *kitex.ServiceInfo {
serviceName := "RelationService"
handlerType := (*relation.RelationService)(nil)
methods := map[string]kitex.MethodInfo{
"RelationAction": kitex.NewMethodInfo(relationActionHandler, newRelationActionArgs, newRelationActionResult, false),
"RelationFollowList": kitex.NewMethodInfo(relationFollowListHandler, newRelationFollowListArgs, newRelationFollowListResult, false),
"RelationFollowerList": kitex.NewMethodInfo(relationFollowerListHandler, newRelationFollowerListArgs, newRelationFollowerListResult, false),
"RelationFriendList": kitex.NewMethodInfo(relationFriendListHandler, newRelationFriendListArgs, newRelationFriendListResult, false),
"GetFollowCount": kitex.NewMethodInfo(getFollowCountHandler, newGetFollowCountArgs, newGetFollowCountResult, false),
}
extra := map[string]interface{}{
"PackageName": "relation",
}
svcInfo := &kitex.ServiceInfo{
ServiceName: serviceName,
HandlerType: handlerType,
Methods: methods,
PayloadCodec: kitex.Protobuf,
KiteXGenVersion: "v0.4.4",
Extra: extra,
}
return svcInfo
}
func relationActionHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
switch s := arg.(type) {
case *streaming.Args:
st := s.Stream
req := new(relation.DouyinRelationActionRequest)
if err := st.RecvMsg(req); err != nil {
return err
}
resp, err := handler.(relation.RelationService).RelationAction(ctx, req)
if err != nil {
return err
}
if err := st.SendMsg(resp); err != nil {
return err
}
case *RelationActionArgs:
success, err := handler.(relation.RelationService).RelationAction(ctx, s.Req)
if err != nil {
return err
}
realResult := result.(*RelationActionResult)
realResult.Success = success
}
return nil
}
func newRelationActionArgs() interface{} {
return &RelationActionArgs{}
}
func newRelationActionResult() interface{} {
return &RelationActionResult{}
}
type RelationActionArgs struct {
Req *relation.DouyinRelationActionRequest
}
func (p *RelationActionArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetReq() {
p.Req = new(relation.DouyinRelationActionRequest)
}
return p.Req.FastRead(buf, _type, number)
}
func (p *RelationActionArgs) FastWrite(buf []byte) (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.FastWrite(buf)
}
func (p *RelationActionArgs) Size() (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.Size()
}
func (p *RelationActionArgs) Marshal(out []byte) ([]byte, error) {
if !p.IsSetReq() {
return out, fmt.Errorf("No req in RelationActionArgs")
}
return proto.Marshal(p.Req)
}
func (p *RelationActionArgs) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationActionRequest)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Req = msg
return nil
}
var RelationActionArgs_Req_DEFAULT *relation.DouyinRelationActionRequest
func (p *RelationActionArgs) GetReq() *relation.DouyinRelationActionRequest {
if !p.IsSetReq() {
return RelationActionArgs_Req_DEFAULT
}
return p.Req
}
func (p *RelationActionArgs) IsSetReq() bool {
return p.Req != nil
}
type RelationActionResult struct {
Success *relation.DouyinRelationActionResponse
}
var RelationActionResult_Success_DEFAULT *relation.DouyinRelationActionResponse
func (p *RelationActionResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetSuccess() {
p.Success = new(relation.DouyinRelationActionResponse)
}
return p.Success.FastRead(buf, _type, number)
}
func (p *RelationActionResult) FastWrite(buf []byte) (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.FastWrite(buf)
}
func (p *RelationActionResult) Size() (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.Size()
}
func (p *RelationActionResult) Marshal(out []byte) ([]byte, error) {
if !p.IsSetSuccess() {
return out, fmt.Errorf("No req in RelationActionResult")
}
return proto.Marshal(p.Success)
}
func (p *RelationActionResult) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationActionResponse)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Success = msg
return nil
}
func (p *RelationActionResult) GetSuccess() *relation.DouyinRelationActionResponse {
if !p.IsSetSuccess() {
return RelationActionResult_Success_DEFAULT
}
return p.Success
}
func (p *RelationActionResult) SetSuccess(x interface{}) {
p.Success = x.(*relation.DouyinRelationActionResponse)
}
func (p *RelationActionResult) IsSetSuccess() bool {
return p.Success != nil
}
func relationFollowListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
switch s := arg.(type) {
case *streaming.Args:
st := s.Stream
req := new(relation.DouyinRelationFollowListRequest)
if err := st.RecvMsg(req); err != nil {
return err
}
resp, err := handler.(relation.RelationService).RelationFollowList(ctx, req)
if err != nil {
return err
}
if err := st.SendMsg(resp); err != nil {
return err
}
case *RelationFollowListArgs:
success, err := handler.(relation.RelationService).RelationFollowList(ctx, s.Req)
if err != nil {
return err
}
realResult := result.(*RelationFollowListResult)
realResult.Success = success
}
return nil
}
func newRelationFollowListArgs() interface{} {
return &RelationFollowListArgs{}
}
func newRelationFollowListResult() interface{} {
return &RelationFollowListResult{}
}
type RelationFollowListArgs struct {
Req *relation.DouyinRelationFollowListRequest
}
func (p *RelationFollowListArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetReq() {
p.Req = new(relation.DouyinRelationFollowListRequest)
}
return p.Req.FastRead(buf, _type, number)
}
func (p *RelationFollowListArgs) FastWrite(buf []byte) (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.FastWrite(buf)
}
func (p *RelationFollowListArgs) Size() (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.Size()
}
func (p *RelationFollowListArgs) Marshal(out []byte) ([]byte, error) {
if !p.IsSetReq() {
return out, fmt.Errorf("No req in RelationFollowListArgs")
}
return proto.Marshal(p.Req)
}
func (p *RelationFollowListArgs) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationFollowListRequest)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Req = msg
return nil
}
var RelationFollowListArgs_Req_DEFAULT *relation.DouyinRelationFollowListRequest
func (p *RelationFollowListArgs) GetReq() *relation.DouyinRelationFollowListRequest {
if !p.IsSetReq() {
return RelationFollowListArgs_Req_DEFAULT
}
return p.Req
}
func (p *RelationFollowListArgs) IsSetReq() bool {
return p.Req != nil
}
type RelationFollowListResult struct {
Success *relation.DouyinRelationFollowListResponse
}
var RelationFollowListResult_Success_DEFAULT *relation.DouyinRelationFollowListResponse
func (p *RelationFollowListResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetSuccess() {
p.Success = new(relation.DouyinRelationFollowListResponse)
}
return p.Success.FastRead(buf, _type, number)
}
func (p *RelationFollowListResult) FastWrite(buf []byte) (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.FastWrite(buf)
}
func (p *RelationFollowListResult) Size() (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.Size()
}
func (p *RelationFollowListResult) Marshal(out []byte) ([]byte, error) {
if !p.IsSetSuccess() {
return out, fmt.Errorf("No req in RelationFollowListResult")
}
return proto.Marshal(p.Success)
}
func (p *RelationFollowListResult) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationFollowListResponse)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Success = msg
return nil
}
func (p *RelationFollowListResult) GetSuccess() *relation.DouyinRelationFollowListResponse {
if !p.IsSetSuccess() {
return RelationFollowListResult_Success_DEFAULT
}
return p.Success
}
func (p *RelationFollowListResult) SetSuccess(x interface{}) {
p.Success = x.(*relation.DouyinRelationFollowListResponse)
}
func (p *RelationFollowListResult) IsSetSuccess() bool {
return p.Success != nil
}
func relationFollowerListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
switch s := arg.(type) {
case *streaming.Args:
st := s.Stream
req := new(relation.DouyinRelationFollowerListRequest)
if err := st.RecvMsg(req); err != nil {
return err
}
resp, err := handler.(relation.RelationService).RelationFollowerList(ctx, req)
if err != nil {
return err
}
if err := st.SendMsg(resp); err != nil {
return err
}
case *RelationFollowerListArgs:
success, err := handler.(relation.RelationService).RelationFollowerList(ctx, s.Req)
if err != nil {
return err
}
realResult := result.(*RelationFollowerListResult)
realResult.Success = success
}
return nil
}
func newRelationFollowerListArgs() interface{} {
return &RelationFollowerListArgs{}
}
func newRelationFollowerListResult() interface{} {
return &RelationFollowerListResult{}
}
type RelationFollowerListArgs struct {
Req *relation.DouyinRelationFollowerListRequest
}
func (p *RelationFollowerListArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetReq() {
p.Req = new(relation.DouyinRelationFollowerListRequest)
}
return p.Req.FastRead(buf, _type, number)
}
func (p *RelationFollowerListArgs) FastWrite(buf []byte) (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.FastWrite(buf)
}
func (p *RelationFollowerListArgs) Size() (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.Size()
}
func (p *RelationFollowerListArgs) Marshal(out []byte) ([]byte, error) {
if !p.IsSetReq() {
return out, fmt.Errorf("No req in RelationFollowerListArgs")
}
return proto.Marshal(p.Req)
}
func (p *RelationFollowerListArgs) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationFollowerListRequest)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Req = msg
return nil
}
var RelationFollowerListArgs_Req_DEFAULT *relation.DouyinRelationFollowerListRequest
func (p *RelationFollowerListArgs) GetReq() *relation.DouyinRelationFollowerListRequest {
if !p.IsSetReq() {
return RelationFollowerListArgs_Req_DEFAULT
}
return p.Req
}
func (p *RelationFollowerListArgs) IsSetReq() bool {
return p.Req != nil
}
type RelationFollowerListResult struct {
Success *relation.DouyinRelationFollowerListResponse
}
var RelationFollowerListResult_Success_DEFAULT *relation.DouyinRelationFollowerListResponse
func (p *RelationFollowerListResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetSuccess() {
p.Success = new(relation.DouyinRelationFollowerListResponse)
}
return p.Success.FastRead(buf, _type, number)
}
func (p *RelationFollowerListResult) FastWrite(buf []byte) (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.FastWrite(buf)
}
func (p *RelationFollowerListResult) Size() (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.Size()
}
func (p *RelationFollowerListResult) Marshal(out []byte) ([]byte, error) {
if !p.IsSetSuccess() {
return out, fmt.Errorf("No req in RelationFollowerListResult")
}
return proto.Marshal(p.Success)
}
func (p *RelationFollowerListResult) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationFollowerListResponse)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Success = msg
return nil
}
func (p *RelationFollowerListResult) GetSuccess() *relation.DouyinRelationFollowerListResponse {
if !p.IsSetSuccess() {
return RelationFollowerListResult_Success_DEFAULT
}
return p.Success
}
func (p *RelationFollowerListResult) SetSuccess(x interface{}) {
p.Success = x.(*relation.DouyinRelationFollowerListResponse)
}
func (p *RelationFollowerListResult) IsSetSuccess() bool {
return p.Success != nil
}
func relationFriendListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
switch s := arg.(type) {
case *streaming.Args:
st := s.Stream
req := new(relation.DouyinRelationFriendListRequest)
if err := st.RecvMsg(req); err != nil {
return err
}
resp, err := handler.(relation.RelationService).RelationFriendList(ctx, req)
if err != nil {
return err
}
if err := st.SendMsg(resp); err != nil {
return err
}
case *RelationFriendListArgs:
success, err := handler.(relation.RelationService).RelationFriendList(ctx, s.Req)
if err != nil {
return err
}
realResult := result.(*RelationFriendListResult)
realResult.Success = success
}
return nil
}
func newRelationFriendListArgs() interface{} {
return &RelationFriendListArgs{}
}
func newRelationFriendListResult() interface{} {
return &RelationFriendListResult{}
}
type RelationFriendListArgs struct {
Req *relation.DouyinRelationFriendListRequest
}
func (p *RelationFriendListArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetReq() {
p.Req = new(relation.DouyinRelationFriendListRequest)
}
return p.Req.FastRead(buf, _type, number)
}
func (p *RelationFriendListArgs) FastWrite(buf []byte) (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.FastWrite(buf)
}
func (p *RelationFriendListArgs) Size() (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.Size()
}
func (p *RelationFriendListArgs) Marshal(out []byte) ([]byte, error) {
if !p.IsSetReq() {
return out, fmt.Errorf("No req in RelationFriendListArgs")
}
return proto.Marshal(p.Req)
}
func (p *RelationFriendListArgs) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationFriendListRequest)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Req = msg
return nil
}
var RelationFriendListArgs_Req_DEFAULT *relation.DouyinRelationFriendListRequest
func (p *RelationFriendListArgs) GetReq() *relation.DouyinRelationFriendListRequest {
if !p.IsSetReq() {
return RelationFriendListArgs_Req_DEFAULT
}
return p.Req
}
func (p *RelationFriendListArgs) IsSetReq() bool {
return p.Req != nil
}
type RelationFriendListResult struct {
Success *relation.DouyinRelationFriendListResponse
}
var RelationFriendListResult_Success_DEFAULT *relation.DouyinRelationFriendListResponse
func (p *RelationFriendListResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetSuccess() {
p.Success = new(relation.DouyinRelationFriendListResponse)
}
return p.Success.FastRead(buf, _type, number)
}
func (p *RelationFriendListResult) FastWrite(buf []byte) (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.FastWrite(buf)
}
func (p *RelationFriendListResult) Size() (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.Size()
}
func (p *RelationFriendListResult) Marshal(out []byte) ([]byte, error) {
if !p.IsSetSuccess() {
return out, fmt.Errorf("No req in RelationFriendListResult")
}
return proto.Marshal(p.Success)
}
func (p *RelationFriendListResult) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationFriendListResponse)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Success = msg
return nil
}
func (p *RelationFriendListResult) GetSuccess() *relation.DouyinRelationFriendListResponse {
if !p.IsSetSuccess() {
return RelationFriendListResult_Success_DEFAULT
}
return p.Success
}
func (p *RelationFriendListResult) SetSuccess(x interface{}) {
p.Success = x.(*relation.DouyinRelationFriendListResponse)
}
func (p *RelationFriendListResult) IsSetSuccess() bool {
return p.Success != nil
}
func getFollowCountHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
switch s := arg.(type) {
case *streaming.Args:
st := s.Stream
req := new(relation.DouyinRelationCountRequest)
if err := st.RecvMsg(req); err != nil {
return err
}
resp, err := handler.(relation.RelationService).GetFollowCount(ctx, req)
if err != nil {
return err
}
if err := st.SendMsg(resp); err != nil {
return err
}
case *GetFollowCountArgs:
success, err := handler.(relation.RelationService).GetFollowCount(ctx, s.Req)
if err != nil {
return err
}
realResult := result.(*GetFollowCountResult)
realResult.Success = success
}
return nil
}
func newGetFollowCountArgs() interface{} {
return &GetFollowCountArgs{}
}
func newGetFollowCountResult() interface{} {
return &GetFollowCountResult{}
}
type GetFollowCountArgs struct {
Req *relation.DouyinRelationCountRequest
}
func (p *GetFollowCountArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetReq() {
p.Req = new(relation.DouyinRelationCountRequest)
}
return p.Req.FastRead(buf, _type, number)
}
func (p *GetFollowCountArgs) FastWrite(buf []byte) (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.FastWrite(buf)
}
func (p *GetFollowCountArgs) Size() (n int) {
if !p.IsSetReq() {
return 0
}
return p.Req.Size()
}
func (p *GetFollowCountArgs) Marshal(out []byte) ([]byte, error) {
if !p.IsSetReq() {
return out, fmt.Errorf("No req in GetFollowCountArgs")
}
return proto.Marshal(p.Req)
}
func (p *GetFollowCountArgs) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationCountRequest)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Req = msg
return nil
}
var GetFollowCountArgs_Req_DEFAULT *relation.DouyinRelationCountRequest
func (p *GetFollowCountArgs) GetReq() *relation.DouyinRelationCountRequest {
if !p.IsSetReq() {
return GetFollowCountArgs_Req_DEFAULT
}
return p.Req
}
func (p *GetFollowCountArgs) IsSetReq() bool {
return p.Req != nil
}
type GetFollowCountResult struct {
Success *relation.DouyinRelationCountResponse
}
var GetFollowCountResult_Success_DEFAULT *relation.DouyinRelationCountResponse
func (p *GetFollowCountResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
if !p.IsSetSuccess() {
p.Success = new(relation.DouyinRelationCountResponse)
}
return p.Success.FastRead(buf, _type, number)
}
func (p *GetFollowCountResult) FastWrite(buf []byte) (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.FastWrite(buf)
}
func (p *GetFollowCountResult) Size() (n int) {
if !p.IsSetSuccess() {
return 0
}
return p.Success.Size()
}
func (p *GetFollowCountResult) Marshal(out []byte) ([]byte, error) {
if !p.IsSetSuccess() {
return out, fmt.Errorf("No req in GetFollowCountResult")
}
return proto.Marshal(p.Success)
}
func (p *GetFollowCountResult) Unmarshal(in []byte) error {
msg := new(relation.DouyinRelationCountResponse)
if err := proto.Unmarshal(in, msg); err != nil {
return err
}
p.Success = msg
return nil
}
func (p *GetFollowCountResult) GetSuccess() *relation.DouyinRelationCountResponse {
if !p.IsSetSuccess() {
return GetFollowCountResult_Success_DEFAULT
}
return p.Success
}
func (p *GetFollowCountResult) SetSuccess(x interface{}) {
p.Success = x.(*relation.DouyinRelationCountResponse)
}
func (p *GetFollowCountResult) IsSetSuccess() bool {
return p.Success != nil
}
type kClient struct {
c client.Client
}
func newServiceClient(c client.Client) *kClient {
return &kClient{
c: c,
}
}
func (p *kClient) RelationAction(ctx context.Context, Req *relation.DouyinRelationActionRequest) (r *relation.DouyinRelationActionResponse, err error) {
var _args RelationActionArgs
_args.Req = Req
var _result RelationActionResult
if err = p.c.Call(ctx, "RelationAction", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}
func (p *kClient) RelationFollowList(ctx context.Context, Req *relation.DouyinRelationFollowListRequest) (r *relation.DouyinRelationFollowListResponse, err error) {
var _args RelationFollowListArgs
_args.Req = Req
var _result RelationFollowListResult
if err = p.c.Call(ctx, "RelationFollowList", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}
func (p *kClient) RelationFollowerList(ctx context.Context, Req *relation.DouyinRelationFollowerListRequest) (r *relation.DouyinRelationFollowerListResponse, err error) {
var _args RelationFollowerListArgs
_args.Req = Req
var _result RelationFollowerListResult
if err = p.c.Call(ctx, "RelationFollowerList", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}
func (p *kClient) RelationFriendList(ctx context.Context, Req *relation.DouyinRelationFriendListRequest) (r *relation.DouyinRelationFriendListResponse, err error) {
var _args RelationFriendListArgs
_args.Req = Req
var _result RelationFriendListResult
if err = p.c.Call(ctx, "RelationFriendList", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}
func (p *kClient) GetFollowCount(ctx context.Context, Req *relation.DouyinRelationCountRequest) (r *relation.DouyinRelationCountResponse, err error) {
var _args GetFollowCountArgs
_args.Req = Req
var _result GetFollowCountResult
if err = p.c.Call(ctx, "GetFollowCount", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}