Documentation
¶
Index ¶
Constants ¶
View Source
const ( STATISTICS_USER_COLLECTION = "statistics_user" STATISTICS_APP_COLLECTION = "statistics_app" STATISTICS_APP_KEY_COLLECTION = "statistics_app_key" )
View Source
const ( USER_COLLECTION = "user" ACCOUNT_COLLECTION = "account" )
View Source
const (
APP_COLLECTION = "app"
)
View Source
const (
AUDIO_COLLECTION = "audio"
)
View Source
const (
CHAT_COLLECTION = "chat"
)
View Source
const (
CORP_COLLECTION = "corp"
)
View Source
const (
DEAL_RECORD_COLLECTION = "deal_record"
)
View Source
const (
IMAGE_COLLECTION = "image"
)
View Source
const (
KEY_COLLECTION = "key"
)
View Source
const (
MIDJOURNEY_COLLECTION = "midjourney"
)
View Source
const (
MODEL_AGENT_COLLECTION = "model_agent"
)
View Source
const (
MODEL_COLLECTION = "model"
)
View Source
const (
SITE_CONFIG_COLLECTION = "site_config"
)
View Source
const (
SYS_ADMIN_COLLECTION = "sys_admin"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
gmeta.Meta `collection:"account" bson:"-"`
Id string `bson:"_id,omitempty"` // ID
Uid string `bson:"uid,omitempty"` // 用户主键ID
UserId int `bson:"user_id,omitempty"` // 用户ID
Account string `bson:"account,omitempty"` // 账号
Password string `bson:"password,omitempty"` // 密码
Salt string `bson:"salt,omitempty"` // 盐
LoginIP string `bson:"login_ip,omitempty"` // 登录IP
LoginTime int64 `bson:"login_time,omitempty"` // 登录时间
Remark string `bson:"remark,omitempty"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type App ¶
type App struct {
gmeta.Meta `collection:"app" bson:"-"`
AppId int `bson:"app_id,omitempty"` // 应用ID
Name string `bson:"name,omitempty"` // 应用名称
Models []string `bson:"models"` // 模型权限
IsLimitQuota bool `bson:"is_limit_quota"` // 是否限制额度
Quota int `bson:"quota"` // 剩余额度
UsedQuota int `bson:"used_quota,omitempty"` // 已用额度
QuotaExpiresAt int64 `bson:"quota_expires_at"` // 额度过期时间
IpWhitelist []string `bson:"ip_whitelist"` // IP白名单
IpBlacklist []string `bson:"ip_blacklist"` // IP黑名单
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
UserId int `bson:"user_id,omitempty"` // 用户ID
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type Audio ¶ added in v0.5.0
type Audio struct {
gmeta.Meta `collection:"audio" bson:"-"`
Id string `bson:"_id,omitempty"` // ID
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Corp string `bson:"corp,omitempty"` // 公司
ModelId string `bson:"model_id,omitempty"` // 模型ID
Name string `bson:"name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
Type int `bson:"type,omitempty"` // 模型类型[1:文生文, 2:文生图, 3:图生文, 4:图生图, 5:文生语音, 6:语音生文, 100:多模态, 101:多模态实时, 102:多模态语音]
Key string `bson:"key,omitempty"` // 密钥
IsEnablePresetConfig bool `bson:"is_enable_preset_config,omitempty"` // 是否启用预设配置
PresetConfig common.PresetConfig `bson:"preset_config,omitempty"` // 预设配置
IsEnableModelAgent bool `bson:"is_enable_model_agent,omitempty"` // 是否启用模型代理
ModelAgentId string `bson:"model_agent_id,omitempty"` // 模型代理ID
ModelAgent *ModelAgent `bson:"model_agent,omitempty"` // 模型代理信息
IsEnableForward bool `bson:"is_enable_forward,omitempty"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `bson:"forward_config,omitempty"` // 模型转发配置
IsSmartMatch bool `bson:"is_smart_match,omitempty"` // 是否智能匹配
IsEnableFallback bool `bson:"is_enable_fallback,omitempty"` // 是否启用后备
FallbackConfig *common.FallbackConfig `bson:"fallback_config,omitempty"` // 后备配置
RealModelId string `bson:"real_model_id,omitempty"` // 真实模型ID
RealModelName string `bson:"real_model_name,omitempty"` // 真实模型名称
RealModel string `bson:"real_model,omitempty"` // 真实模型
Input string `bson:"input,omitempty"` // 输入文本
Text string `bson:"text,omitempty"` // 输出文本
Characters int `bson:"characters,omitempty"` // 字符数
Minute float64 `bson:"minute,omitempty"` // 分钟数
AudioQuota common.AudioQuota `bson:"audio_quota,omitempty"` // 音频额度
FilePath string `bson:"file_path,omitempty"` // 文件路径
TotalTokens int `bson:"total_tokens,omitempty"` // 总令牌数
TotalTime int64 `bson:"total_time,omitempty"` // 总时间
InternalTime int64 `bson:"internal_time,omitempty"` // 内耗时间
ReqTime int64 `bson:"req_time,omitempty"` // 请求时间
ReqDate string `bson:"req_date,omitempty"` // 请求日期
ClientIp string `bson:"client_ip,omitempty"` // 客户端IP
RemoteIp string `bson:"remote_ip,omitempty"` // 远程IP
LocalIp string `bson:"local_ip,omitempty"` // 本地IP
ErrMsg string `bson:"err_msg,omitempty"` // 错误信息
IsRetry bool `bson:"is_retry,omitempty"` // 是否重试
Retry *common.Retry `bson:"retry,omitempty"` // 重试
Status int `bson:"status,omitempty"` // 状态[1:成功, -1:失败, 2:中止, 3:重试]
Host string `bson:"host,omitempty"` // Host
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type Chat ¶
type Chat struct {
gmeta.Meta `collection:"chat" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Corp string `bson:"corp,omitempty"` // 公司
ModelId string `bson:"model_id,omitempty"` // 模型ID
Name string `bson:"name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
Type int `bson:"type,omitempty"` // 模型类型[1:文生文, 2:文生图, 3:图生文, 4:图生图, 5:文生语音, 6:语音生文, 100:多模态, 101:多模态实时, 102:多模态语音]
Key string `bson:"key,omitempty"` // 密钥
IsEnablePresetConfig bool `bson:"is_enable_preset_config,omitempty"` // 是否启用预设配置
PresetConfig common.PresetConfig `bson:"preset_config,omitempty"` // 预设配置
IsEnableModelAgent bool `bson:"is_enable_model_agent,omitempty"` // 是否启用模型代理
ModelAgentId string `bson:"model_agent_id,omitempty"` // 模型代理ID
ModelAgent *ModelAgent `bson:"model_agent,omitempty"` // 模型代理信息
IsEnableForward bool `bson:"is_enable_forward,omitempty"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `bson:"forward_config,omitempty"` // 模型转发配置
IsSmartMatch bool `bson:"is_smart_match,omitempty"` // 是否智能匹配
IsEnableFallback bool `bson:"is_enable_fallback,omitempty"` // 是否启用后备
FallbackConfig *common.FallbackConfig `bson:"fallback_config,omitempty"` // 后备配置
RealModelId string `bson:"real_model_id,omitempty"` // 真实模型ID
RealModelName string `bson:"real_model_name,omitempty"` // 真实模型名称
RealModel string `bson:"real_model,omitempty"` // 真实模型
Stream bool `bson:"stream,omitempty"` // 流式
Messages []common.Message `bson:"messages,omitempty"` // 完整提示(提问)
Prompt string `bson:"prompt,omitempty"` // 提示(提问)
Completion string `bson:"completion,omitempty"` // 补全(回答)
TextQuota common.TextQuota `bson:"text_quota,omitempty"` // 文本额度
ImageQuotas []common.ImageQuota `bson:"image_quotas,omitempty"` // 图像额度
MultimodalQuota common.MultimodalQuota `bson:"multimodal_quota,omitempty"` // 多模态额度
RealtimeQuota common.RealtimeQuota `bson:"realtime_quota,omitempty"` // 多模态实时额度
MultimodalAudioQuota common.MultimodalAudioQuota `bson:"multimodal_audio_quota,omitempty"` // 多模态语音额度
PromptTokens int `bson:"prompt_tokens,omitempty"` // 提示令牌数(提问令牌数)
CompletionTokens int `bson:"completion_tokens,omitempty"` // 补全令牌数(回答令牌数)
SearchTokens int `bson:"search_tokens,omitempty"` // 搜索令牌数
CacheWriteTokens int `bson:"cache_write_tokens,omitempty"` // 缓存写入令牌数
CacheHitTokens int `bson:"cache_hit_tokens,omitempty"` // 缓存命中令牌数
TotalTokens int `bson:"total_tokens,omitempty"` // 总令牌数
ConnTime int64 `bson:"conn_time,omitempty"` // 连接时间
Duration int64 `bson:"duration,omitempty"` // 持续时间
TotalTime int64 `bson:"total_time,omitempty"` // 总时间
InternalTime int64 `bson:"internal_time,omitempty"` // 内耗时间
ReqTime int64 `bson:"req_time,omitempty"` // 请求时间
ReqDate string `bson:"req_date,omitempty"` // 请求日期
ClientIp string `bson:"client_ip,omitempty"` // 客户端IP
RemoteIp string `bson:"remote_ip,omitempty"` // 远程IP
LocalIp string `bson:"local_ip,omitempty"` // 本地IP
ErrMsg string `bson:"err_msg,omitempty"` // 错误信息
IsRetry bool `bson:"is_retry,omitempty"` // 是否重试
Retry *common.Retry `bson:"retry,omitempty"` // 重试
Status int `bson:"status,omitempty"` // 状态[1:成功, -1:失败, 2:中止, 3:重试]
Host string `bson:"host,omitempty"` // Host
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type Corp ¶ added in v0.3.0
type Corp struct {
gmeta.Meta `collection:"corp" bson:"-"`
Name string `bson:"name,omitempty"` // 名称
Code string `bson:"code,omitempty"` // 代码
Sort int `bson:"sort,omitempty"` // 排序
IsPublic bool `bson:"is_public"` // 是否公开
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type DealRecord ¶ added in v0.4.0
type DealRecord struct {
gmeta.Meta `collection:"deal_record" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
Quota int `bson:"quota"` // 充值额度
Remark string `bson:"remark,omitempty"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:退款, -1:删除]
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type Image ¶ added in v0.4.0
type Image struct {
gmeta.Meta `collection:"image" bson:"-"`
Id string `bson:"_id,omitempty"` // ID
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Corp string `bson:"corp,omitempty"` // 公司
ModelId string `bson:"model_id,omitempty"` // 模型ID
Name string `bson:"name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
Type int `bson:"type,omitempty"` // 模型类型[1:文生文, 2:文生图, 3:图生文, 4:图生图, 5:文生语音, 6:语音生文, 100:多模态, 101:多模态实时, 102:多模态语音]
Key string `bson:"key,omitempty"` // 密钥
IsEnablePresetConfig bool `bson:"is_enable_preset_config,omitempty"` // 是否启用预设配置
PresetConfig common.PresetConfig `bson:"preset_config,omitempty"` // 预设配置
IsEnableModelAgent bool `bson:"is_enable_model_agent,omitempty"` // 是否启用模型代理
ModelAgentId string `bson:"model_agent_id,omitempty"` // 模型代理ID
ModelAgent *ModelAgent `bson:"model_agent,omitempty"` // 模型代理信息
IsEnableForward bool `bson:"is_enable_forward,omitempty"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `bson:"forward_config,omitempty"` // 模型转发配置
IsSmartMatch bool `bson:"is_smart_match,omitempty"` // 是否智能匹配
IsEnableFallback bool `bson:"is_enable_fallback,omitempty"` // 是否启用后备
FallbackConfig *common.FallbackConfig `bson:"fallback_config,omitempty"` // 后备配置
RealModelId string `bson:"real_model_id,omitempty"` // 真实模型ID
RealModelName string `bson:"real_model_name,omitempty"` // 真实模型名称
RealModel string `bson:"real_model,omitempty"` // 真实模型
Prompt string `bson:"prompt,omitempty"` // 提示(提问)
Size string `bson:"size,omitempty"` // 尺寸大小
N int `bson:"n,omitempty"` // 图像数
Quality string `bson:"quality,omitempty"` // 图像质量[hd]
Style string `bson:"style,omitempty"` // 图像样式[vivid, natural]
ResponseFormat string `bson:"response_format,omitempty"` // 图像格式[url, b64_json]
ImageData []common.ImageData `bson:"image_data,omitempty"` // 生成图像数据
ImageQuotas []common.ImageQuota `bson:"image_quotas,omitempty"` // 图像额度
MultimodalQuota common.MultimodalQuota `bson:"multimodal_quota,omitempty"` // 多模态额度
TotalTokens int `bson:"total_tokens,omitempty"` // 总令牌数
TotalTime int64 `bson:"total_time,omitempty"` // 总时间
InternalTime int64 `bson:"internal_time,omitempty"` // 内耗时间
ReqTime int64 `bson:"req_time,omitempty"` // 请求时间
ReqDate string `bson:"req_date,omitempty"` // 请求日期
ClientIp string `bson:"client_ip,omitempty"` // 客户端IP
RemoteIp string `bson:"remote_ip,omitempty"` // 远程IP
LocalIp string `bson:"local_ip,omitempty"` // 本地IP
ErrMsg string `bson:"err_msg,omitempty"` // 错误信息
IsRetry bool `bson:"is_retry,omitempty"` // 是否重试
Retry *common.Retry `bson:"retry,omitempty"` // 重试
Status int `bson:"status,omitempty"` // 状态[1:成功, -1:失败, 2:中止, 3:重试]
Host string `bson:"host,omitempty"` // Host
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type Key ¶
type Key struct {
gmeta.Meta `collection:"key" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Corp string `bson:"corp,omitempty"` // 公司
Key string `bson:"key,omitempty"` // 密钥
Type int `bson:"type,omitempty"` // 密钥类型[1:应用, 2:模型]
Weight int `bson:"weight"` // 权重
Models []string `bson:"models"` // 模型
ModelAgents []string `bson:"model_agents"` // 模型代理
IsAgentsOnly bool `bson:"is_agents_only"` // 是否代理专用
IsLimitQuota bool `bson:"is_limit_quota"` // 是否限制额度
Quota int `bson:"quota"` // 剩余额度
UsedQuota int `bson:"used_quota,omitempty"` // 已用额度
QuotaExpiresRule int `bson:"quota_expires_rule,omitempty"` // 额度过期规则[1:固定, 2:时长]
QuotaExpiresAt int64 `bson:"quota_expires_at"` // 额度过期时间
QuotaExpiresMinutes int64 `bson:"quota_expires_minutes"` // 额度过期分钟数
IpWhitelist []string `bson:"ip_whitelist"` // IP白名单
IpBlacklist []string `bson:"ip_blacklist"` // IP黑名单
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
IsAutoDisabled bool `bson:"is_auto_disabled"` // 是否自动禁用
AutoDisabledReason string `bson:"auto_disabled_reason"` // 自动禁用原因
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type Midjourney ¶ added in v0.4.0
type Midjourney struct {
gmeta.Meta `collection:"midjourney" bson:"-"`
Id string `bson:"_id,omitempty"` // ID
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Corp string `bson:"corp,omitempty"` // 公司
ModelId string `bson:"model_id,omitempty"` // 模型ID
Name string `bson:"name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
Type int `bson:"type,omitempty"` // 模型类型[1:文生文, 2:文生图, 3:图生文, 4:图生图, 5:文生语音, 6:语音生文, 100:多模态, 101:多模态实时, 102:多模态语音]
Key string `bson:"key,omitempty"` // 密钥
IsEnablePresetConfig bool `bson:"is_enable_preset_config,omitempty"` // 是否启用预设配置
PresetConfig common.PresetConfig `bson:"preset_config,omitempty"` // 预设配置
IsEnableModelAgent bool `bson:"is_enable_model_agent,omitempty"` // 是否启用模型代理
ModelAgentId string `bson:"model_agent_id,omitempty"` // 模型代理ID
ModelAgent *ModelAgent `bson:"model_agent,omitempty"` // 模型代理信息
IsEnableForward bool `bson:"is_enable_forward,omitempty"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `bson:"forward_config,omitempty"` // 模型转发配置
IsSmartMatch bool `bson:"is_smart_match,omitempty"` // 是否智能匹配
IsEnableFallback bool `bson:"is_enable_fallback,omitempty"` // 是否启用后备
FallbackConfig *common.FallbackConfig `bson:"fallback_config,omitempty"` // 后备配置
RealModelId string `bson:"real_model_id,omitempty"` // 真实模型ID
RealModelName string `bson:"real_model_name,omitempty"` // 真实模型名称
RealModel string `bson:"real_model,omitempty"` // 真实模型
ReqUrl string `bson:"req_url,omitempty"` // 请求地址
TaskId string `bson:"task_id,omitempty"` // 任务ID
Action string `bson:"action,omitempty"` // 动作[IMAGINE, UPSCALE, VARIATION, ZOOM, PAN, DESCRIBE, BLEND, SHORTEN, SWAP_FACE]
Prompt string `bson:"prompt,omitempty"` // 提示(提问)
PromptEn string `bson:"prompt_en,omitempty"` // 英文提示(提问)
ImageUrl string `bson:"image_url,omitempty"` // 图像地址
Progress string `bson:"progress,omitempty"` // 进度
Response interface{} `bson:"response,omitempty"` // 响应结果
MidjourneyQuotas []common.MidjourneyQuota `bson:"midjourney_quotas,omitempty"` // Midjourney额度
TotalTokens int `bson:"total_tokens,omitempty"` // 总令牌数
ConnTime int64 `bson:"conn_time,omitempty"` // 连接时间
Duration int64 `bson:"duration,omitempty"` // 持续时间
TotalTime int64 `bson:"total_time,omitempty"` // 总时间
InternalTime int64 `bson:"internal_time,omitempty"` // 内耗时间
ReqTime int64 `bson:"req_time,omitempty"` // 请求时间
ReqDate string `bson:"req_date,omitempty"` // 请求日期
ClientIp string `bson:"client_ip,omitempty"` // 客户端IP
RemoteIp string `bson:"remote_ip,omitempty"` // 远程IP
LocalIp string `bson:"local_ip,omitempty"` // 本地IP
ErrMsg string `bson:"err_msg,omitempty"` // 错误信息
IsRetry bool `bson:"is_retry,omitempty"` // 是否重试
Retry *common.Retry `bson:"retry,omitempty"` // 重试
Status int `bson:"status,omitempty"` // 状态[1:成功, -1:失败, 2:中止, 3:重试]
Host string `bson:"host,omitempty"` // Host
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type Model ¶
type Model struct {
gmeta.Meta `collection:"model" bson:"-"`
Corp string `bson:"corp,omitempty"` // 公司
Name string `bson:"name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
Type int `bson:"type,omitempty"` // 模型类型[1:文生文, 2:文生图, 3:图生文, 4:图生图, 5:文生语音, 6:语音生文, 100:多模态, 101:多模态实时, 102:多模态语音]
BaseUrl string `bson:"base_url"` // 模型地址
Path string `bson:"path"` // 模型路径
IsEnablePresetConfig bool `bson:"is_enable_preset_config"` // 是否启用预设配置
PresetConfig common.PresetConfig `bson:"preset_config"` // 预设配置
TextQuota common.TextQuota `bson:"text_quota"` // 文本额度
ImageQuotas []common.ImageQuota `bson:"image_quotas"` // 图像额度
AudioQuota common.AudioQuota `bson:"audio_quota"` // 音频额度
MultimodalQuota common.MultimodalQuota `bson:"multimodal_quota"` // 多模态额度
RealtimeQuota common.RealtimeQuota `bson:"realtime_quota"` // 多模态实时额度
MultimodalAudioQuota common.MultimodalAudioQuota `bson:"multimodal_audio_quota"` // 多模态语音额度
MidjourneyQuotas []common.MidjourneyQuota `bson:"midjourney_quotas"` // Midjourney额度
DataFormat int `bson:"data_format,omitempty"` // 数据格式[1:统一格式, 2:官方格式]
IsPublic bool `bson:"is_public"` // 是否公开
IsEnableModelAgent bool `bson:"is_enable_model_agent"` // 是否启用模型代理
LbStrategy int `bson:"lb_strategy,omitempty"` // 代理负载均衡策略[1:轮询, 2:权重]
ModelAgents []string `bson:"model_agents"` // 模型代理
IsEnableForward bool `bson:"is_enable_forward"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `bson:"forward_config,omitempty"` // 模型转发配置
IsEnableFallback bool `bson:"is_enable_fallback"` // 是否启用后备
FallbackConfig *common.FallbackConfig `bson:"fallback_config,omitempty"` // 后备配置
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type ModelAgent ¶
type ModelAgent struct {
gmeta.Meta `collection:"model_agent" bson:"-"`
Corp string `bson:"corp,omitempty"` // 公司
Name string `bson:"name,omitempty"` // 模型代理名称
BaseUrl string `bson:"base_url,omitempty"` // 模型代理地址
Path string `bson:"path"` // 模型代理地址路径
Weight int `bson:"weight"` // 权重
LbStrategy int `bson:"lb_strategy,omitempty"` // 密钥负载均衡策略[1:轮询, 2:权重]
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
IsAutoDisabled bool `bson:"is_auto_disabled"` // 是否自动禁用
AutoDisabledReason string `bson:"auto_disabled_reason"` // 自动禁用原因
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type SiteConfig ¶ added in v1.0.0
type SiteConfig struct {
gmeta.Meta `collection:"site_config" bson:"-"`
Domain string `bson:"domain,omitempty"` // 域名
Title string `bson:"title,omitempty"` // 标题
Logo string `bson:"logo,omitempty"` // Logo
Favicon string `bson:"favicon,omitempty"` // Favicon
Avatar string `bson:"avatar"` // 头像
BgImg string `bson:"bg_img"` // 背景图
Copyright string `bson:"copyright"` // 版权信息
JumpUrl string `bson:"jump_url"` // 跳转URL
Keywords string `bson:"keywords"` // 关键词
Description string `bson:"description"` // 描述
IcpBeian string `bson:"icp_beian"` // ICP备案
GaBeian string `bson:"ga_beian"` // 公安备案
RegisterTips string `bson:"register_tips"` // 注册提示
GrantQuota int `bson:"grant_quota"` // 注册授予额度
QuotaExpiresAt int `bson:"quota_expires_at"` // 注册授予额度过期时间, 单位: 分钟
SupportEmailSuffix []string `bson:"support_email_suffix"` // 注册支持的邮箱后缀
Host string `bson:"host"` // 发信服务器
Port int `bson:"port"` // 发信端口号
UserName string `bson:"user_name"` // 发信账号
Password string `bson:"password"` // 发信密码
FromName string `bson:"from_name"` // 发信人名称
Carousel1Title string `bson:"carousel1_title"` // 轮播图1标题
Carousels1 []common.Carousel `bson:"carousels1"` // 轮播图1
Carousel2Title string `bson:"carousel2_title"` // 轮播图2标题
Carousels2 []common.Carousel `bson:"carousels2"` // 轮播图2
AnnouncementTitle string `bson:"announcement_title"` // 公告标题
AnnouncementMoreUrl string `bson:"announcement_more_url"` // 公告更多URL
Announcements []common.Announcement `bson:"announcements"` // 公告
DocumentTitle string `bson:"document_title"` // 文档标题
DocumentMoreUrl string `bson:"document_more_url"` // 文档更多URL
Documents []common.Document `bson:"documents"` // 文档
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
UserId int `bson:"user_id,omitempty"` // 用户ID
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type StatisticsApp ¶ added in v0.5.0
type StatisticsApp struct {
gmeta.Meta `collection:"statistics_app" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
StatDate string `bson:"stat_date,omitempty"` // 统计日期
StatTime int64 `bson:"stat_time,omitempty"` // 统计时间
Total int `bson:"total,omitempty"` // 总数
Tokens int `bson:"tokens,omitempty"` // 令牌数
Abnormal int `bson:"abnormal,omitempty"` // 异常数
AbnormalTokens int `bson:"abnormal_tokens,omitempty"` // 异常令牌数
ModelStats []*common.ModelStat `bson:"model_stats,omitempty"` // 模型统计数据
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type StatisticsAppKey ¶ added in v0.5.0
type StatisticsAppKey struct {
gmeta.Meta `collection:"statistics_app_key" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
AppKey string `bson:"app_key,omitempty"` // 应用密钥
StatDate string `bson:"stat_date,omitempty"` // 统计日期
StatTime int64 `bson:"stat_time,omitempty"` // 统计时间
Total int `bson:"total,omitempty"` // 总数
Tokens int `bson:"tokens,omitempty"` // 令牌数
Abnormal int `bson:"abnormal,omitempty"` // 异常数
AbnormalTokens int `bson:"abnormal_tokens,omitempty"` // 异常令牌数
ModelStats []*common.ModelStat `bson:"model_stats,omitempty"` // 模型统计数据
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type StatisticsUser ¶ added in v0.5.0
type StatisticsUser struct {
gmeta.Meta `collection:"statistics_user" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
StatDate string `bson:"stat_date,omitempty"` // 统计日期
StatTime int64 `bson:"stat_time,omitempty"` // 统计时间
Total int `bson:"total,omitempty"` // 总数
Tokens int `bson:"tokens,omitempty"` // 令牌数
Abnormal int `bson:"abnormal,omitempty"` // 异常数
AbnormalTokens int `bson:"abnormal_tokens,omitempty"` // 异常令牌数
ModelStats []*common.ModelStat `bson:"model_stats,omitempty"` // 模型统计数据
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type SysAdmin ¶
type SysAdmin struct {
gmeta.Meta `collection:"sys_admin" bson:"-"`
Id string `bson:"_id,omitempty"` // ID
UserId int `bson:"user_id,omitempty"` // 用户ID
Name string `bson:"name,omitempty"` // 姓名
Avatar string `bson:"avatar,omitempty"` // 头像
Email string `bson:"email,omitempty"` // 邮箱
Phone string `bson:"phone,omitempty"` // 手机号
Account string `bson:"account,omitempty"` // 账号
Password string `bson:"password,omitempty"` // 密码
Salt string `bson:"salt,omitempty"` // 盐
IsSuperAdmin bool `bson:"is_super_admin,omitempty"` // 是否超级管理员
IsSysAdmin bool `bson:"is_sys_admin,omitempty"` // 是否系统管理员
LoginIP string `bson:"login_ip,omitempty"` // 登录IP
LoginTime int64 `bson:"login_time,omitempty"` // 登录时间
Remark string `bson:"remark,omitempty"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type User ¶
type User struct {
gmeta.Meta `collection:"user" bson:"-"`
Id string `bson:"_id,omitempty"` // ID
UserId int `bson:"user_id,omitempty"` // 用户ID
Name string `bson:"name,omitempty"` // 姓名
Avatar string `bson:"avatar,omitempty"` // 头像
Email string `bson:"email,omitempty"` // 邮箱
Phone string `bson:"phone,omitempty"` // 手机号
VipLevel int `bson:"vip_level,omitempty"` // 会员等级
Quota int `bson:"quota"` // 剩余额度
UsedQuota int `bson:"used_quota,omitempty"` // 已用额度
QuotaExpiresAt int64 `bson:"quota_expires_at"` // 额度过期时间
Models []string `bson:"models"` // 模型权限
Remark string `bson:"remark,omitempty"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
Click to show internal directories.
Click to hide internal directories.