relation

package
v0.0.0-...-ad531c1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

@Author: Hexiaoming 2023/2/15

Index

Constants

View Source
const (
	AppName = "relation"
)

Variables

View Source
var (
	ActionType_name = map[int32]string{
		0: "AGAIN_FOLLOW",
		1: "FOLLOW_ACTION",
		2: "UN_FOLLOW_ACTION",
	}
	ActionType_value = map[string]int32{
		"AGAIN_FOLLOW":     0,
		"FOLLOW_ACTION":    1,
		"UN_FOLLOW_ACTION": 2,
	}
)

Enum value maps for ActionType.

View Source
var (
	CountType_name = map[int32]string{
		0: "FOLLOW",
		1: "FOLLOWER",
		2: "ALL",
	}
	CountType_value = map[string]int32{
		"FOLLOW":   0,
		"FOLLOWER": 1,
		"ALL":      2,
	}
)

Enum value maps for CountType.

View Source
var File_apps_relation_pb_relation_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dousheng.relation.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FollowList",
			Handler:    _Service_FollowList_Handler,
		},
		{
			MethodName: "FollowerList",
			Handler:    _Service_FollowerList_Handler,
		},
		{
			MethodName: "ListCount",
			Handler:    _Service_ListCount_Handler,
		},
		{
			MethodName: "FriendList",
			Handler:    _Service_FriendList_Handler,
		},
		{
			MethodName: "FollowAction",
			Handler:    _Service_FollowAction_Handler,
		},
		{
			MethodName: "IsFollower",
			Handler:    _Service_IsFollower_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/relation/pb/relation.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 ActionType

type ActionType int32

操作类型、顺便做 flag

const (
	// 取消关注后,再次关注
	ActionType_AGAIN_FOLLOW ActionType = 0
	// 关注
	ActionType_FOLLOW_ACTION ActionType = 1
	// 取消关注
	ActionType_UN_FOLLOW_ACTION ActionType = 2
)

func (ActionType) Descriptor

func (ActionType) Descriptor() protoreflect.EnumDescriptor

func (ActionType) Enum

func (x ActionType) Enum() *ActionType

func (ActionType) EnumDescriptor deprecated

func (ActionType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ActionType.Descriptor instead.

func (ActionType) Number

func (x ActionType) Number() protoreflect.EnumNumber

func (ActionType) String

func (x ActionType) String() string

func (ActionType) Type

type CountType

type CountType int32

查询的数量类型

const (
	// 关注数
	CountType_FOLLOW CountType = 0
	// 粉丝数
	CountType_FOLLOWER CountType = 1
	// 两个都查出来
	CountType_ALL CountType = 2
)

func (CountType) Descriptor

func (CountType) Descriptor() protoreflect.EnumDescriptor

func (CountType) Enum

func (x CountType) Enum() *CountType

func (CountType) EnumDescriptor deprecated

func (CountType) EnumDescriptor() ([]byte, []int)

Deprecated: Use CountType.Descriptor instead.

func (CountType) Number

func (x CountType) Number() protoreflect.EnumNumber

func (CountType) String

func (x CountType) String() string

func (CountType) Type

type FollowActionRequest

type FollowActionRequest struct {

	// 被关注或被取关的用户ID
	// @gotags: json:"to_user_id" form:"to_user_id" validate:"required" binding:"required"
	ToUserId int64 `` /* 135-byte string literal not displayed */
	// 用户鉴权Token
	// @gotags: json:"token" form:"token" binding:"required"
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token" form:"token" binding:"required"`
	// 操作类型
	// @gotags: json:"action_type" form:"action_type" validate:"required" binding:"required"
	ActionType ActionType `` /* 174-byte string literal not displayed */
	// contains filtered or unexported fields
}

关注操作 的接口请求 model

func NewFollowActionRequest

func NewFollowActionRequest() *FollowActionRequest

func (*FollowActionRequest) Descriptor deprecated

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

Deprecated: Use FollowActionRequest.ProtoReflect.Descriptor instead.

func (*FollowActionRequest) GetActionType

func (x *FollowActionRequest) GetActionType() ActionType

func (*FollowActionRequest) GetToUserId

func (x *FollowActionRequest) GetToUserId() int64

func (*FollowActionRequest) GetToken

func (x *FollowActionRequest) GetToken() string

func (*FollowActionRequest) ProtoMessage

func (*FollowActionRequest) ProtoMessage()

func (*FollowActionRequest) ProtoReflect

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

func (*FollowActionRequest) Reset

func (x *FollowActionRequest) Reset()

func (*FollowActionRequest) String

func (x *FollowActionRequest) String() string

func (*FollowActionRequest) Validate

func (r *FollowActionRequest) Validate() error

Validate 关注操作 相关

type FollowActionResponse

type FollowActionResponse struct {

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

关注操作 的接口相应 model

func NewFollowActionResponse

func NewFollowActionResponse() *FollowActionResponse

func (*FollowActionResponse) Descriptor deprecated

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

Deprecated: Use FollowActionResponse.ProtoReflect.Descriptor instead.

func (*FollowActionResponse) GetMate

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

func (*FollowActionResponse) ProtoMessage

func (*FollowActionResponse) ProtoMessage()

func (*FollowActionResponse) ProtoReflect

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

func (*FollowActionResponse) Reset

func (x *FollowActionResponse) Reset()

func (*FollowActionResponse) String

func (x *FollowActionResponse) String() string

type FollowListRequest

type FollowListRequest struct {

	// 用户ID
	// @gotags: json:"user_id" form:"user_id" validate:"required" binding:"required"
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id" form:"user_id" validate:"required" binding:"required"`
	// 用户鉴权Token
	// @gotags: json:"token" form:"token" binding:"required"
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token" form:"token" binding:"required"`
	// contains filtered or unexported fields
}

获取关系列表 的接口请求 model

func NewFollowListRequest

func NewFollowListRequest() *FollowListRequest

func (*FollowListRequest) Descriptor deprecated

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

Deprecated: Use FollowListRequest.ProtoReflect.Descriptor instead.

func (*FollowListRequest) GetToken

func (x *FollowListRequest) GetToken() string

func (*FollowListRequest) GetUserId

func (x *FollowListRequest) GetUserId() int64

func (*FollowListRequest) ProtoMessage

func (*FollowListRequest) ProtoMessage()

func (*FollowListRequest) ProtoReflect

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

func (*FollowListRequest) Reset

func (x *FollowListRequest) Reset()

func (*FollowListRequest) String

func (x *FollowListRequest) String() string

func (*FollowListRequest) Validate

func (r *FollowListRequest) Validate() error

Validate 获取关注列表 相关

type FollowListResponse

type FollowListResponse struct {

	// 关注列表用户信息
	// @gotags: json:"user_list"
	UserList []*user.User `protobuf:"bytes,1,rep,name=user_list,json=userList,proto3" json:"user_list"`
	// contains filtered or unexported fields
}

获取关注列表 的接口响应 model

func NewFollowListResponse

func NewFollowListResponse() *FollowListResponse

func (*FollowListResponse) Descriptor deprecated

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

Deprecated: Use FollowListResponse.ProtoReflect.Descriptor instead.

func (*FollowListResponse) GetUserList

func (x *FollowListResponse) GetUserList() []*user.User

func (*FollowListResponse) ProtoMessage

func (*FollowListResponse) ProtoMessage()

func (*FollowListResponse) ProtoReflect

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

func (*FollowListResponse) Reset

func (x *FollowListResponse) Reset()

func (*FollowListResponse) String

func (x *FollowListResponse) String() string

type FollowerListRequest

type FollowerListRequest struct {

	// 用户ID
	// @gotags: json:"user_id" form:"user_id" validate:"required" binding:"required"
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id" form:"user_id" validate:"required" binding:"required"`
	// 用户鉴权Token
	// @gotags: json:"token" form:"token" binding:"required"
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token" form:"token" binding:"required"`
	// contains filtered or unexported fields
}

获取粉丝列表 的接口请求 model

func NewFollowerListRequest

func NewFollowerListRequest() *FollowerListRequest

func (*FollowerListRequest) Descriptor deprecated

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

Deprecated: Use FollowerListRequest.ProtoReflect.Descriptor instead.

func (*FollowerListRequest) GetToken

func (x *FollowerListRequest) GetToken() string

func (*FollowerListRequest) GetUserId

func (x *FollowerListRequest) GetUserId() int64

func (*FollowerListRequest) ProtoMessage

func (*FollowerListRequest) ProtoMessage()

func (*FollowerListRequest) ProtoReflect

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

func (*FollowerListRequest) Reset

func (x *FollowerListRequest) Reset()

func (*FollowerListRequest) String

func (x *FollowerListRequest) String() string

func (*FollowerListRequest) Validate

func (r *FollowerListRequest) Validate() error

Validate 获取粉丝列表 相关

type FollowerListResponse

type FollowerListResponse struct {

	// 关注列表用户信息
	// @gotags: json:"user_list"
	UserList []*user.User `protobuf:"bytes,1,rep,name=user_list,json=userList,proto3" json:"user_list"`
	// contains filtered or unexported fields
}

获取粉丝列表 的接口响应 model

func NewFollowerListResponse

func NewFollowerListResponse() *FollowerListResponse

func (*FollowerListResponse) Descriptor deprecated

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

Deprecated: Use FollowerListResponse.ProtoReflect.Descriptor instead.

func (*FollowerListResponse) GetUserList

func (x *FollowerListResponse) GetUserList() []*user.User

func (*FollowerListResponse) ProtoMessage

func (*FollowerListResponse) ProtoMessage()

func (*FollowerListResponse) ProtoReflect

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

func (*FollowerListResponse) Reset

func (x *FollowerListResponse) Reset()

func (*FollowerListResponse) String

func (x *FollowerListResponse) String() string

type FriendListRequest

type FriendListRequest struct {

	// 用户ID
	// @gotags: json:"user_id" form:"user_id" validate:"required" binding:"required"
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id" form:"user_id" validate:"required" binding:"required"`
	// 用户鉴权Token
	// @gotags: json:"token" form:"token" binding:"required"
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token" form:"token" binding:"required"`
	// contains filtered or unexported fields
}

获取用户好友列表 的接口请求 model

func NewFriendListRequest

func NewFriendListRequest() *FriendListRequest

func (*FriendListRequest) Descriptor deprecated

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

Deprecated: Use FriendListRequest.ProtoReflect.Descriptor instead.

func (*FriendListRequest) GetToken

func (x *FriendListRequest) GetToken() string

func (*FriendListRequest) GetUserId

func (x *FriendListRequest) GetUserId() int64

func (*FriendListRequest) ProtoMessage

func (*FriendListRequest) ProtoMessage()

func (*FriendListRequest) ProtoReflect

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

func (*FriendListRequest) Reset

func (x *FriendListRequest) Reset()

func (*FriendListRequest) String

func (x *FriendListRequest) String() string

func (*FriendListRequest) Validate

func (r *FriendListRequest) Validate() error

Validate 获取好友列表 相关

type FriendListResponse

type FriendListResponse struct {

	// 用户好友列表
	// @gotags: json:"user_list"
	UserList []*UserFriend `protobuf:"bytes,1,rep,name=user_list,json=userList,proto3" json:"user_list"`
	// contains filtered or unexported fields
}

获取用户好友列表 的接口响应 model

func NewFriendListResponse

func NewFriendListResponse() *FriendListResponse

func (*FriendListResponse) Descriptor deprecated

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

Deprecated: Use FriendListResponse.ProtoReflect.Descriptor instead.

func (*FriendListResponse) GetUserList

func (x *FriendListResponse) GetUserList() []*UserFriend

func (*FriendListResponse) ProtoMessage

func (*FriendListResponse) ProtoMessage()

func (*FriendListResponse) ProtoReflect

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

func (*FriendListResponse) Reset

func (x *FriendListResponse) Reset()

func (*FriendListResponse) String

func (x *FriendListResponse) String() string

type IsFollowerResponse

type IsFollowerResponse struct {

	// 是我的粉丝
	// @gotags: json:"my_follower"
	MyFollower bool `protobuf:"varint,1,opt,name=my_follower,json=myFollower,proto3" json:"my_follower"`
	// contains filtered or unexported fields
}

func NewIsFollowerResponse

func NewIsFollowerResponse() *IsFollowerResponse

func (*IsFollowerResponse) Descriptor deprecated

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

Deprecated: Use IsFollowerResponse.ProtoReflect.Descriptor instead.

func (*IsFollowerResponse) GetMyFollower

func (x *IsFollowerResponse) GetMyFollower() bool

func (*IsFollowerResponse) ProtoMessage

func (*IsFollowerResponse) ProtoMessage()

func (*IsFollowerResponse) ProtoReflect

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

func (*IsFollowerResponse) Reset

func (x *IsFollowerResponse) Reset()

func (*IsFollowerResponse) String

func (x *IsFollowerResponse) String() string

type ListCountRequest

type ListCountRequest 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"`
	// 查询的总数类型
	// @gotags: json:"type"
	Type CountType `protobuf:"varint,2,opt,name=type,proto3,enum=dousheng.relation.CountType" json:"type"`
	// contains filtered or unexported fields
}

func NewListCountRequest

func NewListCountRequest() *ListCountRequest

func (*ListCountRequest) Descriptor deprecated

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

Deprecated: Use ListCountRequest.ProtoReflect.Descriptor instead.

func (*ListCountRequest) GetType

func (x *ListCountRequest) GetType() CountType

func (*ListCountRequest) GetUserId

func (x *ListCountRequest) GetUserId() int64

func (*ListCountRequest) ProtoMessage

func (*ListCountRequest) ProtoMessage()

func (*ListCountRequest) ProtoReflect

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

func (*ListCountRequest) Reset

func (x *ListCountRequest) Reset()

func (*ListCountRequest) String

func (x *ListCountRequest) String() string

func (*ListCountRequest) Validate

func (r *ListCountRequest) Validate() error

type ListCountResponse

type ListCountResponse struct {

	// 关注数量
	// @gotags: json:"follow_count"
	FollowCount int64 `protobuf:"varint,1,opt,name=follow_count,json=followCount,proto3" json:"follow_count"`
	// 粉丝数量
	// @gotags: json:"follower_count"
	FollowerCount int64 `protobuf:"varint,2,opt,name=follower_count,json=followerCount,proto3" json:"follower_count"`
	// contains filtered or unexported fields
}

用于获取总数、[粉丝数量、关注数量]

func NewListCountResponse

func NewListCountResponse() *ListCountResponse

func (*ListCountResponse) Descriptor deprecated

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

Deprecated: Use ListCountResponse.ProtoReflect.Descriptor instead.

func (*ListCountResponse) GetFollowCount

func (x *ListCountResponse) GetFollowCount() int64

func (*ListCountResponse) GetFollowerCount

func (x *ListCountResponse) GetFollowerCount() int64

func (*ListCountResponse) ProtoMessage

func (*ListCountResponse) ProtoMessage()

func (*ListCountResponse) ProtoReflect

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

func (*ListCountResponse) Reset

func (x *ListCountResponse) Reset()

func (*ListCountResponse) String

func (x *ListCountResponse) String() string

type ServiceClient

type ServiceClient interface {
	// 获取关注列表
	FollowList(ctx context.Context, in *FollowListRequest, opts ...grpc.CallOption) (*FollowListResponse, error)
	// 获取粉丝列表
	FollowerList(ctx context.Context, in *FollowerListRequest, opts ...grpc.CallOption) (*FollowerListResponse, error)
	// 获取 1、关注数量 2、粉丝数量
	ListCount(ctx context.Context, in *ListCountRequest, opts ...grpc.CallOption) (*ListCountResponse, error)
	// 获取好友列表
	FriendList(ctx context.Context, in *FriendListRequest, opts ...grpc.CallOption) (*FriendListResponse, error)
	// 关注操作-关注与取关
	FollowAction(ctx context.Context, in *FollowActionRequest, opts ...grpc.CallOption) (*FollowActionResponse, error)
	// 查看用户是否是我的粉丝
	IsFollower(ctx context.Context, in *UserFollowPo, opts ...grpc.CallOption) (*IsFollowerResponse, 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 {
	// 获取关注列表
	FollowList(context.Context, *FollowListRequest) (*FollowListResponse, error)
	// 获取粉丝列表
	FollowerList(context.Context, *FollowerListRequest) (*FollowerListResponse, error)
	// 获取 1、关注数量 2、粉丝数量
	ListCount(context.Context, *ListCountRequest) (*ListCountResponse, error)
	// 获取好友列表
	FriendList(context.Context, *FriendListRequest) (*FriendListResponse, error)
	// 关注操作-关注与取关
	FollowAction(context.Context, *FollowActionRequest) (*FollowActionResponse, error)
	// 查看用户是否是我的粉丝
	IsFollower(context.Context, *UserFollowPo) (*IsFollowerResponse, 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) FollowAction

func (UnimplementedServiceServer) FollowList

func (UnimplementedServiceServer) FollowerList

func (UnimplementedServiceServer) FriendList

func (UnimplementedServiceServer) IsFollower

func (UnimplementedServiceServer) ListCount

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.

type UserFollowPo

type UserFollowPo struct {

	// 用户ID
	// @gotags: json:"user_id" gorm:"user_id"
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id" gorm:"user_id"`
	// 关注用户ID
	// @gotags: json:"follow_id" gorm:"follow_id"
	FollowId int64 `protobuf:"varint,2,opt,name=follow_id,json=followId,proto3" json:"follow_id" gorm:"follow_id"`
	// 关注用户状态, 0:取关, 1:关注
	// @gotags: json:"follow_flag" gorm:"follow_flag"
	FollowFlag ActionType `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

用户关注表:与数据库对应的PO对象

func NewUserFollowPo

func NewUserFollowPo() *UserFollowPo

func (*UserFollowPo) Descriptor deprecated

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

Deprecated: Use UserFollowPo.ProtoReflect.Descriptor instead.

func (*UserFollowPo) GetFollowFlag

func (x *UserFollowPo) GetFollowFlag() ActionType

func (*UserFollowPo) GetFollowId

func (x *UserFollowPo) GetFollowId() int64

func (*UserFollowPo) GetUserId

func (x *UserFollowPo) GetUserId() int64

func (*UserFollowPo) ProtoMessage

func (*UserFollowPo) ProtoMessage()

func (*UserFollowPo) ProtoReflect

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

func (*UserFollowPo) Reset

func (x *UserFollowPo) Reset()

func (*UserFollowPo) String

func (x *UserFollowPo) String() string

func (*UserFollowPo) TableName

func (*UserFollowPo) TableName() string

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

type UserFollowerPo

type UserFollowerPo struct {

	// 用户ID
	// @gotags: json:"user_id" gorm:"user_id"
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id" gorm:"user_id"`
	// 粉丝用户ID
	// @gotags: json:"follower_id" gorm:"follower_id"
	FollowerId int64 `protobuf:"varint,2,opt,name=follower_id,json=followerId,proto3" json:"follower_id" gorm:"follower_id"`
	// 粉丝用户状态, 0:取关, 1:关注
	// @gotags: json:"follower_flag" gorm:"follower_flag"
	FollowerFlag ActionType `` /* 143-byte string literal not displayed */
	// contains filtered or unexported fields
}

用户粉丝表:与数据库对应的PO对象

func NewUserFollowerPo

func NewUserFollowerPo() *UserFollowerPo

NewUserFollowerPo TODO

func (*UserFollowerPo) Descriptor deprecated

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

Deprecated: Use UserFollowerPo.ProtoReflect.Descriptor instead.

func (*UserFollowerPo) GetFollowerFlag

func (x *UserFollowerPo) GetFollowerFlag() ActionType

func (*UserFollowerPo) GetFollowerId

func (x *UserFollowerPo) GetFollowerId() int64

func (*UserFollowerPo) GetUserId

func (x *UserFollowerPo) GetUserId() int64

func (*UserFollowerPo) ProtoMessage

func (*UserFollowerPo) ProtoMessage()

func (*UserFollowerPo) ProtoReflect

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

func (*UserFollowerPo) Reset

func (x *UserFollowerPo) Reset()

func (*UserFollowerPo) String

func (x *UserFollowerPo) String() string

func (*UserFollowerPo) TableName

func (*UserFollowerPo) TableName() string

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

type UserFriend

type UserFriend struct {

	// @gotags: json:"id"
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` // 用户id
	// @gotags: json:"name"
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` // 用户名称
	// @gotags: json:"follow_count"
	FollowCount *int64 `protobuf:"varint,3,opt,name=follow_count,json=followCount,proto3,oneof" json:"follow_count"` // 关注总数
	// @gotags: json:"follower_count"
	FollowerCount *int64 `protobuf:"varint,4,opt,name=follower_count,json=followerCount,proto3,oneof" json:"follower_count"` // 粉丝总数
	// @gotags: json:"is_follow"
	IsFollow bool `protobuf:"varint,5,opt,name=is_follow,json=isFollow,proto3" json:"is_follow"` // true-已关注,false-未关
	// @gotags: json:"avatar"
	Avatar *string `protobuf:"bytes,6,opt,name=avatar,proto3,oneof" json:"avatar"` //用户头像
	// @gotags: json:"background_image"
	BackgroundImage *string `protobuf:"bytes,7,opt,name=background_image,json=backgroundImage,proto3,oneof" json:"background_image"` //用户个人页顶部大图
	// @gotags: json:"signature"
	Signature *string `protobuf:"bytes,8,opt,name=signature,proto3,oneof" json:"signature"` //个人简介
	// @gotags: json:"total_favorited"
	TotalFavorited *int64 `protobuf:"varint,9,opt,name=total_favorited,json=totalFavorited,proto3,oneof" json:"total_favorited"` //获赞数量
	// @gotags: json:"work_count"
	WorkCount *int64 `protobuf:"varint,10,opt,name=work_count,json=workCount,proto3,oneof" json:"work_count"` //作品数
	// @gotags: json:"favorite_count"
	FavoriteCount *int64 `protobuf:"varint,11,opt,name=favorite_count,json=favoriteCount,proto3,oneof" json:"favorite_count"` //点赞数量
	// 和该好友聊天的最新消息
	// @gotags: json:"message"
	Message string `protobuf:"bytes,12,opt,name=message,proto3" json:"message"`
	// message消息的类型, 0 => 当前请求用户接收的消息, 1 => 当前请求用户发送的消息
	// @gotags: json:"msg_type"
	MsgType int64 `protobuf:"varint,13,opt,name=msgType,proto3" json:"msg_type"`
	// contains filtered or unexported fields
}

用户好友 [因为官方的接口需要将字段平铺返回,所以不能直接组合 user.User,只能 copy一份...]

func NewUserFriend

func NewUserFriend(toUser *user.User) *UserFriend

func (*UserFriend) Descriptor deprecated

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

Deprecated: Use UserFriend.ProtoReflect.Descriptor instead.

func (*UserFriend) GetAvatar

func (x *UserFriend) GetAvatar() string

func (*UserFriend) GetBackgroundImage

func (x *UserFriend) GetBackgroundImage() string

func (*UserFriend) GetFavoriteCount

func (x *UserFriend) GetFavoriteCount() int64

func (*UserFriend) GetFollowCount

func (x *UserFriend) GetFollowCount() int64

func (*UserFriend) GetFollowerCount

func (x *UserFriend) GetFollowerCount() int64

func (*UserFriend) GetId

func (x *UserFriend) GetId() int64

func (*UserFriend) GetIsFollow

func (x *UserFriend) GetIsFollow() bool

func (*UserFriend) GetMessage

func (x *UserFriend) GetMessage() string

func (*UserFriend) GetMsgType

func (x *UserFriend) GetMsgType() int64

func (*UserFriend) GetName

func (x *UserFriend) GetName() string

func (*UserFriend) GetSignature

func (x *UserFriend) GetSignature() string

func (*UserFriend) GetTotalFavorited

func (x *UserFriend) GetTotalFavorited() int64

func (*UserFriend) GetWorkCount

func (x *UserFriend) GetWorkCount() int64

func (*UserFriend) ProtoMessage

func (*UserFriend) ProtoMessage()

func (*UserFriend) ProtoReflect

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

func (*UserFriend) Reset

func (x *UserFriend) Reset()

func (*UserFriend) String

func (x *UserFriend) String() string

Directories

Path Synopsis
@Author: Hexiaoming 2023/2/18
@Author: Hexiaoming 2023/2/18

Jump to

Keyboard shortcuts

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