Documentation ¶
Index ¶
- Variables
- type UserService
- func (s *UserService) ClearAnswerID(userId, chattitle string)
- func (s *UserService) ClearUserMode(userId string)
- func (s *UserService) ClearUserSessionContext(userId string)
- func (s *UserService) GetAnswerID(userId, chattitle string) uint
- func (s *UserService) GetUseRequestCount(userId string) int
- func (s *UserService) GetUserMode(userId string) string
- func (s *UserService) GetUserSessionContext(userId string) string
- func (s *UserService) SetAnswerID(userId, chattitle string, current uint)
- func (s *UserService) SetUseRequestCount(userId string, current int)
- func (s *UserService) SetUserMode(userId string, mode string)
- func (s *UserService) SetUserSessionContext(userId string, content string)
- type UserServiceInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var Config *config.Configuration
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 用户业务接口
Click to show internal directories.
Click to hide internal directories.