favorite

package
v0.0.0-...-8c4fe33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "favorite"
)

Variables

View Source
var File_apps_favorite_pb_favorite_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dousheng.interaction.favorite.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FavoriteAction",
			Handler:    _Service_FavoriteAction_Handler,
		},
		{
			MethodName: "FavoriteList",
			Handler:    _Service_FavoriteList_Handler,
		},
		{
			MethodName: "IsFavorite",
			Handler:    _Service_IsFavorite_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/favorite/pb/favorite.proto",
}

Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type FavoriteActionRequest

type FavoriteActionRequest struct {

	// 用户ID
	// @gotags: json:"login_user_id" validate:"required"
	LoginUserId int64 `protobuf:"varint,1,opt,name=login_user_id,json=loginUserId,proto3" json:"login_user_id" validate:"required"`
	// 视频id
	// @gotags: json:"video_id" validate:"required"
	VideoId int64 `protobuf:"varint,2,opt,name=video_id,json=videoId,proto3" json:"video_id" validate:"required"`
	// 1-点赞 2-取消点赞
	// @gotags: json:"action_type" validate:"required"
	ActionType int64 `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3" json:"action_type" validate:"required"`
	// contains filtered or unexported fields
}

定义 点赞/取消点赞 请求体 POST

func NewFavoriteActionRequest

func NewFavoriteActionRequest() *FavoriteActionRequest

func (*FavoriteActionRequest) Descriptor deprecated

func (*FavoriteActionRequest) Descriptor() ([]byte, []int)

Deprecated: Use FavoriteActionRequest.ProtoReflect.Descriptor instead.

func (*FavoriteActionRequest) GetActionType

func (x *FavoriteActionRequest) GetActionType() int64

func (*FavoriteActionRequest) GetLoginUserId

func (x *FavoriteActionRequest) GetLoginUserId() int64

func (*FavoriteActionRequest) GetVideoId

func (x *FavoriteActionRequest) GetVideoId() int64

func (*FavoriteActionRequest) ProtoMessage

func (*FavoriteActionRequest) ProtoMessage()

func (*FavoriteActionRequest) ProtoReflect

func (x *FavoriteActionRequest) ProtoReflect() protoreflect.Message

func (*FavoriteActionRequest) Reset

func (x *FavoriteActionRequest) Reset()

func (*FavoriteActionRequest) String

func (x *FavoriteActionRequest) String() string

func (*FavoriteActionRequest) Validate

func (r *FavoriteActionRequest) Validate() error

Validate 点赞/取消赞 参数校验

type FavoriteActionResponse

type FavoriteActionResponse struct {

	// 可以携带一些额外属性
	// @gotags: json:"mate"
	Mate map[string]string `` /* 139-byte string literal not displayed */
	// contains filtered or unexported fields
}

点赞操作响应体

func NewFavoriteActionResponse

func NewFavoriteActionResponse() *FavoriteActionResponse

NewFavoriteActionResponse 创建视频点赞响应体

func (*FavoriteActionResponse) Descriptor deprecated

func (*FavoriteActionResponse) Descriptor() ([]byte, []int)

Deprecated: Use FavoriteActionResponse.ProtoReflect.Descriptor instead.

func (*FavoriteActionResponse) GetMate

func (x *FavoriteActionResponse) GetMate() map[string]string

func (*FavoriteActionResponse) ProtoMessage

func (*FavoriteActionResponse) ProtoMessage()

func (*FavoriteActionResponse) ProtoReflect

func (x *FavoriteActionResponse) ProtoReflect() protoreflect.Message

func (*FavoriteActionResponse) Reset

func (x *FavoriteActionResponse) Reset()

func (*FavoriteActionResponse) String

func (x *FavoriteActionResponse) String() string

type FavoriteListRequest

type FavoriteListRequest struct {

	// 用户id
	// @gotags: json:"user_id" validate:"required"
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id" validate:"required"`
	// contains filtered or unexported fields
}

获取喜欢列表请求体

func NewFavoriteListRequest

func NewFavoriteListRequest() *FavoriteListRequest

func (*FavoriteListRequest) Descriptor deprecated

func (*FavoriteListRequest) Descriptor() ([]byte, []int)

Deprecated: Use FavoriteListRequest.ProtoReflect.Descriptor instead.

func (*FavoriteListRequest) GetUserId

func (x *FavoriteListRequest) GetUserId() int64

func (*FavoriteListRequest) ProtoMessage

func (*FavoriteListRequest) ProtoMessage()

func (*FavoriteListRequest) ProtoReflect

func (x *FavoriteListRequest) ProtoReflect() protoreflect.Message

func (*FavoriteListRequest) Reset

func (x *FavoriteListRequest) Reset()

func (*FavoriteListRequest) String

func (x *FavoriteListRequest) String() string

func (*FavoriteListRequest) Validate

func (r *FavoriteListRequest) Validate() error

Validate 获取喜欢视频列表 参数校验

type FavoriteListResponse

type FavoriteListResponse struct {

	// 用户点赞视频列表
	// @gotags: json:"video_list"
	VideoList []*video.Video `protobuf:"bytes,5,rep,name=video_list,json=videoList,proto3" json:"video_list"`
	// contains filtered or unexported fields
}

获取喜欢列表响应体

func NewFavoriteListResponse

func NewFavoriteListResponse() *FavoriteListResponse

NewFavoriteListResponse 获取视频列表响应体

func (*FavoriteListResponse) Descriptor deprecated

func (*FavoriteListResponse) Descriptor() ([]byte, []int)

Deprecated: Use FavoriteListResponse.ProtoReflect.Descriptor instead.

func (*FavoriteListResponse) GetVideoList

func (x *FavoriteListResponse) GetVideoList() []*video.Video

func (*FavoriteListResponse) ProtoMessage

func (*FavoriteListResponse) ProtoMessage()

func (*FavoriteListResponse) ProtoReflect

func (x *FavoriteListResponse) ProtoReflect() protoreflect.Message

func (*FavoriteListResponse) Reset

func (x *FavoriteListResponse) Reset()

func (*FavoriteListResponse) String

func (x *FavoriteListResponse) String() string

type FavoritePo

type FavoritePo struct {

	// 用户ID
	// @gotags: json:"user_id"
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id"`
	// 视频ID
	// @gotags: json:"video_id"
	VideoId int64 `protobuf:"varint,2,opt,name=video_id,json=videoId,proto3" json:"video_id"`
	// contains filtered or unexported fields
}

点赞信息Module

func NewFavoritePo

func NewFavoritePo() *FavoritePo

NewFavoritePo 构建Po

func (*FavoritePo) Descriptor deprecated

func (*FavoritePo) Descriptor() ([]byte, []int)

Deprecated: Use FavoritePo.ProtoReflect.Descriptor instead.

func (*FavoritePo) GetUserId

func (x *FavoritePo) GetUserId() int64

func (*FavoritePo) GetVideoId

func (x *FavoritePo) GetVideoId() int64

func (*FavoritePo) ProtoMessage

func (*FavoritePo) ProtoMessage()

func (*FavoritePo) ProtoReflect

func (x *FavoritePo) ProtoReflect() protoreflect.Message

func (*FavoritePo) Reset

func (x *FavoritePo) Reset()

func (*FavoritePo) String

func (x *FavoritePo) String() string

func (*FavoritePo) TableName

func (*FavoritePo) TableName() string

TableName 指明表名 -> gorm 参数映射

type IsFavoriteRequest

type IsFavoriteRequest struct {

	// 视频ID
	// @gotags: json:"video_ids"
	VideoIds int64 `protobuf:"varint,1,opt,name=video_ids,json=videoIds,proto3" json:"video_ids"`
	// 用户 ID
	// @gotags: json:"user_id"
	UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id"`
	// contains filtered or unexported fields
}

用户是否点赞此视频

func (*IsFavoriteRequest) Descriptor deprecated

func (*IsFavoriteRequest) Descriptor() ([]byte, []int)

Deprecated: Use IsFavoriteRequest.ProtoReflect.Descriptor instead.

func (*IsFavoriteRequest) GetUserId

func (x *IsFavoriteRequest) GetUserId() int64

func (*IsFavoriteRequest) GetVideoIds

func (x *IsFavoriteRequest) GetVideoIds() int64

func (*IsFavoriteRequest) ProtoMessage

func (*IsFavoriteRequest) ProtoMessage()

func (*IsFavoriteRequest) ProtoReflect

func (x *IsFavoriteRequest) ProtoReflect() protoreflect.Message

func (*IsFavoriteRequest) Reset

func (x *IsFavoriteRequest) Reset()

func (*IsFavoriteRequest) String

func (x *IsFavoriteRequest) String() string

type IsFavoriteResponse

type IsFavoriteResponse struct {

	// 是否点赞
	// @gotags: json:"is_favorite"
	IsFavorite bool `protobuf:"varint,1,opt,name=is_favorite,json=isFavorite,proto3" json:"is_favorite"`
	// contains filtered or unexported fields
}

func (*IsFavoriteResponse) Descriptor deprecated

func (*IsFavoriteResponse) Descriptor() ([]byte, []int)

Deprecated: Use IsFavoriteResponse.ProtoReflect.Descriptor instead.

func (*IsFavoriteResponse) GetIsFavorite

func (x *IsFavoriteResponse) GetIsFavorite() bool

func (*IsFavoriteResponse) ProtoMessage

func (*IsFavoriteResponse) ProtoMessage()

func (*IsFavoriteResponse) ProtoReflect

func (x *IsFavoriteResponse) ProtoReflect() protoreflect.Message

func (*IsFavoriteResponse) Reset

func (x *IsFavoriteResponse) Reset()

func (*IsFavoriteResponse) String

func (x *IsFavoriteResponse) String() string

type ServiceClient

type ServiceClient interface {
	// 点赞/取消点赞 操作
	FavoriteAction(ctx context.Context, in *FavoriteActionRequest, opts ...grpc.CallOption) (*FavoriteActionResponse, error)
	// 获取喜欢列表
	FavoriteList(ctx context.Context, in *FavoriteListRequest, opts ...grpc.CallOption) (*FavoriteListResponse, error)
	// 用户是否点赞
	IsFavorite(ctx context.Context, in *IsFavoriteRequest, opts ...grpc.CallOption) (*IsFavoriteResponse, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	// 点赞/取消点赞 操作
	FavoriteAction(context.Context, *FavoriteActionRequest) (*FavoriteActionResponse, error)
	// 获取喜欢列表
	FavoriteList(context.Context, *FavoriteListRequest) (*FavoriteListResponse, error)
	// 用户是否点赞
	IsFavorite(context.Context, *IsFavoriteRequest) (*IsFavoriteResponse, error)
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) FavoriteAction

func (UnimplementedServiceServer) FavoriteList

func (UnimplementedServiceServer) IsFavorite

type UnsafeServiceServer

type UnsafeServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL