123 lines
3.9 KiB
Go
123 lines
3.9 KiB
Go
package proto
|
|
|
|
// 基础统计信息,会话数,问答数,用户数,今日处理问答数
|
|
type DashBoardStatisticsSt struct {
|
|
SessionNum int64 `json:"session_num"`
|
|
MessageCount int64 `json:"message_count"`
|
|
UserCount int64 `json:"user_count"`
|
|
TodayMessageCount int64 `json:"today_message_count"`
|
|
}
|
|
|
|
// 统计过去一周每天的会话数、消息数
|
|
type DashBoardStatisticsWeekSt struct {
|
|
SessionCount []DashBoardStatisticsWeekCount `json:"session_count"`
|
|
MessageCount []DashBoardStatisticsWeekCount `json:"message_count"`
|
|
}
|
|
|
|
type DashBoardStatisticsWeekCount struct {
|
|
Count int64 `json:"count"`
|
|
}
|
|
|
|
type DashBoardStatisticsResp struct {
|
|
DashBoardStatisticsSt DashBoardStatisticsSt `json:"dashboard_statistics_st"`
|
|
DashBoardStatisticsWeekSt DashBoardStatisticsWeekSt `json:"dashboard_statistics_week"`
|
|
// 模型的使用统计
|
|
DashBoardStatisticsModelSt []MessageModelIDCountSt `json:"dashboard_statistics_model_st"`
|
|
}
|
|
|
|
type MessageModelIDCountSt struct {
|
|
ModelID uint `json:"model_id"`
|
|
ModelName string `json:"name"`
|
|
Count int `json:"value"`
|
|
}
|
|
|
|
type FileContentReq struct {
|
|
UserFileID int `json:"user_file_id" form:"user_file_id"` // 用户文件ID
|
|
FileID int `json:"file_id" form:"file_id"` // 文件ID
|
|
FileContent string `json:"file_content" form:"file_content"` // 文件内容
|
|
}
|
|
|
|
type FileContentResp struct {
|
|
Code int `json:"code"`
|
|
Message string `json:"message"`
|
|
Data any `json:"data"`
|
|
}
|
|
|
|
type GenerateResp struct {
|
|
Code int `json:"code"`
|
|
Message string `json:"message"`
|
|
Data any `json:"data"`
|
|
}
|
|
|
|
type MessageConvertFileReq struct {
|
|
MessageID int `json:"message_id" form:"message_id"` // 消息ID
|
|
FileType string `json:"file_type" form:"file_type"` // 需要转成的文件类型
|
|
FileName string `json:"file_name" form:"file_name"` // 文件名称
|
|
}
|
|
|
|
// 第三方登录
|
|
type ThirdPartyLoginStatus struct {
|
|
Status int `json:"status"` // 登录状态,0:登录成功,1:登录失败
|
|
Type string `json:"type"` // 登录类型,qq,github
|
|
UserInfo UserLoginInfo `json:"user_info"` // 用户信息
|
|
}
|
|
|
|
type UserLoginInfo struct {
|
|
UserID int `json:"id"` // 用户ID
|
|
Username string `json:"username"` // 用户名
|
|
Email string `json:"email"` // 用户邮箱
|
|
Token string `json:"token"` // 用户token
|
|
}
|
|
|
|
// 第三方登录state
|
|
type ThirdPartyLoginState struct {
|
|
UUID string `json:"uuid"` // uuid
|
|
Type string `json:"type"` // 操作类型add,login
|
|
Project string `json:"project"` // 项目名称,saw
|
|
//第三方平台
|
|
Platform string `json:"platform"` // 平台名称,qq,github
|
|
UserID int `json:"user_id"` // 用户ID,当为add时需要
|
|
}
|
|
|
|
type OAuthResponse struct {
|
|
AccessToken string `json:"access_token"` // access_token
|
|
}
|
|
|
|
// github
|
|
type GitHubOAuthResponse struct {
|
|
AccessToken string `json:"access_token"`
|
|
Scope string `json:"scope"`
|
|
TokenType string `json:"token_type"`
|
|
}
|
|
|
|
type GiteeOAuthTokenResponse struct {
|
|
AccessToken string `json:"access_token"`
|
|
TokenType string `json:"token_type"`
|
|
ExpiresIn int `json:"expires_in"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
Scope string `json:"scope"`
|
|
CreatedAt int `json:"created_at"`
|
|
}
|
|
|
|
type OAuthGetTokenRequest struct {
|
|
ClientID string `json:"client_id"`
|
|
ClientSecret string `json:"client_secret"`
|
|
Code string `json:"code"`
|
|
RedirectURI string `json:"redirect_uri" `
|
|
}
|
|
|
|
type GitHubOAuthRequest struct {
|
|
ClientID string `json:"client_id"`
|
|
ClientSecret string `json:"client_secret"`
|
|
Code string `json:"code"`
|
|
RedirectURI string `json:"redirect_uri"`
|
|
}
|
|
|
|
// github返回用户信息
|
|
type GitHubUserInfo struct {
|
|
LoginUserName string `json:"login"` // 用户名
|
|
UserID int `json:"id"` // 用户ID
|
|
AvatarUrl string `json:"avatar_url"` //头像
|
|
Url string `json:"url"` // 用户主页
|
|
}
|