Documentation
¶
Index ¶
- type Account
- type App
- type AppKey
- type DealRecord
- type Group
- type Key
- type LogAudio
- type LogBatch
- type LogFile
- type LogGeneral
- type LogImage
- type LogMidjourney
- type LogText
- type LogVideo
- type Model
- type ModelAgent
- type Notice
- type NoticeTemplate
- type Provider
- type Reseller
- type ResellerAccount
- type SiteConfig
- type StatisticsApp
- type StatisticsAppKey
- type StatisticsUser
- type SysAdmin
- type SysConfig
- type TaskBatch
- type TaskFile
- type TaskVideo
- type User
Constants ¶
This section is empty.
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"` // 登录时间
LoginDomain string `bson:"login_domain,omitempty"` // 登录域名
Remark string `bson:"remark,omitempty"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Rid int `bson:"rid,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 App ¶
type App struct {
gmeta.Meta `collection:"app" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
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"` // 额度过期时间
IsCycleResetQuota bool `bson:"is_cycle_reset_quota"` // 是否循环重置额度
ResetQuota int `bson:"reset_quota,omitempty"` // 重置额度
CyclePeriod int `bson:"cycle_period,omitempty"` // 循环周期
PeriodUnit string `bson:"period_unit,omitempty"` // 周期单位[hour:小时, day:天]
ResetMode string `bson:"reset_mode,omitempty"` // 重置模式[natural:自然周期, relative:相对周期]
ResetAt int64 `bson:"reset_at"` // 重置时间
NextResetAt int64 `bson:"next_reset_at"` // 下次重置时间
IsBindGroup bool `bson:"is_bind_group"` // 是否绑定分组
Group string `bson:"group"` // 绑定分组
IpWhitelist []string `bson:"ip_whitelist"` // IP白名单
IpBlacklist []string `bson:"ip_blacklist"` // IP黑名单
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Rid int `bson:"rid,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 AppKey ¶
type AppKey struct {
gmeta.Meta `collection:"app_key" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Name string `bson:"name,omitempty"` // 密钥名称
Key string `bson:"key,omitempty"` // 应用密钥
BillingMethods []int `bson:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
Models []string `bson:"models"` // 模型权限
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"` // 额度过期分钟数
IsCycleResetQuota bool `bson:"is_cycle_reset_quota"` // 是否循环重置额度
ResetQuota int `bson:"reset_quota,omitempty"` // 重置额度
CyclePeriod int `bson:"cycle_period,omitempty"` // 循环周期
PeriodUnit string `bson:"period_unit,omitempty"` // 周期单位[hour:小时, day:天]
ResetMode string `bson:"reset_mode,omitempty"` // 重置模式[natural:自然周期, relative:相对周期]
ResetAt int64 `bson:"reset_at"` // 重置时间
NextResetAt int64 `bson:"next_reset_at"` // 下次重置时间
IsBindGroup bool `bson:"is_bind_group"` // 是否绑定分组
Group string `bson:"group"` // 绑定分组
IpWhitelist []string `bson:"ip_whitelist"` // IP白名单
IpBlacklist []string `bson:"ip_blacklist"` // IP黑名单
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Rid int `bson:"rid,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 DealRecord ¶
type DealRecord struct {
gmeta.Meta `collection:"deal_record" bson:"-"`
UserId int `bson:"user_id,omitempty"` // 用户ID
Quota int `bson:"quota,omitempty"` // 额度
Type int `bson:"type,omitempty"` // 交易类型[1:充值, 2:扣除, 3:赠送, 4:过期]
Remark string `bson:"remark,omitempty"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:成功, 2:退款, 3:失败, -1:删除]
Rid int `bson:"rid,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 Group ¶
type Group struct {
gmeta.Meta `collection:"group" bson:"-"`
TimeRules []*common.TimeRule `bson:"time_rules,omitempty"` // 时段规则
BillingMethods []int `bson:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
Name string `bson:"name,omitempty"` // 分组名称
Models []string `bson:"models"` // 模型权限
IsEnableModelAgent bool `bson:"is_enable_model_agent"` // 是否启用模型代理
LbStrategy int `bson:"lb_strategy,omitempty"` // 代理负载均衡策略[1:轮询, 2:权重]
ModelAgents []string `bson:"model_agents"` // 模型代理
IsDefault bool `bson:"is_default"` // 是否默认分组
IsLimitQuota bool `bson:"is_limit_quota"` // 是否限制额度
Quota int `bson:"quota"` // 剩余额度
UsedQuota int `bson:"used_quota,omitempty"` // 已用额度
IsCycleResetQuota bool `bson:"is_cycle_reset_quota"` // 是否循环重置额度
ResetQuota int `bson:"reset_quota,omitempty"` // 重置额度
CyclePeriod int `bson:"cycle_period,omitempty"` // 循环周期
PeriodUnit string `bson:"period_unit,omitempty"` // 周期单位[hour:小时, day:天]
ResetMode string `bson:"reset_mode,omitempty"` // 重置模式[natural:自然周期, relative:相对周期]
ResetAt int64 `bson:"reset_at"` // 重置时间
NextResetAt int64 `bson:"next_reset_at"` // 下次重置时间
IsEnableForward bool `bson:"is_enable_forward"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `bson:"forward_config"` // 模型转发配置
IsPublic bool `bson:"is_public"` // 是否公开
Weight int `bson:"weight"` // 权重
ExpiresAt int64 `bson:"expires_at"` // 过期时间
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 Key ¶
type Key struct {
gmeta.Meta `collection:"key" bson:"-"`
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
Key string `bson:"key,omitempty"` // 密钥
Weight int `bson:"weight"` // 权重
Models []string `bson:"models"` // 模型
ModelAgents []string `bson:"model_agents"` // 模型代理
IsAgentsOnly bool `bson:"is_agents_only"` // 是否代理专用
IsNeverDisable bool `bson:"is_never_disable"` // 是否永不禁用
UsedQuota int `bson:"used_quota,omitempty"` // 已用额度
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 LogAudio ¶
type LogAudio struct {
gmeta.Meta `collection:"log_audio" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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"` // 输出文本
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 LogBatch ¶
type LogBatch struct {
gmeta.Meta `collection:"log_batch" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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"` // 真实模型
Action string `bson:"action,omitempty"` // 接口
BatchId string `bson:"batch_id,omitempty"` // 批处理ID
RequestData map[string]any `bson:"request_data,omitempty"` // 请求数据
ResponseData map[string]any `bson:"response_data,omitempty"` // 响应数据
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 LogFile ¶
type LogFile struct {
gmeta.Meta `collection:"log_file" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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"` // 真实模型
Action string `bson:"action,omitempty"` // 接口
FileId string `bson:"file_id,omitempty"` // 文件ID
RequestData map[string]any `bson:"request_data,omitempty"` // 请求数据
ResponseData map[string]any `bson:"response_data,omitempty"` // 响应数据
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 LogGeneral ¶
type LogGeneral struct {
gmeta.Meta `collection:"log_general" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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"` // 真实模型
RequestData map[string]any `bson:"request_data,omitempty"` // 请求数据
ResponseData map[string]any `bson:"response_data,omitempty"` // 响应数据
Stream bool `bson:"stream,omitempty"` // 流式
Completion string `bson:"completion,omitempty"` // 补全(回答)
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 LogImage ¶
type LogImage struct {
gmeta.Meta `collection:"log_image" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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"` // 图像质量[high, medium, low, hd, standard]
Style string `bson:"style,omitempty"` // 图像样式[vivid, natural]
ResponseFormat string `bson:"response_format,omitempty"` // 图像格式[url, b64_json]
ImageData []common.ImageData `bson:"image_data,omitempty"` // 生成图像数据
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 LogMidjourney ¶
type LogMidjourney struct {
gmeta.Meta `collection:"log_midjourney" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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 any `bson:"response,omitempty"` // 响应结果
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 LogText ¶
type LogText struct {
gmeta.Meta `collection:"log_text" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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"` // 补全(回答)
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 LogVideo ¶
type LogVideo struct {
gmeta.Meta `collection:"log_video" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
ProviderCode string `bson:"provider_code,omitempty"` // 提供商代码
ProviderName string `bson:"provider_name,omitempty"` // 提供商名称
ModelId string `bson:"model_id,omitempty"` // 模型ID
ModelName string `bson:"model_name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
ModelType int `bson:"model_type,omitempty"` // 模型类型
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"` // 真实模型
Action string `bson:"action,omitempty"` // 接口
VideoId string `bson:"video_id,omitempty"` // 视频ID
RequestData map[string]any `bson:"request_data,omitempty"` // 请求数据
ResponseData map[string]any `bson:"response_data,omitempty"` // 响应数据
Spend common.Spend `bson:"spend,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:成功, 2:中止, 3:重试, -1:失败]
Host string `bson:"host,omitempty"` // Host
Method string `bson:"method,omitempty"` // Method
Path string `bson:"path,omitempty"` // Path
Rid int `bson:"rid,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 Model ¶
type Model struct {
gmeta.Meta `collection:"model" bson:"-"`
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
Name string `bson:"name,omitempty"` // 模型名称
Model string `bson:"model,omitempty"` // 模型
Type int `bson:"type,omitempty"` // 模型类型[1:文生文, 2:文生图, 3:图生文, 4:图生图, 5:文生语音, 6:语音生文, 7:文本向量化, 8:视频生成, 100:多模态, 101:多模态实时, 102:多模态语音, 103:多模态向量化, 10000:通用]
BaseUrl string `bson:"base_url"` // 模型地址
Path string `bson:"path"` // 模型路径
IsEnablePresetConfig bool `bson:"is_enable_preset_config"` // 是否启用预设配置
PresetConfig common.PresetConfig `bson:"preset_config"` // 预设配置
TimeRules []*common.TimeRule `bson:"time_rules,omitempty"` // 时段规则
Pricing common.Pricing `bson:"pricing"` // 定价
RequestDataFormat int `bson:"request_data_format,omitempty"` // 请求数据格式[1:统一格式, 2:官方格式]
ResponseDataFormat int `bson:"response_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:权重]
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:"-"`
ProviderId string `bson:"provider_id,omitempty"` // 提供商ID
Name string `bson:"name,omitempty"` // 模型代理名称
BaseUrl string `bson:"base_url,omitempty"` // 模型代理地址
Path string `bson:"path"` // 模型代理地址路径
Weight int `bson:"weight"` // 权重
BillingMethods []int `bson:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
Models []string `bson:"models"` // 绑定模型
IsEnableModelReplace bool `bson:"is_enable_model_replace"` // 是否启用模型替换
ReplaceModels []string `bson:"replace_models"` // 替换模型
TargetModels []string `bson:"target_models"` // 目标模型
IsEnableHealthCheck bool `bson:"is_enable_health_check"` // 是否启用健康检查
IsRemoveAbnormalModel bool `bson:"is_remove_abnormal_model"` // 是否移除异常模型
AbnormalModels []string `bson:"abnormal_models"` // 异常模型
IsEnableSessionKeep bool `bson:"is_enable_session_keep"` // 是否启用会话保持
SessionKeepConfig *common.ModelAgentSessionKeep `bson:"session_keep_config,omitempty"` // 会话保持配置
IsNeverDisable bool `bson:"is_never_disable"` // 是否永不禁用
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 Notice ¶
type Notice struct {
gmeta.Meta `collection:"notice" bson:"-"`
Title string `bson:"title,omitempty"` // 标题
Content string `bson:"content,omitempty"` // 内容
Category string `bson:"category,omitempty"` // 分类[service:服务消息, activity:活动消息, safety:安全消息, maint:维护消息, product:产品消息, fault:故障消息]
Scope int `bson:"scope,omitempty"` // 通知范围[1:全部, 2:全部用户, 3:全部代理商, 4:指定用户, 5:指定代理商, 6:指定用户和代理商]
Users []int `bson:"users"` // 通知用户
Resellers []int `bson:"resellers"` // 通知代理商
Channels []string `bson:"channels,omitempty"` // 发送渠道[web:站内信, email:邮件]
IsPopup bool `bson:"is_popup"` // 是否弹窗
Priority int `bson:"priority,omitempty"` // 优先级
ExpiresAt int64 `bson:"expires_at,omitempty"` // 过期时间
ScheduledTime int64 `bson:"scheduled_time"` // 定时发布时间
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:发布, 2:草稿, 3:定时, 4:过期, -1:删除]
Variables []string `bson:"variables"` // 变量
Publisher int `bson:"publisher,omitempty"` // 发布人
PublishTime int64 `bson:"publish_time,omitempty"` // 发布时间
Rid int `bson:"rid,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 NoticeTemplate ¶
type NoticeTemplate struct {
gmeta.Meta `collection:"notice_template" bson:"-"`
Name string `bson:"name,omitempty"` // 名称
Scenes []string `bson:"scenes,omitempty"` // 使用场景[code:验证码, login:登录通知, register:注册通知, forget_password:找回密码, user_agreement:用户协议, privacy_policy:隐私政策, change_password:修改密码, change_email:修改邮箱, change_phone:修改手机号, quota_recharge:充值额度, quota_warning:额度不足提醒, quota_exhaustion:额度耗尽通知, quota_expire_warning:额度过期提醒, quota_expire:额度过期通知, notice:消息通知]
Title string `bson:"title,omitempty"` // 标题
Content string `bson:"content,omitempty"` // 内容
Channels []string `bson:"channels,omitempty"` // 适用渠道[web:站内信, email:邮件]
IsPopup bool `bson:"is_popup"` // 是否弹窗
IsPublic bool `bson:"is_public"` // 是否公开
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Variables []string `bson:"variables"` // 变量
UserId int `bson:"user_id,omitempty"` // 用户ID
Rid int `bson:"rid,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 Provider ¶
type Provider struct {
gmeta.Meta `collection:"provider" 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 Reseller ¶
type Reseller struct {
gmeta.Meta `collection:"reseller" 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"` // 手机号
Quota int `bson:"quota"` // 剩余额度
UsedQuota int `bson:"used_quota,omitempty"` // 已用额度
QuotaExpiresAt int64 `bson:"quota_expires_at"` // 额度过期时间
IsCycleResetQuota bool `bson:"is_cycle_reset_quota"` // 是否循环重置额度
ResetQuota int `bson:"reset_quota,omitempty"` // 重置额度
CyclePeriod int `bson:"cycle_period,omitempty"` // 循环周期
PeriodUnit string `bson:"period_unit,omitempty"` // 周期单位[hour:小时, day:天]
ResetMode string `bson:"reset_mode,omitempty"` // 重置模式[natural:自然周期, relative:相对周期]
ResetAt int64 `bson:"reset_at"` // 重置时间
NextResetAt int64 `bson:"next_reset_at"` // 下次重置时间
Groups []string `bson:"groups"` // 分组权限
QuotaWarning bool `bson:"quota_warning"` // 额度预警开关
WarningThreshold int `bson:"warning_threshold,omitempty"` // 预警阈值, 单位: $
ExpireWarningThreshold time.Duration `bson:"expire_warning_threshold,omitempty"` // 过期预警阈值, 单位: 天
WarningNotice bool `bson:"warning_notice"` // 预警通知
ExhaustionNotice bool `bson:"exhaustion_notice"` // 耗尽通知
ExpireWarningNotice bool `bson:"expire_warning_notice"` // 额度过期预警通知
ExpireNotice bool `bson:"expire_notice"` // 额度过期通知
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 ResellerAccount ¶
type ResellerAccount struct {
gmeta.Meta `collection:"reseller_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"` // 登录时间
LoginDomain string `bson:"login_domain,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 SiteConfig ¶
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"` // 注册支持的邮箱后缀
DefaultLanguage string `bson:"default_language"` // 默认语言[zh-CN:简体中文, zh-TW:繁體中文, en-US:English]
CurrencySymbol string `bson:"currency_symbol"` // 货币符号
RegisterWelcome string `bson:"register_welcome"` // 注册欢迎语
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"` // 文档
RechargeTips string `bson:"recharge_tips"` // 充值提示
Remark string `bson:"remark"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
UserId int `bson:"user_id,omitempty"` // 用户ID
Rid int `bson:"rid,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 ¶
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"` // 模型统计数据
Rid int `bson:"rid,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 StatisticsAppKey ¶
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"` // 模型统计数据
Rid int `bson:"rid,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 StatisticsUser ¶
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"` // 模型统计数据
Rid int `bson:"rid,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 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 SysConfig ¶
type SysConfig struct {
gmeta.Meta `collection:"sys_config" bson:"-"`
Core *common.Core `bson:"core,omitempty"` // 核心
Http *common.Http `bson:"http,omitempty"` // HTTP
Email *common.Email `bson:"email,omitempty"` // 邮箱
Statistics *common.Statistics `bson:"statistics,omitempty"` // 统计
Base *common.Base `bson:"base,omitempty"` // 基础
Midjourney *common.Midjourney `bson:"midjourney,omitempty"` // Midjourney
Log *common.Log `bson:"log,omitempty"` // 日志
UserLoginRegister *common.UserLoginRegister `bson:"user_login_register,omitempty"` // 用户登录注册
UserShieldError *common.UserShieldError `bson:"user_shield_error,omitempty"` // 用户屏蔽错误
ResellerLoginRegister *common.ResellerLoginRegister `bson:"reseller_login_register,omitempty"` // 代理商登录注册
ResellerShieldError *common.ResellerShieldError `bson:"reseller_shield_error,omitempty"` // 代理商屏蔽错误
AdminLogin *common.AdminLogin `bson:"admin_login,omitempty"` // 管理员登录
AutoDisabledError *common.AutoDisabledError `bson:"auto_disabled_error,omitempty"` // 自动禁用错误
AutoEnableError *common.AutoEnableError `bson:"auto_enable_error,omitempty"` // 自动启用错误
NotRetryError *common.NotRetryError `bson:"not_retry_error,omitempty"` // 不重试错误
NotShieldError *common.NotShieldError `bson:"not_shield_error,omitempty"` // 不屏蔽错误
Notice *common.Notice `bson:"notice,omitempty"` // 通知
Quota *common.Quota `bson:"quota,omitempty"` // 额度
QuotaTask *common.QuotaTask `bson:"quota_task,omitempty"` // 额度任务
VideoTask *common.VideoTask `bson:"video_task,omitempty"` // 视频任务
FileTask *common.FileTask `bson:"file_task,omitempty"` // 文件任务
BatchTask *common.BatchTask `bson:"batch_task,omitempty"` // 批处理任务
ResetTask *common.ResetTask `bson:"reset_task,omitempty"` // 重置任务
ModelAgentHealthCheckTask *common.ModelAgentHealthCheckTask `bson:"model_agent_health_check_task,omitempty"` // 模型代理健康检查任务
ModelAgentSessionKeep *common.ModelAgentSessionKeep `bson:"model_agent_session_keep,omitempty"` // 会话保持
ModelAgentSessionKeepTask *common.ModelAgentSessionKeepTask `bson:"model_agent_session_keep_task,omitempty"` // 会话保持清理任务
GeneralApi *common.GeneralApi `bson:"general_api,omitempty"` // 通用API
Test *common.Test `bson:"test,omitempty"` // 测试
Debug *common.Debug `bson:"debug,omitempty"` // 调试
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
type TaskBatch ¶
type TaskBatch struct {
gmeta.Meta `collection:"task_batch" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Model string `bson:"model,omitempty"` // 模型
BatchId string `bson:"batch_id,omitempty"` // 批处理ID
InputFileId string `bson:"input_file_id,omitempty"` // 输入文件ID
OutputFileId string `bson:"output_file_id,omitempty"` // 输出文件ID
ErrorFileId string `bson:"error_file_id,omitempty"` // 错误文件ID
Status string `bson:"status,omitempty"` // 状态[validating:验证中, in_progress:进行中, finalizing:定稿中, completed:已完成, cancelling:取消中, cancelled:已取消, failed:已失败, expired:已过期, deleted:已删除]
InProgressAt int64 `bson:"in_progress_at,omitempty"` // 进行时间
FinalizingAt int64 `bson:"finalizing_at,omitempty"` // 定稿时间
CompletedAt int64 `bson:"completed_at,omitempty"` // 完成时间
ExpiresAt int64 `bson:"expires_at,omitempty"` // 过期时间
CancellingAt int64 `bson:"cancelling_at,omitempty"` // 取消时间
CancelledAt int64 `bson:"cancelled_at,omitempty"` // 已取消时间
FailedAt int64 `bson:"failed_at,omitempty"` // 失败时间
ResponseData map[string]any `bson:"response_data,omitempty"` // 响应数据
Error map[string]any `bson:"error,omitempty"` // 错误信息
Rid int `bson:"rid,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 TaskFile ¶
type TaskFile struct {
gmeta.Meta `collection:"task_file" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Model string `bson:"model,omitempty"` // 模型
Purpose string `bson:"purpose,omitempty"` // 用途[assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results, vision, user_data]
FileId string `bson:"file_id,omitempty"` // 文件ID
FileName string `bson:"file_name,omitempty"` // 文件名
Bytes int `bson:"bytes,omitempty"` // 文件大小
FileUrl string `bson:"file_url,omitempty"` // 文件地址
Status string `bson:"status,omitempty"` // 状态[uploaded:已上传, processing:处理中, processed:已处理, error:已失败, expired:已过期, deleted:已删除]
ExpiresAt int64 `bson:"expires_at,omitempty"` // 过期时间
FilePath string `bson:"file_path,omitempty"` // 文件路径
ResponseData map[string]any `bson:"response_data,omitempty"` // 响应数据
Error *serrors.ApiError `bson:"error,omitempty"` // 错误信息
BatchTraceId string `bson:"batch_trace_id,omitempty"` // 批处理日志ID
Rid int `bson:"rid,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 TaskVideo ¶
type TaskVideo struct {
gmeta.Meta `collection:"task_video" bson:"-"`
TraceId string `bson:"trace_id,omitempty"` // 日志ID
UserId int `bson:"user_id,omitempty"` // 用户ID
AppId int `bson:"app_id,omitempty"` // 应用ID
Model string `bson:"model,omitempty"` // 模型
VideoId string `bson:"video_id,omitempty"` // 视频ID
Width int `bson:"width,omitempty"` // 宽度
Height int `bson:"height,omitempty"` // 高度
Seconds int `bson:"seconds,omitempty"` // 秒数
Prompt string `bson:"prompt,omitempty"` // 提示
Progress int `bson:"progress,omitempty"` // 进度
RemixedFromVideoId string `bson:"remixed_from_video_id,omitempty"` // 混合ID
Status string `bson:"status,omitempty"` // 状态[queued:排队中, in_progress:进行中, completed:已完成, failed:已失败, expired:已过期, deleted:已删除]
CompletedAt int64 `bson:"completed_at,omitempty"` // 完成时间
ExpiresAt int64 `bson:"expires_at,omitempty"` // 过期时间
VideoUrl string `bson:"video_url,omitempty"` // 视频地址
FileName string `bson:"file_name,omitempty"` // 文件名
FilePath string `bson:"file_path,omitempty"` // 文件路径
ResponseData map[string]any `bson:"response_data,omitempty"` // 响应数据
Error *smodel.VideoError `bson:"error,omitempty"` // 错误信息
Rid int `bson:"rid,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 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"` // 手机号
Quota int `bson:"quota"` // 剩余额度
UsedQuota int `bson:"used_quota,omitempty"` // 已用额度
QuotaExpiresAt int64 `bson:"quota_expires_at"` // 额度过期时间
IsCycleResetQuota bool `bson:"is_cycle_reset_quota"` // 是否循环重置额度
ResetQuota int `bson:"reset_quota,omitempty"` // 重置额度
CyclePeriod int `bson:"cycle_period,omitempty"` // 循环周期
PeriodUnit string `bson:"period_unit,omitempty"` // 周期单位[hour:小时, day:天]
ResetMode string `bson:"reset_mode,omitempty"` // 重置模式[natural:自然周期, relative:相对周期]
ResetAt int64 `bson:"reset_at"` // 重置时间
NextResetAt int64 `bson:"next_reset_at"` // 下次重置时间
Groups []string `bson:"groups"` // 分组权限
QuotaWarning bool `bson:"quota_warning"` // 额度预警开关
WarningThreshold int `bson:"warning_threshold,omitempty"` // 预警阈值, 单位: $
ExpireWarningThreshold time.Duration `bson:"expire_warning_threshold,omitempty"` // 过期预警阈值, 单位: 天
WarningNotice bool `bson:"warning_notice"` // 预警通知
ExhaustionNotice bool `bson:"exhaustion_notice"` // 耗尽通知
ExpireWarningNotice bool `bson:"expire_warning_notice"` // 额度过期预警通知
ExpireNotice bool `bson:"expire_notice"` // 额度过期通知
Remark string `bson:"remark,omitempty"` // 备注
Status int `bson:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Rid int `bson:"rid,omitempty"` // 代理商ID
Creator string `bson:"creator,omitempty"` // 创建人
Updater string `bson:"updater,omitempty"` // 更新人
CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间
}
Source Files
¶
- app.go
- app_key.go
- finance.go
- group.go
- key.go
- log_audio.go
- log_batch.go
- log_file.go
- log_general.go
- log_image.go
- log_midjourney.go
- log_text.go
- log_video.go
- model.go
- model_agent.go
- notice.go
- notice_template.go
- provider.go
- reseller.go
- site_config.go
- statistics.go
- sys_admin.go
- sys_config.go
- task_batch.go
- task_file.go
- task_video.go
- user.go
Click to show internal directories.
Click to hide internal directories.