cache

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type UserService

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

UserService 用戶业务

func (*UserService) ClearAnswerID added in v1.0.7

func (s *UserService) ClearAnswerID(userId, chattitle string)

ClearUserSessionContext 清空GPT上下文,接收文本中包含 SessionClearToken

func (*UserService) ClearUserMode

func (s *UserService) ClearUserMode(userId string)

ClearUserMode 重置用户对话模式

func (*UserService) ClearUserSessionContext

func (s *UserService) ClearUserSessionContext(userId string)

ClearUserSessionContext 清空GPT上下文,接收文本中包含 SessionClearToken

func (*UserService) GetAnswerID added in v1.0.7

func (s *UserService) GetAnswerID(userId, chattitle string) uint

GetAnswerID 获取当前用户获得答案的ID

func (*UserService) GetUseRequestCount

func (s *UserService) GetUseRequestCount(userId string) int

GetUseRequestCount 获取当前用户已请求次数

func (*UserService) GetUserMode

func (s *UserService) GetUserMode(userId string) string

GetUserMode 获取当前对话模式

func (*UserService) GetUserSessionContext

func (s *UserService) GetUserSessionContext(userId string) string

GetUserSessionContext 获取用户会话上下文文本

func (*UserService) SetAnswerID added in v1.0.7

func (s *UserService) SetAnswerID(userId, chattitle string, current uint)

SetAnswerID 设置用户获得答案的ID

func (*UserService) SetUseRequestCount

func (s *UserService) SetUseRequestCount(userId string, current int)

SetUseRequestCount 设置用户请求次数

func (*UserService) SetUserMode

func (s *UserService) SetUserMode(userId string, mode string)

SetUserMode 设置用户对话模式

func (*UserService) SetUserSessionContext

func (s *UserService) SetUserSessionContext(userId string, content string)

SetUserSessionContext 设置用户会话上下文文本,question用户提问内容,GPT回复内容

type UserServiceInterface

type UserServiceInterface interface {
	// 用户聊天模式
	GetUserMode(userId string) string
	SetUserMode(userId, mode string)
	ClearUserMode(userId string)
	// 用户聊天上下文
	GetUserSessionContext(userId string) string
	SetUserSessionContext(userId, content string)
	ClearUserSessionContext(userId string)
	// 用户请求次数
	SetUseRequestCount(userId string, current int)
	GetUseRequestCount(uerId string) int
	// 用户对话ID
	SetAnswerID(userId, chattype string, current uint)
	GetAnswerID(uerId, chattype string) uint
	ClearAnswerID(userId, chattitle string)
}

UserServiceInterface 用户业务接口

func NewUserService

func NewUserService() UserServiceInterface

NewUserService 创建新的业务层

Jump to

Keyboard shortcuts

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