service

package
v0.0.0-...-a277c89 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

说明:朋友管理

说明:user相关业务逻辑

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Name      string
	AccessUrl string
}

type LoginRequest

type LoginRequest struct {
	Email    string `form:"email"`    // 邮箱
	Password string `form:"password"` // 密码
}

LoginRequest 登录请求

type LoginResponse

type LoginResponse struct {
	Code    int    `form:"code"`    // 状态码
	Message string `form:"message"` // 响应消息
}

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 NewService

func NewService(ctx context.Context) Service

New 实例化 Service

func (*Service) AddFriendByID

func (s *Service) AddFriendByID(myid, friendid string) error

AddFriendByID 通过用户id 添加好友

func (*Service) Communicate

func (s *Service) Communicate(conn net.Conn) error

func (*Service) DeleteFriendByID

func (s *Service) DeleteFriendByID(myid, friendid string) error

DeleteFriendByID 通过 好友 ID 删除好友

func (*Service) GetFriendInfoByID

func (s *Service) GetFriendInfoByID(myid, friendid string) (u *model.User, err error)

GetFriendInfoByID 通过 id 获取好友信息

func (*Service) GetMyFriends

func (s *Service) GetMyFriends(myid string) ([]string, error)

GetMyFriends 获取我的所有好友

func (*Service) GetMyInfoByID

func (s *Service) GetMyInfoByID(myid string) (*model.User, error)

GetMyInfoByID 通过 id 获取我的信息

func (Service) Login

func (s Service) Login(re *LoginRequest) (*model.User, error)

Login 用户登录

func (*Service) ModifyFriendNoteByID

func (s *Service) ModifyFriendNoteByID(myid, friendid, note string) error

GetFriendInfoByID 通过 id 获取好友信息

func (*Service) ModifyMyInfoByID

func (s *Service) ModifyMyInfoByID(myid string, data *map[string]any) error

ModifyMyInfoByID 通过 id 修改我的信息

func (*Service) ReceiveAndSend

func (s *Service) ReceiveAndSend(sourceConn, targetConn net.Conn) error

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 上传文件

Jump to

Keyboard shortcuts

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