topfans/backend/pkg/proto/social/social.triple.go
zerosaturation ca3eeb8b5a feat: 实现我的作品统计接口(点赞/展出)
- 新增 GET /api/v1/me/liked-assets 接口
- 新增 GET /api/v1/me/exhibited-assets 接口
- 新增 GetMyLikedAssets 和 GetMyExhibitedAssets RPC 方法
- 新增 ExhibitedAssetItemDTO 和 GetMyExhibitedAssetsResponseDTO
- 前端新增 getUserLikedAssetsApi 和 getUserExhibitedAssetsApi(暂不实现)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-06 10:51:06 +08:00

501 lines
21 KiB
Go

// Code generated by protoc-gen-triple. DO NOT EDIT.
//
// Source: proto/social.proto
package social
import (
"context"
)
import (
"dubbo.apache.org/dubbo-go/v3"
"dubbo.apache.org/dubbo-go/v3/client"
"dubbo.apache.org/dubbo-go/v3/common"
"dubbo.apache.org/dubbo-go/v3/common/constant"
"dubbo.apache.org/dubbo-go/v3/protocol/triple/triple_protocol"
"dubbo.apache.org/dubbo-go/v3/server"
)
// This is a compile-time assertion to ensure that this generated file and the Triple package
// are compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of Triple newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of Triple or updating the Triple
// version compiled into your binary.
const _ = triple_protocol.IsAtLeastVersion0_1_0
const (
// SocialServiceName is the fully-qualified name of the SocialService service.
SocialServiceName = "topfans.social.SocialService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// SocialServiceSendFriendRequestProcedure is the fully-qualified name of the SocialService's SendFriendRequest RPC.
SocialServiceSendFriendRequestProcedure = "/topfans.social.SocialService/SendFriendRequest"
// SocialServiceGetFriendRequestsProcedure is the fully-qualified name of the SocialService's GetFriendRequests RPC.
SocialServiceGetFriendRequestsProcedure = "/topfans.social.SocialService/GetFriendRequests"
// SocialServiceHandleFriendRequestProcedure is the fully-qualified name of the SocialService's HandleFriendRequest RPC.
SocialServiceHandleFriendRequestProcedure = "/topfans.social.SocialService/HandleFriendRequest"
// SocialServiceGetFriendListProcedure is the fully-qualified name of the SocialService's GetFriendList RPC.
SocialServiceGetFriendListProcedure = "/topfans.social.SocialService/GetFriendList"
// SocialServiceDeleteFriendProcedure is the fully-qualified name of the SocialService's DeleteFriend RPC.
SocialServiceDeleteFriendProcedure = "/topfans.social.SocialService/DeleteFriend"
// SocialServiceSetFriendRemarkProcedure is the fully-qualified name of the SocialService's SetFriendRemark RPC.
SocialServiceSetFriendRemarkProcedure = "/topfans.social.SocialService/SetFriendRemark"
// SocialServiceCheckFriendshipProcedure is the fully-qualified name of the SocialService's CheckFriendship RPC.
SocialServiceCheckFriendshipProcedure = "/topfans.social.SocialService/CheckFriendship"
// SocialServiceGetFriendCountProcedure is the fully-qualified name of the SocialService's GetFriendCount RPC.
SocialServiceGetFriendCountProcedure = "/topfans.social.SocialService/GetFriendCount"
// SocialServiceSearchUserForFriendProcedure is the fully-qualified name of the SocialService's SearchUserForFriend RPC.
SocialServiceSearchUserForFriendProcedure = "/topfans.social.SocialService/SearchUserForFriend"
// SocialServiceGetRandomUsersProcedure is the fully-qualified name of the SocialService's GetRandomUsers RPC.
SocialServiceGetRandomUsersProcedure = "/topfans.social.SocialService/GetRandomUsers"
// SocialServiceGetUsersPagedProcedure is the fully-qualified name of the SocialService's GetUsersPaged RPC.
SocialServiceGetUsersPagedProcedure = "/topfans.social.SocialService/GetUsersPaged"
// SocialServiceLikeAssetProcedure is the fully-qualified name of the SocialService's LikeAsset RPC.
SocialServiceLikeAssetProcedure = "/topfans.social.SocialService/LikeAsset"
// SocialServiceUnlikeAssetProcedure is the fully-qualified name of the SocialService's UnlikeAsset RPC.
SocialServiceUnlikeAssetProcedure = "/topfans.social.SocialService/UnlikeAsset"
// SocialServiceCheckAssetLikeProcedure is the fully-qualified name of the SocialService's CheckAssetLike RPC.
SocialServiceCheckAssetLikeProcedure = "/topfans.social.SocialService/CheckAssetLike"
// SocialServiceGetMyLikedAssetsProcedure is the fully-qualified name of the SocialService's GetMyLikedAssets RPC.
SocialServiceGetMyLikedAssetsProcedure = "/topfans.social.SocialService/GetMyLikedAssets"
)
var (
_ SocialService = (*SocialServiceImpl)(nil)
)
// SocialService is a client for the topfans.social.SocialService service.
type SocialService interface {
SendFriendRequest(ctx context.Context, req *SendFriendRequestRequest, opts ...client.CallOption) (*SendFriendRequestResponse, error)
GetFriendRequests(ctx context.Context, req *GetFriendRequestsRequest, opts ...client.CallOption) (*GetFriendRequestsResponse, error)
HandleFriendRequest(ctx context.Context, req *HandleFriendRequestRequest, opts ...client.CallOption) (*HandleFriendRequestResponse, error)
GetFriendList(ctx context.Context, req *GetFriendListRequest, opts ...client.CallOption) (*GetFriendListResponse, error)
DeleteFriend(ctx context.Context, req *DeleteFriendRequest, opts ...client.CallOption) (*DeleteFriendResponse, error)
SetFriendRemark(ctx context.Context, req *SetFriendRemarkRequest, opts ...client.CallOption) (*SetFriendRemarkResponse, error)
CheckFriendship(ctx context.Context, req *CheckFriendshipRequest, opts ...client.CallOption) (*CheckFriendshipResponse, error)
GetFriendCount(ctx context.Context, req *GetFriendCountRequest, opts ...client.CallOption) (*GetFriendCountResponse, error)
SearchUserForFriend(ctx context.Context, req *SearchUserForFriendRequest, opts ...client.CallOption) (*SearchUserForFriendResponse, error)
GetRandomUsers(ctx context.Context, req *GetRandomUsersRequest, opts ...client.CallOption) (*GetRandomUsersResponse, error)
GetUsersPaged(ctx context.Context, req *GetUsersPagedRequest, opts ...client.CallOption) (*GetUsersPagedResponse, error)
LikeAsset(ctx context.Context, req *LikeAssetRequest, opts ...client.CallOption) (*LikeAssetResponse, error)
UnlikeAsset(ctx context.Context, req *UnlikeAssetRequest, opts ...client.CallOption) (*UnlikeAssetResponse, error)
CheckAssetLike(ctx context.Context, req *CheckAssetLikeRequest, opts ...client.CallOption) (*CheckAssetLikeResponse, error)
GetMyLikedAssets(ctx context.Context, req *GetMyLikedAssetsRequest, opts ...client.CallOption) (*GetMyLikedAssetsResponse, error)
}
// NewSocialService constructs a client for the social.SocialService service.
func NewSocialService(cli *client.Client, opts ...client.ReferenceOption) (SocialService, error) {
conn, err := cli.DialWithInfo("topfans.social.SocialService", &SocialService_ClientInfo, opts...)
if err != nil {
return nil, err
}
return &SocialServiceImpl{
conn: conn,
}, nil
}
func SetConsumerSocialService(srv common.RPCService) {
dubbo.SetConsumerServiceWithInfo(srv, &SocialService_ClientInfo)
}
// SocialServiceImpl implements SocialService.
type SocialServiceImpl struct {
conn *client.Connection
}
func (c *SocialServiceImpl) SendFriendRequest(ctx context.Context, req *SendFriendRequestRequest, opts ...client.CallOption) (*SendFriendRequestResponse, error) {
resp := new(SendFriendRequestResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "SendFriendRequest", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) GetFriendRequests(ctx context.Context, req *GetFriendRequestsRequest, opts ...client.CallOption) (*GetFriendRequestsResponse, error) {
resp := new(GetFriendRequestsResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetFriendRequests", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) HandleFriendRequest(ctx context.Context, req *HandleFriendRequestRequest, opts ...client.CallOption) (*HandleFriendRequestResponse, error) {
resp := new(HandleFriendRequestResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "HandleFriendRequest", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) GetFriendList(ctx context.Context, req *GetFriendListRequest, opts ...client.CallOption) (*GetFriendListResponse, error) {
resp := new(GetFriendListResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetFriendList", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) DeleteFriend(ctx context.Context, req *DeleteFriendRequest, opts ...client.CallOption) (*DeleteFriendResponse, error) {
resp := new(DeleteFriendResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "DeleteFriend", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) SetFriendRemark(ctx context.Context, req *SetFriendRemarkRequest, opts ...client.CallOption) (*SetFriendRemarkResponse, error) {
resp := new(SetFriendRemarkResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "SetFriendRemark", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) CheckFriendship(ctx context.Context, req *CheckFriendshipRequest, opts ...client.CallOption) (*CheckFriendshipResponse, error) {
resp := new(CheckFriendshipResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "CheckFriendship", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) GetFriendCount(ctx context.Context, req *GetFriendCountRequest, opts ...client.CallOption) (*GetFriendCountResponse, error) {
resp := new(GetFriendCountResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetFriendCount", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) SearchUserForFriend(ctx context.Context, req *SearchUserForFriendRequest, opts ...client.CallOption) (*SearchUserForFriendResponse, error) {
resp := new(SearchUserForFriendResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "SearchUserForFriend", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) GetRandomUsers(ctx context.Context, req *GetRandomUsersRequest, opts ...client.CallOption) (*GetRandomUsersResponse, error) {
resp := new(GetRandomUsersResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetRandomUsers", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) GetUsersPaged(ctx context.Context, req *GetUsersPagedRequest, opts ...client.CallOption) (*GetUsersPagedResponse, error) {
resp := new(GetUsersPagedResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetUsersPaged", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) LikeAsset(ctx context.Context, req *LikeAssetRequest, opts ...client.CallOption) (*LikeAssetResponse, error) {
resp := new(LikeAssetResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "LikeAsset", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) UnlikeAsset(ctx context.Context, req *UnlikeAssetRequest, opts ...client.CallOption) (*UnlikeAssetResponse, error) {
resp := new(UnlikeAssetResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "UnlikeAsset", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) CheckAssetLike(ctx context.Context, req *CheckAssetLikeRequest, opts ...client.CallOption) (*CheckAssetLikeResponse, error) {
resp := new(CheckAssetLikeResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "CheckAssetLike", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *SocialServiceImpl) GetMyLikedAssets(ctx context.Context, req *GetMyLikedAssetsRequest, opts ...client.CallOption) (*GetMyLikedAssetsResponse, error) {
resp := new(GetMyLikedAssetsResponse)
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetMyLikedAssets", opts...); err != nil {
return nil, err
}
return resp, nil
}
var SocialService_ClientInfo = client.ClientInfo{
InterfaceName: "topfans.social.SocialService",
MethodNames: []string{"SendFriendRequest", "GetFriendRequests", "HandleFriendRequest", "GetFriendList", "DeleteFriend", "SetFriendRemark", "CheckFriendship", "GetFriendCount", "SearchUserForFriend", "GetRandomUsers", "GetUsersPaged", "LikeAsset", "UnlikeAsset", "CheckAssetLike", "GetMyLikedAssets"},
ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) {
dubboCli := dubboCliRaw.(*SocialServiceImpl)
dubboCli.conn = conn
},
}
// SocialServiceHandler is an implementation of the topfans.social.SocialService service.
type SocialServiceHandler interface {
SendFriendRequest(context.Context, *SendFriendRequestRequest) (*SendFriendRequestResponse, error)
GetFriendRequests(context.Context, *GetFriendRequestsRequest) (*GetFriendRequestsResponse, error)
HandleFriendRequest(context.Context, *HandleFriendRequestRequest) (*HandleFriendRequestResponse, error)
GetFriendList(context.Context, *GetFriendListRequest) (*GetFriendListResponse, error)
DeleteFriend(context.Context, *DeleteFriendRequest) (*DeleteFriendResponse, error)
SetFriendRemark(context.Context, *SetFriendRemarkRequest) (*SetFriendRemarkResponse, error)
CheckFriendship(context.Context, *CheckFriendshipRequest) (*CheckFriendshipResponse, error)
GetFriendCount(context.Context, *GetFriendCountRequest) (*GetFriendCountResponse, error)
SearchUserForFriend(context.Context, *SearchUserForFriendRequest) (*SearchUserForFriendResponse, error)
GetRandomUsers(context.Context, *GetRandomUsersRequest) (*GetRandomUsersResponse, error)
GetUsersPaged(context.Context, *GetUsersPagedRequest) (*GetUsersPagedResponse, error)
LikeAsset(context.Context, *LikeAssetRequest) (*LikeAssetResponse, error)
UnlikeAsset(context.Context, *UnlikeAssetRequest) (*UnlikeAssetResponse, error)
CheckAssetLike(context.Context, *CheckAssetLikeRequest) (*CheckAssetLikeResponse, error)
GetMyLikedAssets(context.Context, *GetMyLikedAssetsRequest) (*GetMyLikedAssetsResponse, error)
}
func RegisterSocialServiceHandler(srv *server.Server, hdlr SocialServiceHandler, opts ...server.ServiceOption) error {
return srv.Register(hdlr, &SocialService_ServiceInfo, opts...)
}
func SetProviderSocialService(srv common.RPCService) {
dubbo.SetProviderServiceWithInfo(srv, &SocialService_ServiceInfo)
}
var SocialService_ServiceInfo = server.ServiceInfo{
InterfaceName: "topfans.social.SocialService",
ServiceType: (*SocialServiceHandler)(nil),
Methods: []server.MethodInfo{
{
Name: "SendFriendRequest",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(SendFriendRequestRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*SendFriendRequestRequest)
res, err := handler.(SocialServiceHandler).SendFriendRequest(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "GetFriendRequests",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(GetFriendRequestsRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*GetFriendRequestsRequest)
res, err := handler.(SocialServiceHandler).GetFriendRequests(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "HandleFriendRequest",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(HandleFriendRequestRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*HandleFriendRequestRequest)
res, err := handler.(SocialServiceHandler).HandleFriendRequest(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "GetFriendList",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(GetFriendListRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*GetFriendListRequest)
res, err := handler.(SocialServiceHandler).GetFriendList(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "DeleteFriend",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(DeleteFriendRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*DeleteFriendRequest)
res, err := handler.(SocialServiceHandler).DeleteFriend(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "SetFriendRemark",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(SetFriendRemarkRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*SetFriendRemarkRequest)
res, err := handler.(SocialServiceHandler).SetFriendRemark(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "CheckFriendship",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(CheckFriendshipRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*CheckFriendshipRequest)
res, err := handler.(SocialServiceHandler).CheckFriendship(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "GetFriendCount",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(GetFriendCountRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*GetFriendCountRequest)
res, err := handler.(SocialServiceHandler).GetFriendCount(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "SearchUserForFriend",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(SearchUserForFriendRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*SearchUserForFriendRequest)
res, err := handler.(SocialServiceHandler).SearchUserForFriend(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "GetRandomUsers",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(GetRandomUsersRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*GetRandomUsersRequest)
res, err := handler.(SocialServiceHandler).GetRandomUsers(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "GetUsersPaged",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(GetUsersPagedRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*GetUsersPagedRequest)
res, err := handler.(SocialServiceHandler).GetUsersPaged(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "LikeAsset",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(LikeAssetRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*LikeAssetRequest)
res, err := handler.(SocialServiceHandler).LikeAsset(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "UnlikeAsset",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(UnlikeAssetRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*UnlikeAssetRequest)
res, err := handler.(SocialServiceHandler).UnlikeAsset(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "CheckAssetLike",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(CheckAssetLikeRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*CheckAssetLikeRequest)
res, err := handler.(SocialServiceHandler).CheckAssetLike(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
{
Name: "GetMyLikedAssets",
Type: constant.CallUnary,
ReqInitFunc: func() interface{} {
return new(GetMyLikedAssetsRequest)
},
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
req := args[0].(*GetMyLikedAssetsRequest)
res, err := handler.(SocialServiceHandler).GetMyLikedAssets(ctx, req)
if err != nil {
return nil, err
}
return triple_protocol.NewResponse(res), nil
},
},
},
}