Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Comment
- func (*Comment) Descriptor() ([]byte, []int)deprecated
- func (x *Comment) GetContent() string
- func (x *Comment) GetCreateDate() string
- func (x *Comment) GetId() int64
- func (x *Comment) GetUserId() int64
- func (*Comment) ProtoMessage()
- func (x *Comment) ProtoReflect() protoreflect.Message
- func (x *Comment) Reset()
- func (x *Comment) String() string
- type CommentActionRequest
- func (*CommentActionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CommentActionRequest) GetActionType() int64
- func (x *CommentActionRequest) GetCommentId() int64
- func (x *CommentActionRequest) GetCommentText() string
- func (x *CommentActionRequest) GetLoginUserId() int64
- func (x *CommentActionRequest) GetVideoId() int64
- func (*CommentActionRequest) ProtoMessage()
- func (x *CommentActionRequest) ProtoReflect() protoreflect.Message
- func (x *CommentActionRequest) Reset()
- func (x *CommentActionRequest) String() string
- func (c *CommentActionRequest) Validate() error
- type CommentActionResponse
- func (*CommentActionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CommentActionResponse) GetComment() *Comment
- func (*CommentActionResponse) ProtoMessage()
- func (x *CommentActionResponse) ProtoReflect() protoreflect.Message
- func (x *CommentActionResponse) Reset()
- func (x *CommentActionResponse) String() string
- type CommentPo
- func (*CommentPo) Descriptor() ([]byte, []int)deprecated
- func (x *CommentPo) GetContent() string
- func (x *CommentPo) GetCreateDate() string
- func (x *CommentPo) GetId() int64
- func (x *CommentPo) GetUserId() int64
- func (x *CommentPo) GetVideoId() int64
- func (*CommentPo) ProtoMessage()
- func (x *CommentPo) ProtoReflect() protoreflect.Message
- func (x *CommentPo) Reset()
- func (x *CommentPo) String() string
- func (*CommentPo) TableName() string
- type GetCommentListRequest
- func (*GetCommentListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetCommentListRequest) GetVideoId() int64
- func (*GetCommentListRequest) ProtoMessage()
- func (x *GetCommentListRequest) ProtoReflect() protoreflect.Message
- func (x *GetCommentListRequest) Reset()
- func (x *GetCommentListRequest) String() string
- func (r *GetCommentListRequest) Validate() error
- type GetCommentListResponse
- func (*GetCommentListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCommentListResponse) GetCommentList() []*Comment
- func (*GetCommentListResponse) ProtoMessage()
- func (x *GetCommentListResponse) ProtoReflect() protoreflect.Message
- func (x *GetCommentListResponse) Reset()
- func (x *GetCommentListResponse) String() string
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const (
AppName = "comment"
)
Variables ¶
var File_apps_comment_pb_comment_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dousheng.interaction.comment.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CommentAction", Handler: _Service_CommentAction_Handler, }, { MethodName: "GetCommentList", Handler: _Service_GetCommentList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/comment/pb/comment.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 Comment ¶
type Comment struct { // @gotags: json:"id" Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` // 评论ID // @gotags: json:"user_id" UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id"` // 评论者ID // @gotags: json:"content" Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content"` // 评论内容 // @gotags: json:"create_date" CreateDate string `protobuf:"bytes,4,opt,name=create_date,json=createDate,proto3" json:"create_date"` // 评论日期 格式 mm-dd // contains filtered or unexported fields }
评论实体
func (*Comment) Descriptor
deprecated
func (*Comment) GetContent ¶
func (*Comment) GetCreateDate ¶
func (*Comment) ProtoMessage ¶
func (*Comment) ProtoMessage()
func (*Comment) ProtoReflect ¶
func (x *Comment) ProtoReflect() protoreflect.Message
type CommentActionRequest ¶
type CommentActionRequest struct { // 评论者ID[登录用户的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"` // 用户填写的评论内容,在action_type=1时候使用 // @gotags: json:"comment_text" CommentText string `protobuf:"bytes,4,opt,name=comment_text,json=commentText,proto3" json:"comment_text"` // action_type = 2时候使用 // @gotags: json:"comment_id" CommentId int64 `protobuf:"varint,5,opt,name=comment_id,json=commentId,proto3" json:"comment_id"` // contains filtered or unexported fields }
发表评论请求体
func NewCommentActionRequest ¶
func NewCommentActionRequest() *CommentActionRequest
func (*CommentActionRequest) Descriptor
deprecated
func (*CommentActionRequest) Descriptor() ([]byte, []int)
Deprecated: Use CommentActionRequest.ProtoReflect.Descriptor instead.
func (*CommentActionRequest) GetActionType ¶
func (x *CommentActionRequest) GetActionType() int64
func (*CommentActionRequest) GetCommentId ¶
func (x *CommentActionRequest) GetCommentId() int64
func (*CommentActionRequest) GetCommentText ¶
func (x *CommentActionRequest) GetCommentText() string
func (*CommentActionRequest) GetLoginUserId ¶
func (x *CommentActionRequest) GetLoginUserId() int64
func (*CommentActionRequest) GetVideoId ¶
func (x *CommentActionRequest) GetVideoId() int64
func (*CommentActionRequest) ProtoMessage ¶
func (*CommentActionRequest) ProtoMessage()
func (*CommentActionRequest) ProtoReflect ¶
func (x *CommentActionRequest) ProtoReflect() protoreflect.Message
func (*CommentActionRequest) Reset ¶
func (x *CommentActionRequest) Reset()
func (*CommentActionRequest) String ¶
func (x *CommentActionRequest) String() string
func (*CommentActionRequest) Validate ¶
func (c *CommentActionRequest) Validate() error
type CommentActionResponse ¶
type CommentActionResponse struct { // @gotags: json:"comment" Comment *Comment `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment"` // 评论内容 // contains filtered or unexported fields }
评论操作响应体
func NewDefaultCommentActionResponse ¶
func NewDefaultCommentActionResponse() *CommentActionResponse
func (*CommentActionResponse) Descriptor
deprecated
func (*CommentActionResponse) Descriptor() ([]byte, []int)
Deprecated: Use CommentActionResponse.ProtoReflect.Descriptor instead.
func (*CommentActionResponse) GetComment ¶
func (x *CommentActionResponse) GetComment() *Comment
func (*CommentActionResponse) ProtoMessage ¶
func (*CommentActionResponse) ProtoMessage()
func (*CommentActionResponse) ProtoReflect ¶
func (x *CommentActionResponse) ProtoReflect() protoreflect.Message
func (*CommentActionResponse) Reset ¶
func (x *CommentActionResponse) Reset()
func (*CommentActionResponse) String ¶
func (x *CommentActionResponse) String() string
type CommentPo ¶
type CommentPo struct { // @gotags: json:"id" Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` // 评论ID // @gotags: json:"user_id" UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id"` // 评论者ID // @gotags: json:"video_id" VideoId int64 `protobuf:"varint,3,opt,name=video_id,json=videoId,proto3" json:"video_id"` // 视频ID // @gotags: json:"content" Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content"` // 评论内容 // @gotags: json:"create_date" CreateDate string `protobuf:"bytes,5,opt,name=create_date,json=createDate,proto3" json:"create_date"` // 评论日期 格式 mm-dd // contains filtered or unexported fields }
func NewDefaultCommentPo ¶
func NewDefaultCommentPo() *CommentPo
func (*CommentPo) Descriptor
deprecated
func (*CommentPo) GetContent ¶
func (*CommentPo) GetCreateDate ¶
func (*CommentPo) GetVideoId ¶
func (*CommentPo) ProtoMessage ¶
func (*CommentPo) ProtoMessage()
func (*CommentPo) ProtoReflect ¶
func (x *CommentPo) ProtoReflect() protoreflect.Message
type GetCommentListRequest ¶
type GetCommentListRequest struct { // @gotags: json:"video_id" validate:"required" VideoId int64 `protobuf:"varint,1,opt,name=video_id,json=videoId,proto3" json:"video_id" validate:"required"` // contains filtered or unexported fields }
获取评论列表请求体
func NewDefaultGetCommentListRequest ¶
func NewDefaultGetCommentListRequest() *GetCommentListRequest
func (*GetCommentListRequest) Descriptor
deprecated
func (*GetCommentListRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentListRequest.ProtoReflect.Descriptor instead.
func (*GetCommentListRequest) GetVideoId ¶
func (x *GetCommentListRequest) GetVideoId() int64
func (*GetCommentListRequest) ProtoMessage ¶
func (*GetCommentListRequest) ProtoMessage()
func (*GetCommentListRequest) ProtoReflect ¶
func (x *GetCommentListRequest) ProtoReflect() protoreflect.Message
func (*GetCommentListRequest) Reset ¶
func (x *GetCommentListRequest) Reset()
func (*GetCommentListRequest) String ¶
func (x *GetCommentListRequest) String() string
func (*GetCommentListRequest) Validate ¶
func (r *GetCommentListRequest) Validate() error
type GetCommentListResponse ¶
type GetCommentListResponse struct { // @gotags: json:"comment_list" CommentList []*Comment `protobuf:"bytes,3,rep,name=comment_list,json=commentList,proto3" json:"comment_list"` // 评论列表 // contains filtered or unexported fields }
获取评论(列表)响应体
func NewDefaultGetCommentListResponse ¶
func NewDefaultGetCommentListResponse() *GetCommentListResponse
func (*GetCommentListResponse) Descriptor
deprecated
func (*GetCommentListResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentListResponse.ProtoReflect.Descriptor instead.
func (*GetCommentListResponse) GetCommentList ¶
func (x *GetCommentListResponse) GetCommentList() []*Comment
func (*GetCommentListResponse) ProtoMessage ¶
func (*GetCommentListResponse) ProtoMessage()
func (*GetCommentListResponse) ProtoReflect ¶
func (x *GetCommentListResponse) ProtoReflect() protoreflect.Message
func (*GetCommentListResponse) Reset ¶
func (x *GetCommentListResponse) Reset()
func (*GetCommentListResponse) String ¶
func (x *GetCommentListResponse) String() string
type ServiceClient ¶
type ServiceClient interface { // 发表评论 CommentAction(ctx context.Context, in *CommentActionRequest, opts ...grpc.CallOption) (*CommentActionResponse, error) // 获取评论 GetCommentList(ctx context.Context, in *GetCommentListRequest, opts ...grpc.CallOption) (*GetCommentListResponse, 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 { // 发表评论 CommentAction(context.Context, *CommentActionRequest) (*CommentActionResponse, error) // 获取评论 GetCommentList(context.Context, *GetCommentListRequest) (*GetCommentListResponse, 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) CommentAction ¶
func (UnimplementedServiceServer) CommentAction(context.Context, *CommentActionRequest) (*CommentActionResponse, error)
func (UnimplementedServiceServer) GetCommentList ¶
func (UnimplementedServiceServer) GetCommentList(context.Context, *GetCommentListRequest) (*GetCommentListResponse, error)
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.