Documentation
¶
Index ¶
- type MysqlManagerImpl
- func (m *MysqlManagerImpl) CreateSummary(ctx context.Context, summary *model.Summary) error
- func (m *MysqlManagerImpl) GetSummary(ctx context.Context, RoomId int64) (*model.Summary, error)
- func (m *MysqlManagerImpl) IsSummaried(ctx context.Context, RoomId int64) int8
- func (m *MysqlManagerImpl) SetSummary(ctx context.Context, RoomId int64, summary string) error
- type RedisManagerImpl
- func (r *RedisManagerImpl) AppendMsg(ctx context.Context, msg *model.RedisHistory, roomId int64, userId int64) error
- func (r *RedisManagerImpl) GetHistory(ctx context.Context, userId int64, roomId int64) ([]*model.RedisHistory, error)
- func (r *RedisManagerImpl) LockSummaryStarted(ctx context.Context, roomId int64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MysqlManagerImpl ¶
type MysqlManagerImpl struct {
// contains filtered or unexported fields
}
func NewMysqlManager ¶
func NewMysqlManager(db *gorm.DB) *MysqlManagerImpl
func (*MysqlManagerImpl) CreateSummary ¶
func (*MysqlManagerImpl) GetSummary ¶
func (*MysqlManagerImpl) IsSummaried ¶
func (m *MysqlManagerImpl) IsSummaried(ctx context.Context, RoomId int64) int8
这里有点绕,如果是 false 并且 err == nil, 表示我们是第一次来,需要创建结构体 但是如果是 true 并且 err == nil, 表示总结就结束了 如果是 false 并且 err != nil 并且 false 则是其他错误, 需要返回
func (*MysqlManagerImpl) SetSummary ¶
这里表示总结完成之后,更新状态和智能纪要内容。
type RedisManagerImpl ¶
type RedisManagerImpl struct {
// contains filtered or unexported fields
}
func NewRedisManager ¶
func NewRedisManager(client *redis.Client) *RedisManagerImpl
func (*RedisManagerImpl) AppendMsg ¶
func (r *RedisManagerImpl) AppendMsg(ctx context.Context, msg *model.RedisHistory, roomId int64, userId int64) error
func (*RedisManagerImpl) GetHistory ¶
func (r *RedisManagerImpl) GetHistory(ctx context.Context, userId int64, roomId int64) ([]*model.RedisHistory, error)
历史消息存 redis 里面,
func (*RedisManagerImpl) LockSummaryStarted ¶
Click to show internal directories.
Click to hide internal directories.