biz

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 16 Imported by: 0

README

Biz

Documentation

Overview

Package biz @author <chengjiang@buffalo-robot.com> @date 2023/2/6 @note

Package biz @author <chengjiang@buffalo-robot.com> @date 2023/2/6 @note

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewImBiz)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type DataRepo

type DataRepo interface {
	GetDB() *dao.DB
	GetRedis() *redis.Client
}

type IMBiz

type IMBiz struct {
	// contains filtered or unexported fields
}

func NewImBiz

func NewImBiz(pluginRepo PluginsRepo,
	usersSessionRepo UsersSessionRepo,
	sessionRepo SessionRepo,
	messageRepo MessageRepo,
	notifyMsg SystemNotifyMessageRepo,
	notifyRbt NotifyRobotRepo,
	socketio *socketio.SocketioServer,
	data DataRepo,
) *IMBiz

func (*IMBiz) CreateMessage

func (im *IMBiz) CreateMessage(ctx context.Context, req *pb.MessageReq) error

func (*IMBiz) CreateRobot

func (im *IMBiz) CreateRobot(ctx context.Context, req *pb.CreateRobotReq) error

func (*IMBiz) CreateSession

func (im *IMBiz) CreateSession(ctx context.Context, req *pb.CreateSessionReq) (*models2.Session, error)

func (*IMBiz) CreateSessionUser

func (im *IMBiz) CreateSessionUser(ctx context.Context, req *pb.CreateSessionUserReq) error

func (*IMBiz) CreateSysMessage

func (im *IMBiz) CreateSysMessage(ctx context.Context, req *pb.SysMessageReq) error

func (*IMBiz) DeleteSessionUser

func (im *IMBiz) DeleteSessionUser(ctx context.Context, req *pb.DeleteSessionUserReq) error

func (*IMBiz) GetRobotInfo

func (im *IMBiz) GetRobotInfo(ctx context.Context, req *pb.GetRobotInfoReq) (*pb.GetRobotInfoResp, error)

func (*IMBiz) GetRobotList

func (im *IMBiz) GetRobotList(ctx context.Context, req *pb.RobotListReq) (*pb.GetRobotListResp, error)

func (*IMBiz) ListLastMessage

func (im *IMBiz) ListLastMessage(ctx context.Context, req *pb.ListLastMessageReq) (map[int64]*models.Message, error)

func (*IMBiz) ListLastSysMessages

func (im *IMBiz) ListLastSysMessages(ctx context.Context, req *pb.ListLastSysMessageReq) (map[int64]*models2.SystemNotifyMessage, error)

func (*IMBiz) ListMessage

func (im *IMBiz) ListMessage(ctx context.Context, req *pb.ListMessageReq) ([]*models.Message, error)

func (*IMBiz) ListSessionUser

func (im *IMBiz) ListSessionUser(ctx context.Context, req *pb.ListSessionUserReq) ([]int64, error)

func (*IMBiz) ListSysMessage

func (im *IMBiz) ListSysMessage(ctx context.Context, req *pb.ListSysMessageReq) ([]*models2.SystemNotifyMessage, error)

func (*IMBiz) ListUserSession

func (im *IMBiz) ListUserSession(ctx context.Context, req *pb.ListUserSessionReq) ([]*models2.Session, error)

func (*IMBiz) PutSession

func (im *IMBiz) PutSession(ctx context.Context, req *pb.PutSessionReq) error

func (*IMBiz) UpdateRobot

func (im *IMBiz) UpdateRobot(ctx context.Context, req *pb.UpdateRobotReq) error

type MessageRepo

type MessageRepo interface {
	GetMessageBySessionID(ctx context.Context, sessionID, startPos, endPos int64) ([]*models2.Message, error)
	CreateMessage(ctx context.Context, data *models2.Message, s *dao.Session) error
	GetMessageByIDList(ctx context.Context, idList []int64) ([]*models2.Message, error)
	UpdateMessageByid(ctx context.Context, id int64, data *models2.Message, s *dao.Session, columns ...jet.Column) error
	ListMessage(ctx context.Context, page, perPage int32, query string) ([]*models2.Message, int64, error)
	DeleteMessage(ctx context.Context, idList []int64, s *dao.Session) error
}

type NotifyRobotRepo

type NotifyRobotRepo interface {
	GetNotifyRobotByID(ctx context.Context, id int64) (*models2.NotifyRobot, error)
	CreateNotifyRobot(ctx context.Context, data *models2.NotifyRobot, s *dao.Session) error
	GetNotifyRobotByIDList(ctx context.Context, idList []int64) ([]*models2.NotifyRobot, error)
	UpdateNotifyRobotByid(ctx context.Context, id int64, data *models2.NotifyRobot, s *dao.Session, columns ...jet.Column) error
	ListNotifyRobot(ctx context.Context, page, perPage int32, query string) ([]*models2.NotifyRobot, int64, error)
	DeleteNotifyRobot(ctx context.Context, idList []int64, s *dao.Session) error
}

type PluginsRepo

type PluginsRepo interface {
	GetPluginsByID(ctx context.Context, id int64) (*models2.Plugins, error)
	CreatePlugins(ctx context.Context, data *models2.Plugins, s *dao.Session) error
	GetPluginsByIDList(ctx context.Context, idList []int64) ([]*models2.Plugins, error)
	UpdatePluginsByid(ctx context.Context, id int64, data *models2.Plugins, s *dao.Session, columns ...jet.Column) error
	ListPlugins(ctx context.Context, page, perPage int32, query string) ([]*models2.Plugins, int64, error)
	DeletePlugins(ctx context.Context, idList []int64, s *dao.Session) error
}

type SessionRepo

type SessionRepo interface {
	GetSessionByID(ctx context.Context, id int64) (*models2.Session, error)
	CreateSession(ctx context.Context, data *models2.Session, s *dao.Session) error
	GetSessionByIDList(ctx context.Context, idList []int64) ([]*models2.Session, error)
	UpdateSessionByid(ctx context.Context, id int64, data *models2.Session, s *dao.Session, columns ...jet.Column) error
	ListSession(ctx context.Context, page, perPage int32, query string) ([]*models2.Session, int64, error)
	DeleteSession(ctx context.Context, idList []int64, s *dao.Session) error
	GetSessionByName(ctx context.Context, sessionName string) (*models2.Session, error)
}

type SystemNotifyMessageRepo

type SystemNotifyMessageRepo interface {
	GetMessageBySessionID(ctx context.Context, sessionID, startPos, endPos int64) ([]*models2.SystemNotifyMessage, error)
	GetSystemNotifyMessageByID(ctx context.Context, id int64) (*models2.SystemNotifyMessage, error)
	CreateSystemNotifyMessage(ctx context.Context, data *models2.SystemNotifyMessage, s *dao.Session) error
	GetSystemNotifyMessageByIDList(ctx context.Context, idList []int64) ([]*models2.SystemNotifyMessage, error)
	UpdateSystemNotifyMessageByid(ctx context.Context, id int64, data *models2.SystemNotifyMessage, s *dao.Session, columns ...jet.Column) error
	ListSystemNotifyMessage(ctx context.Context, page, perPage int32, query string) ([]*models2.SystemNotifyMessage, int64, error)
	DeleteSystemNotifyMessage(ctx context.Context, idList []int64, s *dao.Session) error
}

type UserInfo

type UserInfo struct {
	// contains filtered or unexported fields
}

type UserRepo

type UserRepo interface {
	// GetUserInfo Grpc
	GetUserInfo(userId int64) (any, error)
	// RegisterRobot Grpc 注册机器人
	RegisterRobot(robot *models2.NotifyRobot) (int64, error)
}

UserRepo @Author @Description //for user and robot @Date 17:15 2023/2/3

type UsersSessionRepo

type UsersSessionRepo interface {
	GetUsersSessionByID(ctx context.Context, id int64) (*models2.UsersSession, error)
	GetUsersSessionByIDListNoCache(ctx context.Context, idList []int64, s *dao.Session) ([]*models2.UsersSession, error)
	CreateUsersSession(ctx context.Context, data []*models2.UsersSession, s *dao.Session) error
	UpdateUsersSessionByid(ctx context.Context, id int64, data *models2.UsersSession, s *dao.Session, columns ...jet.Column) error
	GetUsersSessionByIDList(ctx context.Context, idList []int64) ([]*models2.UsersSession, error)
	ListUsersSession(ctx context.Context, page, perPage int32, query string) ([]*models2.UsersSession, int64, error)
	DeleteUsersSession(ctx context.Context, idList []int64, s *dao.Session) error
}

Jump to

Keyboard shortcuts

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