Documentation ¶
Overview ¶
说明:朋友管理
说明:user相关业务逻辑
Index ¶
- type FileInfo
- type LoginRequest
- type LoginResponse
- type RegisterRequest
- type RegisterResponse
- type Service
- func (s *Service) AddFriendByID(myid, friendid string) error
- func (s *Service) Communicate(conn net.Conn) error
- func (s *Service) DeleteFriendByID(myid, friendid string) error
- func (s *Service) GetFriendInfoByID(myid, friendid string) (u *model.User, err error)
- func (s *Service) GetMyFriends(myid string) ([]string, error)
- func (s *Service) GetMyInfoByID(myid string) (*model.User, error)
- func (s Service) Login(re *LoginRequest) (*model.User, error)
- func (s *Service) ModifyFriendNoteByID(myid, friendid, note string) error
- func (s *Service) ModifyMyInfoByID(myid string, data *map[string]any) error
- func (s *Service) ReceiveAndSend(sourceConn, targetConn net.Conn) error
- func (s *Service) Register(r *RegisterRequest) *RegisterResponse
- func (s *Service) UploadFile(fileHeader *multipart.FileHeader) (*FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoginRequest ¶
type LoginRequest struct { Email string `form:"email"` // 邮箱 Password string `form:"password"` // 密码 }
LoginRequest 登录请求
type LoginResponse ¶
LoginResponse 登录响应
type RegisterRequest ¶
type RegisterRequest struct { Email string `form:"email"` // 邮箱 Password string `form:"password"` // 密码 }
RegisterRequest 注册请求
type RegisterResponse ¶
type RegisterResponse struct { Code int `form:"code"` // 状态码 Message string `form:"message"` // 响应消息 }
LoginResponse 登录响应
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service
func (*Service) AddFriendByID ¶
AddFriendByID 通过用户id 添加好友
func (*Service) DeleteFriendByID ¶
DeleteFriendByID 通过 好友 ID 删除好友
func (*Service) GetFriendInfoByID ¶
GetFriendInfoByID 通过 id 获取好友信息
func (*Service) GetMyFriends ¶
GetMyFriends 获取我的所有好友
func (*Service) GetMyInfoByID ¶
GetMyInfoByID 通过 id 获取我的信息
func (*Service) ModifyFriendNoteByID ¶
GetFriendInfoByID 通过 id 获取好友信息
func (*Service) ModifyMyInfoByID ¶
ModifyMyInfoByID 通过 id 修改我的信息
func (*Service) ReceiveAndSend ¶
ReceiveAndSend 从sourceConn接收消息 并 向targetConn发送消息
func (*Service) Register ¶
func (s *Service) Register(r *RegisterRequest) *RegisterResponse
Register 注册用户
func (*Service) UploadFile ¶
func (s *Service) UploadFile(fileHeader *multipart.FileHeader) (*FileInfo, error)
UploadFile 上传文件
Click to show internal directories.
Click to hide internal directories.