Documentation
¶
Index ¶
- Variables
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) FastRead(buf []byte, _type int8, number int32) (offset int, err error)
- func (x *User) FastWrite(buf []byte) (offset int)
- func (x *User) GetAvatar() string
- func (x *User) GetBackgroundImage() string
- func (x *User) GetFavoriteCount() int64
- func (x *User) GetFollowCount() int64
- func (x *User) GetFollowerCount() int64
- func (x *User) GetId() int64
- func (x *User) GetIsFollow() bool
- func (x *User) GetName() string
- func (x *User) GetSignature() string
- func (x *User) GetTotalFavorited() int64
- func (x *User) GetWorkCount() int64
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) Size() (n int)
- func (x *User) String() string
- type UserLoRegRequest
- func (*UserLoRegRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserLoRegRequest) FastRead(buf []byte, _type int8, number int32) (offset int, err error)
- func (x *UserLoRegRequest) FastWrite(buf []byte) (offset int)
- func (x *UserLoRegRequest) GetPassword() string
- func (x *UserLoRegRequest) GetUsername() string
- func (*UserLoRegRequest) ProtoMessage()
- func (x *UserLoRegRequest) ProtoReflect() protoreflect.Message
- func (x *UserLoRegRequest) Reset()
- func (x *UserLoRegRequest) Size() (n int)
- func (x *UserLoRegRequest) String() string
- type UserLoRegResponse
- func (*UserLoRegResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserLoRegResponse) FastRead(buf []byte, _type int8, number int32) (offset int, err error)
- func (x *UserLoRegResponse) FastWrite(buf []byte) (offset int)
- func (x *UserLoRegResponse) GetStatusCode() int32
- func (x *UserLoRegResponse) GetStatusMsg() string
- func (x *UserLoRegResponse) GetToken() string
- func (x *UserLoRegResponse) GetUserId() int64
- func (*UserLoRegResponse) ProtoMessage()
- func (x *UserLoRegResponse) ProtoReflect() protoreflect.Message
- func (x *UserLoRegResponse) Reset()
- func (x *UserLoRegResponse) Size() (n int)
- func (x *UserLoRegResponse) String() string
- type UserRequest
- func (*UserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserRequest) FastRead(buf []byte, _type int8, number int32) (offset int, err error)
- func (x *UserRequest) FastWrite(buf []byte) (offset int)
- func (x *UserRequest) GetToken() string
- func (x *UserRequest) GetUserId() int64
- func (*UserRequest) ProtoMessage()
- func (x *UserRequest) ProtoReflect() protoreflect.Message
- func (x *UserRequest) Reset()
- func (x *UserRequest) Size() (n int)
- func (x *UserRequest) String() string
- type UserResponse
- func (*UserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserResponse) FastRead(buf []byte, _type int8, number int32) (offset int, err error)
- func (x *UserResponse) FastWrite(buf []byte) (offset int)
- func (x *UserResponse) GetStatusCode() int32
- func (x *UserResponse) GetStatusMsg() string
- func (x *UserResponse) GetUser() *User
- func (*UserResponse) ProtoMessage()
- func (x *UserResponse) ProtoReflect() protoreflect.Message
- func (x *UserResponse) Reset()
- func (x *UserResponse) Size() (n int)
- func (x *UserResponse) String() string
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var File_user_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` // 用户id Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` // 用户名称 FollowCount int64 `protobuf:"varint,3,opt,name=follow_count,json=followCount,proto3" json:"follow_count"` // 关注总数 FollowerCount int64 `protobuf:"varint,4,opt,name=follower_count,json=followerCount,proto3" json:"follower_count"` // 粉丝总数 IsFollow bool `protobuf:"varint,5,opt,name=is_follow,json=isFollow,proto3" json:"is_follow"` // true-已关注,false-未关注 Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar"` //用户头像 BackgroundImage string `protobuf:"bytes,7,opt,name=background_image,json=backgroundImage,proto3" json:"background_image"` //用户个人页顶部大图 Signature string `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature"` //个人简介 TotalFavorited int64 `protobuf:"varint,9,opt,name=total_favorited,json=totalFavorited,proto3" json:"total_favorited"` //获赞数量 WorkCount int64 `protobuf:"varint,10,opt,name=work_count,json=workCount,proto3" json:"work_count"` //作品数量 FavoriteCount int64 `protobuf:"varint,11,opt,name=favorite_count,json=favoriteCount,proto3" json:"favorite_count"` //点赞数量 // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetBackgroundImage ¶
func (*User) GetFavoriteCount ¶
func (*User) GetFollowCount ¶
func (*User) GetFollowerCount ¶
func (*User) GetIsFollow ¶
func (*User) GetSignature ¶
func (*User) GetTotalFavorited ¶
func (*User) GetWorkCount ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserLoRegRequest ¶
type UserLoRegRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username" query:"username" vd:"len($) > 0 && len($) <= 32"` // 用户名 Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password" query:"password" vd:"len($) > 0 && len($) <= 32"` // 密码 // contains filtered or unexported fields }
用户登录和注册的message是一样的,所以尝试将文档中的IDL合并在一起。
func (*UserLoRegRequest) Descriptor
deprecated
func (*UserLoRegRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserLoRegRequest.ProtoReflect.Descriptor instead.
func (*UserLoRegRequest) FastWrite ¶
func (x *UserLoRegRequest) FastWrite(buf []byte) (offset int)
func (*UserLoRegRequest) GetPassword ¶
func (x *UserLoRegRequest) GetPassword() string
func (*UserLoRegRequest) GetUsername ¶
func (x *UserLoRegRequest) GetUsername() string
func (*UserLoRegRequest) ProtoMessage ¶
func (*UserLoRegRequest) ProtoMessage()
func (*UserLoRegRequest) ProtoReflect ¶
func (x *UserLoRegRequest) ProtoReflect() protoreflect.Message
func (*UserLoRegRequest) Reset ¶
func (x *UserLoRegRequest) Reset()
func (*UserLoRegRequest) Size ¶
func (x *UserLoRegRequest) Size() (n int)
func (*UserLoRegRequest) String ¶
func (x *UserLoRegRequest) String() string
type UserLoRegResponse ¶
type UserLoRegResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code"` // 状态码,0-成功,其他值-失败 StatusMsg string `protobuf:"bytes,2,opt,name=status_msg,json=statusMsg,proto3" json:"status_msg,omitempty"` // 返回状态描述 UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 用户id Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token"` // 用户鉴权token // contains filtered or unexported fields }
func (*UserLoRegResponse) Descriptor
deprecated
func (*UserLoRegResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserLoRegResponse.ProtoReflect.Descriptor instead.
func (*UserLoRegResponse) FastWrite ¶
func (x *UserLoRegResponse) FastWrite(buf []byte) (offset int)
func (*UserLoRegResponse) GetStatusCode ¶
func (x *UserLoRegResponse) GetStatusCode() int32
func (*UserLoRegResponse) GetStatusMsg ¶
func (x *UserLoRegResponse) GetStatusMsg() string
func (*UserLoRegResponse) GetToken ¶
func (x *UserLoRegResponse) GetToken() string
func (*UserLoRegResponse) GetUserId ¶
func (x *UserLoRegResponse) GetUserId() int64
func (*UserLoRegResponse) ProtoMessage ¶
func (*UserLoRegResponse) ProtoMessage()
func (*UserLoRegResponse) ProtoReflect ¶
func (x *UserLoRegResponse) ProtoReflect() protoreflect.Message
func (*UserLoRegResponse) Reset ¶
func (x *UserLoRegResponse) Reset()
func (*UserLoRegResponse) Size ¶
func (x *UserLoRegResponse) Size() (n int)
func (*UserLoRegResponse) String ¶
func (x *UserLoRegResponse) String() string
type UserRequest ¶
type UserRequest struct { UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty" query:"user_id"` // 用户id Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty" query:"token"` // 用户鉴权token // contains filtered or unexported fields }
func (*UserRequest) Descriptor
deprecated
func (*UserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.
func (*UserRequest) FastWrite ¶
func (x *UserRequest) FastWrite(buf []byte) (offset int)
func (*UserRequest) GetToken ¶
func (x *UserRequest) GetToken() string
func (*UserRequest) GetUserId ¶
func (x *UserRequest) GetUserId() int64
func (*UserRequest) ProtoMessage ¶
func (*UserRequest) ProtoMessage()
func (*UserRequest) ProtoReflect ¶
func (x *UserRequest) ProtoReflect() protoreflect.Message
func (*UserRequest) Reset ¶
func (x *UserRequest) Reset()
func (*UserRequest) Size ¶
func (x *UserRequest) Size() (n int)
func (*UserRequest) String ¶
func (x *UserRequest) String() string
type UserResponse ¶
type UserResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code"` // 状态码,0-成功,其他值-失败 StatusMsg string `protobuf:"bytes,2,opt,name=status_msg,json=statusMsg,proto3" json:"status_msg"` // 返回状态描述 User *User `protobuf:"bytes,3,opt,name=user,proto3" json:"user"` // 用户信息 // contains filtered or unexported fields }
func (*UserResponse) Descriptor
deprecated
func (*UserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.
func (*UserResponse) FastWrite ¶
func (x *UserResponse) FastWrite(buf []byte) (offset int)
func (*UserResponse) GetStatusCode ¶
func (x *UserResponse) GetStatusCode() int32
func (*UserResponse) GetStatusMsg ¶
func (x *UserResponse) GetStatusMsg() string
func (*UserResponse) GetUser ¶
func (x *UserResponse) GetUser() *User
func (*UserResponse) ProtoMessage ¶
func (*UserResponse) ProtoMessage()
func (*UserResponse) ProtoReflect ¶
func (x *UserResponse) ProtoReflect() protoreflect.Message
func (*UserResponse) Reset ¶
func (x *UserResponse) Reset()
func (*UserResponse) Size ¶
func (x *UserResponse) Size() (n int)
func (*UserResponse) String ¶
func (x *UserResponse) String() string
type UserService ¶
type UserService interface { GetUser(ctx context.Context, req *UserRequest) (res *UserResponse, err error) UserLogin(ctx context.Context, req *UserLoRegRequest) (res *UserLoRegResponse, err error) UserRegister(ctx context.Context, req *UserLoRegRequest) (res *UserLoRegResponse, err error) }
Click to show internal directories.
Click to hide internal directories.