Documentation
¶
Overview ¶
Package controller Agent Marketplace L1(技能注册中心)
目录 API:
- GET /api/marketplace/skills 公开,列表(非管理员强制 status=published)
- GET /api/marketplace/skills/:id 公开,详情(非管理员不可见非 published)
- GET /api/marketplace/skills/:id/download 公开,计数 +1 后 302 跳 download_url
- POST /api/marketplace/skills AdminAuth(),发布/注册
响应体统一 {success, message, data},与全仓库 GetSelf 一致。
Package controller Repository 访问辅助函数 所有 controller 文件通过此文件共享 repository 访问器
Copyright (C) 2023-2026 FastToken ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact hello@fasttoken.example.com
Index ¶
- func AddChannel(c *gin.Context)
- func AddRedemption(c *gin.Context)
- func AddToken(c *gin.Context)
- func AdminApproveEnterprise(c *gin.Context)
- func AdminClearUserBinding(c *gin.Context)
- func AdminCompleteTopUp(c *gin.Context)
- func AdminCreateEnterprise(c *gin.Context)
- func AdminCreateGroupRatio(c *gin.Context)
- func AdminCreateInvitationCode(c *gin.Context)
- func AdminDeleteGroupRatio(c *gin.Context)
- func AdminDeleteInvitationCode(c *gin.Context)
- func AdminExpireTopUps(c *gin.Context)
- func AdminGetAllGifts(c *gin.Context)
- func AdminGetEnterpriseWallet(c *gin.Context)
- func AdminGetInvitationCodeStats(c *gin.Context)
- func AdminListEnterprises(c *gin.Context)
- func AdminListGroupRatios(c *gin.Context)
- func AdminListInvitationCodes(c *gin.Context)
- func AdminRechargeEnterpriseWallet(c *gin.Context)
- func AdminRefundTopUp(c *gin.Context)
- func AdminRejectEnterprise(c *gin.Context)
- func AdminUpdateGiftStatus(c *gin.Context)
- func AdminUpdateGroupRatio(c *gin.Context)
- func AlipayNotify(c *gin.Context)
- func AlipayReconcile(c *gin.Context)
- func AlipayReturn(c *gin.Context)
- func ApplyAllChannelUpstreamModelUpdates(c *gin.Context)
- func ApplyChannelUpstreamModelUpdates(c *gin.Context)
- func AutomaticallyTestChannels()
- func AutomaticallyUpdateChannels(frequency int)
- func BatchSetChannelTag(c *gin.Context)
- func BeginPasskeyLogin(c *gin.Context)
- func BeginPasskeyRegistration(c *gin.Context)
- func BeginPasskeyVerification(c *gin.Context)
- func BindPhone(c *gin.Context)
- func BindWeChat(c *gin.Context)
- func ChannelListModels(c *gin.Context)
- func CheckClusterNameAvailability(c *gin.Context)
- func CleanupLogFiles(c *gin.Context)
- func ClearChannelAffinityCache(c *gin.Context)
- func ClearDiskCache(c *gin.Context)
- func CompleteCodexOAuth(c *gin.Context)
- func CompleteCodexOAuthForChannel(c *gin.Context)
- func ConfirmPaymentCompliance(c *gin.Context)
- func CopyChannel(c *gin.Context)
- func CreateActivity(c *gin.Context)
- func CreateCustomOAuthProvider(c *gin.Context)
- func CreateDeployment(c *gin.Context)
- func CreateModelMeta(c *gin.Context)
- func CreatePrefillGroup(c *gin.Context)
- func CreateUser(c *gin.Context)
- func CreateUserWebhook(c *gin.Context)
- func CreateVendorMeta(c *gin.Context)
- func DashboardListModels(c *gin.Context)
- func DeleteActivity(c *gin.Context)
- func DeleteChannel(c *gin.Context)
- func DeleteChannelBatch(c *gin.Context)
- func DeleteCustomOAuthProvider(c *gin.Context)
- func DeleteDeployment(c *gin.Context)
- func DeleteDisabledChannel(c *gin.Context)
- func DeleteHistoryLogs(c *gin.Context)
- func DeleteInvalidRedemption(c *gin.Context)
- func DeleteModelMeta(c *gin.Context)
- func DeletePasskey(c *gin.Context)
- func DeletePrefillGroup(c *gin.Context)
- func DeleteRedemption(c *gin.Context)
- func DeleteSelf(c *gin.Context)
- func DeleteToken(c *gin.Context)
- func DeleteTokenBatch(c *gin.Context)
- func DeleteUiSkin(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func DeleteUserWebhook(c *gin.Context)
- func DeleteVendorMeta(c *gin.Context)
- func DetectAllChannelUpstreamModelUpdates(c *gin.Context)
- func DetectChannelUpstreamModelUpdates(c *gin.Context)
- func DisableTagChannels(c *gin.Context)
- func DiscoverOIDCEndpoints(c *gin.Context)
- func DoCheckin(c *gin.Context)
- func DownloadMarketplaceSkill(c *gin.Context)
- func EditTagChannels(c *gin.Context)
- func EmailBind(c *gin.Context)
- func EnableTagChannels(c *gin.Context)
- func EnabledListModels(c *gin.Context)
- func EnterpriseCreateUser(c *gin.Context)
- func EnterpriseDeleteUser(c *gin.Context)
- func EnterpriseListUsers(c *gin.Context)
- func EnterpriseUpdateUserQuota(c *gin.Context)
- func ExportAllLogs(c *gin.Context)
- func ExportAllTasks(c *gin.Context)
- func ExportEnterprises(c *gin.Context)
- func ExportGifts(c *gin.Context)
- func ExportRedemptions(c *gin.Context)
- func ExportTokens(c *gin.Context)
- func ExportUserLogs(c *gin.Context)
- func ExportUserTasks(c *gin.Context)
- func ExtendDeployment(c *gin.Context)
- func FetchModels(c *gin.Context)
- func FetchUpstreamModels(c *gin.Context)
- func FetchUpstreamRatios(c *gin.Context)
- func FinishPasskeyLogin(c *gin.Context)
- func FinishPasskeyRegistration(c *gin.Context)
- func FinishPasskeyVerification(c *gin.Context)
- func FixChannelsAbilities(c *gin.Context)
- func ForceGC(c *gin.Context)
- func GenerateAccessToken(c *gin.Context)
- func GenerateOAuthCode(c *gin.Context)
- func Get2FAStatus(c *gin.Context)
- func GetAbout(c *gin.Context)
- func GetAffCode(c *gin.Context)
- func GetAllChannels(c *gin.Context)
- func GetAllDeployments(c *gin.Context)
- func GetAllLogs(c *gin.Context)
- func GetAllMidjourney(c *gin.Context)
- func GetAllModelsMeta(c *gin.Context)
- func GetAllQuotaDates(c *gin.Context)
- func GetAllRedemptions(c *gin.Context)
- func GetAllTask(c *gin.Context)
- func GetAllTokens(c *gin.Context)
- func GetAllTopUps(c *gin.Context)
- func GetAllUsers(c *gin.Context)
- func GetAllVendors(c *gin.Context)
- func GetAuthHeader(token string) http.Header
- func GetAvailableReplicas(c *gin.Context)
- func GetBindings(c *gin.Context)
- func GetChannel(c *gin.Context)
- func GetChannelAffinityCacheStats(c *gin.Context)
- func GetChannelAffinityUsageCacheStats(c *gin.Context)
- func GetChannelKey(c *gin.Context)
- func GetCheckinStatus(c *gin.Context)
- func GetClaudeAuthHeader(token string) http.Header
- func GetCodexChannelUsage(c *gin.Context)
- func GetContainerDetails(c *gin.Context)
- func GetCustomOAuthProvider(c *gin.Context)
- func GetDeployment(c *gin.Context)
- func GetDeploymentLogs(c *gin.Context)
- func GetEnterpriseWalletTopUpStatus(c *gin.Context)
- func GetGroups(c *gin.Context)
- func GetHardwareTypes(c *gin.Context)
- func GetHomePageContent(c *gin.Context)
- func GetI18nMessages(c *gin.Context)
- func GetImage(c *gin.Context)
- func GetLocations(c *gin.Context)
- func GetLogByKey(c *gin.Context)
- func GetLogFiles(c *gin.Context)
- func GetLogsSelfStat(c *gin.Context)
- func GetLogsStat(c *gin.Context)
- func GetMarketplaceSkill(c *gin.Context)
- func GetMidjourney(c *gin.Context)
- func GetMissingModels(c *gin.Context)
- func GetModelDeploymentSettings(c *gin.Context)
- func GetModelMeta(c *gin.Context)
- func GetModelPricings(c *gin.Context)
- func GetMyTenantInfo(c *gin.Context)
- func GetMyTenantMembers(c *gin.Context)
- func GetMyTenantWallet(c *gin.Context)
- func GetNotice(c *gin.Context)
- func GetOptions(c *gin.Context)
- func GetPasskeyStatus(c *gin.Context)
- func GetPerfMetrics(c *gin.Context)
- func GetPerfMetricsSummary(c *gin.Context)
- func GetPerformanceStats(c *gin.Context)
- func GetPrefillGroups(c *gin.Context)
- func GetPriceEstimation(c *gin.Context)
- func GetPricing(c *gin.Context)
- func GetPrivacyPolicy(c *gin.Context)
- func GetQuotaDatesByUser(c *gin.Context)
- func GetRankings(c *gin.Context)
- func GetRatioConfig(c *gin.Context)
- func GetRedemption(c *gin.Context)
- func GetResponseBody(method, url string, channel *model.Channel, headers http.Header) ([]byte, error)
- func GetSelf(c *gin.Context)
- func GetSetup(c *gin.Context)
- func GetStatus(c *gin.Context)
- func GetSubscriptionPlans(c *gin.Context)
- func GetSyncableChannels(c *gin.Context)
- func GetTagModels(c *gin.Context)
- func GetTenantWalletTxns(c *gin.Context)
- func GetToken(c *gin.Context)
- func GetTokenKey(c *gin.Context)
- func GetTokenKeysBatch(c *gin.Context)
- func GetTokenStatus(c *gin.Context)
- func GetTokenUsage(c *gin.Context)
- func GetTopUpInfo(c *gin.Context)
- func GetTopupGiftBonus(c *gin.Context)
- func GetTwoFAStatus(c *gin.Context)
- func GetUiSkins(c *gin.Context)
- func GetUptimeKumaStatus(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUserAgreement(c *gin.Context)
- func GetUserGifts(c *gin.Context)
- func GetUserGroups(c *gin.Context)
- func GetUserLogs(c *gin.Context)
- func GetUserMidjourney(c *gin.Context)
- func GetUserModels(c *gin.Context)
- func GetUserOAuthBindings(c *gin.Context)
- func GetUserOAuthBindingsByAdmin(c *gin.Context)
- func GetUserQuotaDates(c *gin.Context)
- func GetUserSubscription(c *gin.Context)
- func GetUserTask(c *gin.Context)
- func GetUserTopUps(c *gin.Context)
- func GetUserWebhooks(c *gin.Context)
- func GetVendorMeta(c *gin.Context)
- func GrantTenantWalletQuota(c *gin.Context)
- func HandleOAuth(c *gin.Context)
- func InitPaymentAtStartup()
- func KlingImage2VideoGenerations(c *gin.Context)
- func KlingImage2videoTaskId(c *gin.Context)
- func KlingText2VideoGenerations(c *gin.Context)
- func KlingText2videoTaskId(c *gin.Context)
- func LinkAccount(c *gin.Context)
- func ListActivities(c *gin.Context)
- func ListCustomOAuthProviders(c *gin.Context)
- func ListDeploymentContainers(c *gin.Context)
- func ListI18nLocales(c *gin.Context)
- func ListMarketplaceSkills(c *gin.Context)
- func ListModels(c *gin.Context, modelType int)
- func ListUiSkins(c *gin.Context)
- func LockOrder(tradeNo string)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func ManageMultiKeys(c *gin.Context)
- func ManageUser(c *gin.Context)
- func MigrateConsoleSetting(c *gin.Context)
- func OllamaDeleteModel(c *gin.Context)
- func OllamaPullModel(c *gin.Context)
- func OllamaPullModelStream(c *gin.Context)
- func OllamaVersion(c *gin.Context)
- func PaymentStatus(c *gin.Context)
- func PhoneLogin(c *gin.Context)
- func PhoneRegister(c *gin.Context)
- func PhoneSendCode(c *gin.Context)
- func PhoneVerifyCode(c *gin.Context)
- func Playground(c *gin.Context)
- func Post2FADisable(c *gin.Context)
- func Post2FAEnable(c *gin.Context)
- func Post2FARegenerateBackup(c *gin.Context)
- func Post2FASetup(c *gin.Context)
- func PostSetup(c *gin.Context)
- func PublishMarketplaceSkill(c *gin.Context)
- func QueryAlipayOrder(c *gin.Context)
- func QueryWechatOrder(c *gin.Context)
- func RecycleTenantWalletQuota(c *gin.Context)
- func RefreshCodexChannelCredential(c *gin.Context)
- func Register(c *gin.Context)
- func Relay(c *gin.Context, relayFormat types.RelayFormat)
- func RelayMidjourney(c *gin.Context)
- func RelayNotFound(c *gin.Context)
- func RelayNotImplemented(c *gin.Context)
- func RelayTask(c *gin.Context)
- func RelayTaskFetch(c *gin.Context)
- func ReloadConfig(c *gin.Context)
- func RequestAlipayAmount(c *gin.Context)
- func RequestAlipayPay(c *gin.Context)
- func RequestEnterpriseWalletTopUp(c *gin.Context)
- func RequestWechatAmount(c *gin.Context)
- func RequestWechatPay(c *gin.Context)
- func ResetModelRatio(c *gin.Context)
- func ResetPassword(c *gin.Context)
- func ResetPerformanceStats(c *gin.Context)
- func RetrieveModel(c *gin.Context, modelType int)
- func SearchAllLogs(c *gin.Context)deprecated
- func SearchChannels(c *gin.Context)
- func SearchDeployments(c *gin.Context)
- func SearchModelsMeta(c *gin.Context)
- func SearchRedemptions(c *gin.Context)
- func SearchTokens(c *gin.Context)
- func SearchUserLogs(c *gin.Context)
- func SearchUsers(c *gin.Context)
- func SearchVendors(c *gin.Context)
- func SendEmailVerification(c *gin.Context)
- func SendPasswordResetEmail(c *gin.Context)
- func StartChannelUpstreamModelUpdateTask()
- func StartCodexOAuth(c *gin.Context)
- func StartCodexOAuthForChannel(c *gin.Context)
- func SyncUpstreamModels(c *gin.Context)
- func SyncUpstreamPreview(c *gin.Context)
- func TestAllChannels(c *gin.Context)
- func TestChannel(c *gin.Context)
- func TestIoNetConnection(c *gin.Context)
- func TestStatus(c *gin.Context)
- func TopUp(c *gin.Context)
- func TransferAffQuota(c *gin.Context)
- func UnbindCustomOAuth(c *gin.Context)
- func UnbindCustomOAuthByAdmin(c *gin.Context)
- func UnbindPhone(c *gin.Context)
- func UnbindWeChat(c *gin.Context)
- func UnlockOrder(tradeNo string)
- func UpdateActivity(c *gin.Context)
- func UpdateAllChannelBalances() error
- func UpdateAllChannelsBalance(c *gin.Context)
- func UpdateChannel(c *gin.Context)
- func UpdateChannelBalance(c *gin.Context)
- func UpdateCustomOAuthProvider(c *gin.Context)
- func UpdateDeployment(c *gin.Context)
- func UpdateDeploymentName(c *gin.Context)
- func UpdateI18nMessages(c *gin.Context)
- func UpdateMidjourneyTaskBulk()
- func UpdateModelMeta(c *gin.Context)
- func UpdateModelPricing(c *gin.Context)
- func UpdateOption(c *gin.Context)
- func UpdatePrefillGroup(c *gin.Context)
- func UpdateRedemption(c *gin.Context)
- func UpdateSelf(c *gin.Context)
- func UpdateTaskBulk()
- func UpdateToken(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func UpdateUserSetting(c *gin.Context)
- func UpdateUserWebhook(c *gin.Context)
- func UpdateVendorMeta(c *gin.Context)
- func UpdateVideoTaskAll(ctx context.Context, platform constant.TaskPlatform, ...) error
- func UploadFile(c *gin.Context)
- func UpsertUiSkin(c *gin.Context)
- func UserGetMembershipInfo(c *gin.Context)
- func UserUseInvitationCode(c *gin.Context)
- func VideoGenerations(c *gin.Context)
- func VideoGenerationsTaskId(c *gin.Context)
- func VideoProxy(c *gin.Context)
- func WebSocketHandler(c *gin.Context)
- func WechatNotify(c *gin.Context)
- func WechatReconcile(c *gin.Context)
- type AIProxyUserOverviewResponse
- type APGC2DGPTUsageResponse
- type API2GPTUsageResponse
- type AddChannelRequest
- type AdminCompleteTopupRequest
- type AlipayAdaptor
- type AlipayPayRequest
- type AlipayReconcileItem
- type BindPhoneRequest
- type BindWeChatRequest
- type ChannelBatch
- type ChannelTag
- type DeepSeekUsageResponse
- type DiskCacheInfo
- type I18nBulkRequest
- type KeyStatus
- type KlingCameraConfig
- type KlingCameraControl
- type KlingImage2VideoRequest
- type KlingText2VideoRequest
- type LogFileInfo
- type LogFilesResponse
- type LoginRequest
- type ManageRequest
- type MemoryStats
- type Monitor
- type MultiKeyManageRequest
- type MultiKeyStatusResponse
- type OAuthRegistrationDisabledError
- type OAuthUserDeletedError
- type OpenAICreditGrants
- type OpenAIModel
- type OpenAIModelsResponse
- type OpenAISBUsageResponse
- type OpenAISubscriptionResponse
- type OpenAIUsageDailyCost
- type OpenAIUsageResponse
- type OpenRouterCreditResponse
- type OptionUpdateRequest
- type PasswordResetRequest
- type PatchChannel
- type PaymentComplianceRequest
- type PerformanceConfig
- type PerformanceStats
- type QueryAlipayOrderRequest
- type QueryWechatOrderRequest
- type Setup
- type SetupRequest
- type SiliconFlowUsageResponse
- type SkillPublishRequest
- type TokenBatch
- type TransferAffQuotaRequest
- type UiSkinRequest
- type UnbindPhoneRequest
- type UnbindWeChatRequest
- type UpdateUserSettingRequest
- type UptimeGroupResult
- type WechatAdaptor
- type WechatPayRequest
- type WechatReconcileItem
- type WechatVerifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddChannel ¶
func AddRedemption ¶
func AdminApproveEnterprise ¶
func AdminClearUserBinding ¶
func AdminCreateEnterprise ¶
func AdminCreateGroupRatio ¶
AdminCreateGroupRatio creates a new group ratio record. POST /api/group-ratio/
func AdminDeleteGroupRatio ¶
AdminDeleteGroupRatio deletes a group ratio record. DELETE /api/group-ratio/:id
func AdminExpireTopUps ¶
AdminExpireTopUps 管理员手动触发过期清理,将超时的 Pending 订单标记为 Expired。
func AdminGetAllGifts ¶
AdminGetAllGifts 管理员获取所有礼物记录(支持状态筛选+分页)
func AdminGetEnterpriseWallet ¶
AdminGetEnterpriseWallet 平台管理员查看企业钱包概况。 GET /api/enterprise/:id/wallet
func AdminListEnterprises ¶
func AdminListGroupRatios ¶
AdminListGroupRatios returns all group ratio records. GET /api/group-ratio/
func AdminRechargeEnterpriseWallet ¶
AdminRechargeEnterpriseWallet 平台管理员为企业主钱包授信充值。 POST /api/enterprise/:id/wallet/recharge {"quota":10000000,"remark":"线下打款"}
func AdminRefundTopUp ¶
AdminRefundTopUp 管理员退款接口:冲销一笔成功充值订单的配额与返利。 仅做平台内额度冲销,不触发支付网关实际退款。
func AdminRejectEnterprise ¶
func AdminUpdateGiftStatus ¶
AdminUpdateGiftStatus 管理员更新礼物状态
func AdminUpdateGroupRatio ¶
AdminUpdateGroupRatio updates an existing group ratio record. PUT /api/group-ratio/:id
func AlipayNotify ¶
AlipayNotify handles the Alipay asynchronous callback notification.
func AlipayReturn ¶
AlipayReturn 支付宝回跳接口:用户从支付宝支付完成后跳回时, 立即向支付宝查单并在已支付时入账,随后重定向到前端页面。 该接口由支付宝重定向用户浏览器触发(无登录态),因此注册为公开 GET 路由。
func AutomaticallyTestChannels ¶
func AutomaticallyTestChannels()
func AutomaticallyUpdateChannels ¶
func AutomaticallyUpdateChannels(frequency int)
func BatchSetChannelTag ¶
func BeginPasskeyLogin ¶
BeginPasskeyLogin starts the WebAuthn login ceremony (discovery-based / passwordless)
func BeginPasskeyRegistration ¶
BeginPasskeyRegistration starts the WebAuthn registration ceremony
func BeginPasskeyVerification ¶
BeginPasskeyVerification starts the WebAuthn verification ceremony for an already logged-in user
func ChannelListModels ¶
func CompleteCodexOAuth ¶
func CopyChannel ¶
func CreateCustomOAuthProvider ¶
CreateCustomOAuthProvider creates a new custom OAuth provider
func CreateDeployment ¶
func CreateUser ¶
func CreateUserWebhook ¶
CreateUserWebhook creates a new webhook for the authenticated user. POST /api/webhook/
func DashboardListModels ¶
func DeleteChannel ¶
func DeleteChannelBatch ¶
func DeleteCustomOAuthProvider ¶
DeleteCustomOAuthProvider deletes a custom OAuth provider
func DeleteDeployment ¶
func DeleteDisabledChannel ¶
func DeleteHistoryLogs ¶
DeleteHistoryLogs deletes old log entries. Only available to admin users.
func DeleteInvalidRedemption ¶
func DeletePasskey ¶
DeletePasskey deletes a specific passkey credential for the authenticated user
func DeleteRedemption ¶
func DeleteSelf ¶
func DeleteToken ¶
func DeleteTokenBatch ¶
func DeleteUser ¶
func DeleteUserWebhook ¶
DeleteUserWebhook deletes a webhook. DELETE /api/webhook/:id
func DisableTagChannels ¶
func DiscoverOIDCEndpoints ¶
DiscoverOIDCEndpoints discovers OIDC endpoints from well-known URL
func DownloadMarketplaceSkill ¶
DownloadMarketplaceSkill 下载技能包(公开):计数 +1 后 302 跳转到 download_url。 计数失败只记日志、不阻断下载——下载可用性优先于统计准确性。
func EditTagChannels ¶
func EnableTagChannels ¶
func EnabledListModels ¶
func EnterpriseCreateUser ¶
EnterpriseCreateUser adds a sub-user to an enterprise with a quota allocation. POST /api/enterprise/:id/users
func EnterpriseDeleteUser ¶
EnterpriseDeleteUser removes a sub-user from an enterprise. DELETE /api/enterprise/:id/users/:uid
func EnterpriseListUsers ¶
EnterpriseListUsers lists all sub-users for an enterprise. GET /api/enterprise/:id/users
func EnterpriseUpdateUserQuota ¶
EnterpriseUpdateUserQuota updates the quota for a sub-user. PUT /api/enterprise/:id/users/:uid
func ExportAllLogs ¶
ExportAllLogs 管理员导出全部使用日志(CSV,不含 Content 字段)。
func ExportAllTasks ¶
ExportAllTasks 管理员导出全部任务日志(CSV,不含 Data/PrivateData)。
func ExportEnterprises ¶
ExportEnterprises 超级管理员导出企业认证列表(CSV)。
func ExportRedemptions ¶
ExportRedemptions 导出兑换码(CSV,Key 脱敏),支持 keyword 筛选。
func ExtendDeployment ¶
func FetchModels ¶
func FetchUpstreamModels ¶
func FetchUpstreamRatios ¶
func FinishPasskeyLogin ¶
FinishPasskeyLogin completes the WebAuthn login ceremony
func FinishPasskeyRegistration ¶
FinishPasskeyRegistration completes the WebAuthn registration ceremony
func FinishPasskeyVerification ¶
FinishPasskeyVerification completes the WebAuthn verification ceremony
func FixChannelsAbilities ¶
func GenerateAccessToken ¶
func GenerateOAuthCode ¶
GenerateOAuthCode generates a state code for OAuth CSRF protection
func Get2FAStatus ¶
func GetAffCode ¶
func GetAllChannels ¶
func GetAllDeployments ¶
func GetAllLogs ¶
func GetAllMidjourney ¶
func GetAllQuotaDates ¶
func GetAllRedemptions ¶
func GetAllTask ¶
func GetAllTokens ¶
func GetAllUsers ¶
func GetAuthHeader ¶
func GetAvailableReplicas ¶
func GetChannel ¶
func GetChannelKey ¶
GetChannelKey 获取渠道密钥(需要通过安全验证中间件) 此函数依赖 SecureVerificationRequired 中间件,确保用户已通过安全验证
func GetClaudeAuthHeader ¶
GetClaudeAuthHeader get claude auth header
func GetCodexChannelUsage ¶
func GetContainerDetails ¶
func GetCustomOAuthProvider ¶
GetCustomOAuthProvider returns a single custom OAuth provider
func GetDeployment ¶
func GetDeploymentLogs ¶
func GetEnterpriseWalletTopUpStatus ¶
GetEnterpriseWalletTopUpStatus 企业钱包充值订单状态查询。 GET /api/user/tenant/wallet/topup/status?trade_no=xxx
func GetHardwareTypes ¶
func GetHomePageContent ¶
func GetI18nMessages ¶
GetI18nMessages 返回某 locale 的运行时覆盖文案(前端本地化合并用)。公开端点。
func GetLocations ¶
func GetLogByKey ¶
GetLogByKey retrieves a single log entry by its request_id (the :key route param). This is used by the frontend to view details of a specific API request.
func GetLogsSelfStat ¶
func GetLogsStat ¶
func GetMarketplaceSkill ¶
GetMarketplaceSkill 技能详情(公开)。 非管理员访问非 published 技能一律返回 404,避免泄露草稿版本的存在性。
func GetMidjourney ¶
func GetMissingModels ¶
GetMissingModels returns the list of model names that are referenced by channels but do not have corresponding records in the models meta table. This helps administrators quickly discover models that need configuration.
func GetModelPricings ¶
GetModelPricings 返回全部模型定价(管理员查看/编辑)。数据为数据库真相源。
func GetMyTenantInfo ¶
GetMyTenantInfo 返回当前用户所属企业的公开信息。 GET /api/user/tenant/info 未入企(enterprise_id == 0)时返回 {joined:false},属正常状态而非错误。
func GetMyTenantMembers ¶
GetMyTenantMembers 返回当前用户所属企业的成员名单(脱敏 + 分页)。 GET /api/user/tenant/members?p=1&page_size=20 未入企时返回空列表且 joined=false,不报错。
func GetMyTenantWallet ¶
GetMyTenantWallet 返回当前用户的企业钱包视图。 GET /api/user/tenant/wallet 普通成员只看到自己的余额;企业管理员额外看到企业主钱包余额。
func GetOptions ¶
func GetPasskeyStatus ¶
GetPasskeyStatus returns the user's passkey status and credentials
func GetPerfMetrics ¶
func GetPerfMetricsSummary ¶
func GetPrefillGroups ¶
GetPrefillGroups 获取预填组列表,可通过 ?type=xxx 过滤
func GetPriceEstimation ¶
func GetPricing ¶
func GetPrivacyPolicy ¶
func GetQuotaDatesByUser ¶
func GetRankings ¶
func GetRatioConfig ¶
func GetRedemption ¶
func GetResponseBody ¶
func GetSubscriptionPlans ¶
GetSubscriptionPlans is a stub handler
func GetSyncableChannels ¶
func GetTagModels ¶
func GetTenantWalletTxns ¶
GetTenantWalletTxns 企业管理员查看资金流水。 GET /api/user/tenant/wallet/txns?p=1&page_size=20
func GetTokenKey ¶
func GetTokenKeysBatch ¶
func GetTokenStatus ¶
func GetTokenUsage ¶
func GetTopUpInfo ¶
func GetTopupGiftBonus ¶
GetTopupGiftBonus 返回「面额(元) -> 赠送额(元)」映射,供前端展示充值赠送。 公开端点(前端下单页调用)。
func GetUiSkins ¶
GetUiSkins 公开端点:返回运营启用的皮肤(含 css),供前端运行时套用(配置即数据,免部署生效)。
func GetUptimeKumaStatus ¶
func GetUserAgreement ¶
func GetUserGroups ¶
func GetUserLogs ¶
func GetUserMidjourney ¶
func GetUserModels ¶
GetUserModels returns the models available to the authenticated user. The user ID is taken exclusively from the session context to prevent IDOR.
func GetUserOAuthBindings ¶
GetUserOAuthBindings returns the current user's custom OAuth bindings
func GetUserOAuthBindingsByAdmin ¶
GetUserOAuthBindingsByAdmin returns OAuth bindings for a specific user (admin)
func GetUserQuotaDates ¶
func GetUserSubscription ¶
GetUserSubscription is a stub handler
func GetUserTask ¶
func GetUserTopUps ¶
func GetUserWebhooks ¶
GetUserWebhooks returns all webhooks for the authenticated user. GET /api/webhook/
func GrantTenantWalletQuota ¶
GrantTenantWalletQuota 企业管理员向成员派发额度。 POST /api/user/tenant/wallet/grant {"user_id":123,"quota":500000}
func HandleOAuth ¶
HandleOAuth handles OAuth callback for all standard OAuth providers
func InitPaymentAtStartup ¶
func InitPaymentAtStartup()
InitPaymentAtStartup 在进程启动时一次性校验微信/支付宝密钥是否就位。 非致命:即使缺失也继续启动,由 /api/payment/status 暴露真实状态供部署冒烟判定。 密钥仅来自 .env 与 cert/ 文件(启动期加载),与二进制/前端解耦,故每次部署仅替换二进制即可,无需重填。
func KlingImage2VideoGenerations ¶
KlingImage2VideoGenerations @Summary 可灵官方-图生视频 @Description 调用可灵AI图生视频接口,生成视频内容 @Tags Video @Accept json @Produce json @Param Authorization header string true "用户认证令牌 (Aeess-Token: sk-xxxx)" @Param request body KlingImage2VideoRequest true "图生视频请求参数" @Success 200 {object} dto.VideoTaskResponse "任务状态和结果" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /kling/v1/videos/image2video [post]
func KlingImage2videoTaskId ¶
KlingImage2videoTaskId godoc @Summary 可灵任务查询--图生视频 @Description Query the status and result of a Kling video generation task by task ID @Tags Origin @Accept json @Produce json @Param task_id path string true "Task ID" @Router /kling/v1/videos/image2video/{task_id} [get]
func KlingText2VideoGenerations ¶
KlingText2VideoGenerations @Summary 可灵文生视频 @Description 调用可灵AI文生视频接口,生成视频内容 @Tags Video @Accept json @Produce json @Param Authorization header string true "用户认证令牌 (Aeess-Token: sk-xxxx)" @Param request body KlingText2VideoRequest true "视频生成请求参数" @Success 200 {object} dto.VideoTaskResponse "任务状态和结果" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /kling/v1/videos/text2video [post]
func KlingText2videoTaskId ¶
KlingText2videoTaskId godoc @Summary 可灵任务查询--文生视频 @Description Query the status and result of a Kling text-to-video generation task by task ID @Tags Origin @Accept json @Produce json @Param task_id path string true "Task ID" @Router /kling/v1/videos/text2video/{task_id} [get]
func ListActivities ¶
ListActivities 列出全部活动(父/子层级一并返回,前端按 parent_id 组装)。
func ListCustomOAuthProviders ¶
ListCustomOAuthProviders returns all custom OAuth providers
func ListI18nLocales ¶
ListI18nLocales 列出已配置覆盖的 locale(管理员本地化页用)。
func ListMarketplaceSkills ¶
ListMarketplaceSkills 技能目录列表(公开)。 查询参数:p(页码,从 1 起)、page_size、category、keyword。 非管理员强制只看 published;管理员可见全部状态。
func ListModels ¶
func ManageMultiKeys ¶
ManageMultiKeys handles multi-key management operations
func ManageUser ¶
func MigrateConsoleSetting ¶
MigrateConsoleSetting 迁移旧的控制台相关配置到 console_setting.*
func OllamaPullModelStream ¶
OllamaPullModelStream 流式拉取 Ollama 模型
func PaymentStatus ¶
PaymentStatus 供部署冒烟与 uptime-kuma 使用:双渠道均 ok 时 ready=true。
func Playground ¶
func Post2FADisable ¶
func Post2FAEnable ¶
func Post2FARegenerateBackup ¶
func Post2FASetup ¶
func PublishMarketplaceSkill ¶
PublishMarketplaceSkill 发布(注册)一个技能版本,仅管理员可用。
校验链(顺序执行,任一失败立即返回):
- name/version/download_url/sha256 非空 -> 400
- name 匹配 ^[a-z0-9][a-z0-9._-]{0,127}$ -> 400
- version 匹配语义化版本 -> 400
- sha256 为 64 位小写十六进制 -> 400
- download_url 必须 https:// 前缀 -> 400
- name+version 已存在 -> 409
- status ∈ {draft, published, deprecated},缺省 draft -> 400
不做「回源实算 SHA256」:发布是管理员操作,同步下载大文件会阻塞请求并引入 SSRF 面; 真正的完整性保障发生在客户端——安装脚本下载后本地比对 sha256。
func QueryAlipayOrder ¶
QueryAlipayOrder 轮询支付宝支付订单状态(与 QueryWechatOrder 对称)。 供前端在支付后主动查询使用;若支付宝侧已支付则立即入账并返回 success。
func RecycleTenantWalletQuota ¶
RecycleTenantWalletQuota 企业管理员从成员回收额度。 POST /api/user/tenant/wallet/recycle {"user_id":123,"quota":500000}
func RelayMidjourney ¶
func RelayNotFound ¶
func RelayNotImplemented ¶
func RelayTaskFetch ¶
func ReloadConfig ¶
ReloadConfig 免重启热加载所有配置驱动状态(选项表 → 数据库定价 → 本地化覆盖 → 失效定价缓存)。 对应「配置即数据」哲学:改配置不部署,重启脚本/systemctl 也行,但本端点更轻量。管理员端点。
func RequestAlipayAmount ¶
RequestAlipayAmount handles the Alipay amount query request.
func RequestAlipayPay ¶
RequestAlipayPay handles the Alipay payment request.
func RequestEnterpriseWalletTopUp ¶
RequestEnterpriseWalletTopUp 企业管理员为企业主钱包发起自助充值。 POST /api/user/tenant/wallet/topup {"amount":10000,"payment_method":"wechat"}
func RequestWechatAmount ¶
RequestWechatAmount 计算微信支付金额(仅计算,不下单)
func ResetModelRatio ¶
func ResetPassword ¶
func ResetPerformanceStats ¶
ResetPerformanceStats 重置性能统计
func RetrieveModel ¶
func SearchAllLogs
deprecated
func SearchChannels ¶
func SearchDeployments ¶
func SearchRedemptions ¶
func SearchTokens ¶
func SearchUserLogs ¶
SearchUserLogs returns the authenticated user's own API request logs. Supports pagination via p/page_size and optional filters: type, model_name, token_name, start_timestamp, end_timestamp, request_id.
func SearchUsers ¶
func SendEmailVerification ¶
func SendPasswordResetEmail ¶
func StartChannelUpstreamModelUpdateTask ¶
func StartChannelUpstreamModelUpdateTask()
func StartCodexOAuth ¶
func SyncUpstreamModels ¶
SyncUpstreamModels 同步上游模型与供应商: - 默认仅创建「未配置模型」 - 可通过 overwrite 选择性覆盖更新本地已有模型的字段(前提:sync_official <> 0)
func SyncUpstreamPreview ¶
SyncUpstreamPreview 预览上游与本地的差异(仅用于弹窗选择)
func TestAllChannels ¶
func TestChannel ¶
func TestIoNetConnection ¶
func TestStatus ¶
func TransferAffQuota ¶
func UnbindCustomOAuth ¶
UnbindCustomOAuth removes a custom OAuth binding for the current user
func UnbindCustomOAuthByAdmin ¶
UnbindCustomOAuthByAdmin removes a custom OAuth binding for a specific user (admin)
func UpdateAllChannelBalances ¶
func UpdateAllChannelBalances() error
func UpdateChannel ¶
func UpdateChannelBalance ¶
func UpdateCustomOAuthProvider ¶
UpdateCustomOAuthProvider updates an existing custom OAuth provider
func UpdateDeployment ¶
func UpdateDeploymentName ¶
func UpdateI18nMessages ¶
UpdateI18nMessages 批量覆盖某 locale 的文案(管理员,免部署生效)。
func UpdateMidjourneyTaskBulk ¶
func UpdateMidjourneyTaskBulk()
func UpdateModelPricing ¶
UpdateModelPricing 覆盖单个模型定价并热更新(写库 → 重载 ratio_setting → 失效定价缓存)。 改价 = 管理员操作,0 部署。
func UpdateOption ¶
func UpdateRedemption ¶
func UpdateSelf ¶
func UpdateTaskBulk ¶
func UpdateTaskBulk()
func UpdateToken ¶
func UpdateUser ¶
func UpdateUserSetting ¶
func UpdateUserWebhook ¶
UpdateUserWebhook updates an existing webhook. PUT /api/webhook/:id
func UpdateVideoTaskAll ¶
func UploadFile ¶
UploadFile 通用文件上传(用户已登录)。用于企业营业执照等合规材料上传。 文件保存到 ./uploads/enterprise/<uuid>.<ext>,并返回可访问的 URL 路径。
func UpsertUiSkin ¶
UpsertUiSkin 后台:创建或更新皮肤(运营可加第 5 套免部署)。css 留空则前端回退 bundled 内置定义。
func UserGetMembershipInfo ¶
func UserUseInvitationCode ¶
func VideoGenerations ¶
VideoGenerations @Summary 生成视频 @Description 调用视频生成接口生成视频 @Description 支持多种视频生成服务: @Description - 可灵AI (Kling): https://app.klingai.com/cn/dev/document-api/apiReference/commonInfo @Description - 即梦 (Jimeng): https://www.volcengine.com/docs/85621/1538636 @Tags Video @Accept json @Produce json @Param Authorization header string true "用户认证令牌 (Aeess-Token: sk-xxxx)" @Param request body dto.VideoRequest true "视频生成请求参数" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /v1/video/generations [post]
func VideoGenerationsTaskId ¶
VideoGenerationsTaskId @Summary 查询视频 @Description 根据任务ID查询视频生成任务的状态和结果 @Tags Video @Accept json @Produce json @Security BearerAuth @Param task_id path string true "Task ID" @Success 200 {object} dto.VideoTaskResponse "任务状态和结果" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /v1/video/generations/{task_id} [get]
func VideoProxy ¶
func WebSocketHandler ¶
WebSocketHandler 处理 WebSocket 连接请求 客户端需要通过 token 认证(Query 参数或 Header) 用法:GET /api/ws?token=xxx 或 Header: Authorization: Bearer xxx
func WechatNotify ¶
WechatNotify handles the Wechat Pay asynchronous callback notification.
Types ¶
type APGC2DGPTUsageResponse ¶
type API2GPTUsageResponse ¶
type AddChannelRequest ¶
type AdminCompleteTopupRequest ¶
type AdminCompleteTopupRequest struct {
TradeNo string `json:"trade_no"`
}
type AlipayAdaptor ¶
type AlipayAdaptor struct{}
AlipayAdaptor implements the Alipay payment adaptor.
func (*AlipayAdaptor) RequestAmount ¶
func (*AlipayAdaptor) RequestAmount(c *gin.Context, req *AlipayPayRequest)
RequestAmount calculates and returns the payment amount for the given request.
func (*AlipayAdaptor) RequestPay ¶
func (*AlipayAdaptor) RequestPay(c *gin.Context, req *AlipayPayRequest)
RequestPay creates an Alipay payment order and returns the payment URL.
type AlipayPayRequest ¶
type AlipayPayRequest struct {
// Amount is the quantity of units to purchase.
Amount int64 `json:"amount"`
// PaymentMethod specifies the payment method (e.g., "alipay").
PaymentMethod string `json:"payment_method"`
// ReturnURL is the optional custom URL to redirect after successful payment.
// If empty, defaults to the server's console log page.
ReturnURL *string `json:"return_url,omitempty"`
}
AlipayPayRequest represents a payment request for Alipay checkout.
type AlipayReconcileItem ¶
type AlipayReconcileItem struct {
OutTradeNo string `json:"out_trade_no"`
UserId int `json:"user_id"`
Money string `json:"money"`
AlipayStatus string `json:"alipay_status"`
Paid bool `json:"paid"`
Completed bool `json:"completed"`
Note string `json:"note"`
}
AlipayReconcileItem 单条对账结果
func ReconcilePendingAlipayOrders ¶
func ReconcilePendingAlipayOrders() ([]AlipayReconcileItem, error)
ReconcilePendingAlipayOrders 主动对账:查询所有 pending 的支付宝订单在支付宝侧的真实交易状态, 对已付款但未到账的订单调用 model.RechargeAlipay 完成入账(含配额、赠送、返利)。 作为异步通知失败时的兜底,确保充值自动到账,无需人工补单。
type BindPhoneRequest ¶
type BindPhoneRequest struct {
Phone string `json:"phone" binding:"required,len=11"`
Code string `json:"code" binding:"required,len=6"`
Password string `json:"password" binding:"omitempty,min=8,max=20"`
}
BindPhoneRequest 绑定手机号请求
type BindWeChatRequest ¶
type BindWeChatRequest struct {
Code string `json:"code" binding:"required"`
}
BindWeChatRequest 绑定微信请求
type ChannelBatch ¶
type ChannelTag ¶
type ChannelTag struct {
Tag string `json:"tag"`
NewTag *string `json:"new_tag"`
Priority *int64 `json:"priority"`
Weight *uint `json:"weight"`
ModelMapping *string `json:"model_mapping"`
Models *string `json:"models"`
Groups *string `json:"groups"`
ParamOverride *string `json:"param_override"`
HeaderOverride *string `json:"header_override"`
}
type DeepSeekUsageResponse ¶
type DiskCacheInfo ¶
type DiskCacheInfo struct {
// 缓存目录路径
Path string `json:"path"`
// 目录是否存在
Exists bool `json:"exists"`
// 文件数量
FileCount int `json:"file_count"`
// 总大小(字节)
TotalSize int64 `json:"total_size"`
}
DiskCacheInfo 磁盘缓存目录信息
type I18nBulkRequest ¶
type KlingCameraConfig ¶
type KlingCameraConfig struct {
Horizontal float64 `json:"horizontal,omitempty" example:"2.5"`
Vertical float64 `json:"vertical,omitempty" example:"0"`
Pan float64 `json:"pan,omitempty" example:"0"`
Tilt float64 `json:"tilt,omitempty" example:"0"`
Roll float64 `json:"roll,omitempty" example:"0"`
Zoom float64 `json:"zoom,omitempty" example:"0"`
}
type KlingCameraControl ¶
type KlingCameraControl struct {
Type string `json:"type,omitempty" example:"simple"`
Config *KlingCameraConfig `json:"config,omitempty"`
}
type KlingImage2VideoRequest ¶
type KlingImage2VideoRequest struct {
ModelName string `json:"model_name,omitempty" example:"kling-v2-master"`
Image string `` /* 181-byte string literal not displayed */
Prompt string `json:"prompt,omitempty" example:"A cat playing piano in the garden"`
NegativePrompt string `json:"negative_prompt,omitempty" example:"blurry, low quality"`
CfgScale float64 `json:"cfg_scale,omitempty" example:"0.7"`
Mode string `json:"mode,omitempty" example:"std"`
CameraControl *KlingCameraControl `json:"camera_control,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty" example:"16:9"`
Duration string `json:"duration,omitempty" example:"5"`
CallbackURL string `json:"callback_url,omitempty" example:"https://your.domain/callback"`
ExternalTaskId string `json:"external_task_id,omitempty" example:"custom-task-002"`
}
type KlingText2VideoRequest ¶
type KlingText2VideoRequest struct {
ModelName string `json:"model_name,omitempty" example:"kling-v1"`
Prompt string `json:"prompt" binding:"required" example:"A cat playing piano in the garden"`
NegativePrompt string `json:"negative_prompt,omitempty" example:"blurry, low quality"`
CfgScale float64 `json:"cfg_scale,omitempty" example:"0.7"`
Mode string `json:"mode,omitempty" example:"std"`
CameraControl *KlingCameraControl `json:"camera_control,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty" example:"16:9"`
Duration string `json:"duration,omitempty" example:"5"`
CallbackURL string `json:"callback_url,omitempty" example:"https://your.domain/callback"`
ExternalTaskId string `json:"external_task_id,omitempty" example:"custom-task-001"`
}
type LogFileInfo ¶
type LogFileInfo struct {
Name string `json:"name"`
Size int64 `json:"size"`
ModTime time.Time `json:"mod_time"`
}
LogFileInfo 日志文件信息
type LogFilesResponse ¶
type LogFilesResponse struct {
LogDir string `json:"log_dir"`
Enabled bool `json:"enabled"`
FileCount int `json:"file_count"`
TotalSize int64 `json:"total_size"`
OldestTime *time.Time `json:"oldest_time,omitempty"`
NewestTime *time.Time `json:"newest_time,omitempty"`
Files []LogFileInfo `json:"files"`
}
LogFilesResponse 日志文件列表响应
type LoginRequest ¶
type ManageRequest ¶
type ManageRequest struct {
Id int `json:"id"`
Action string `json:"action"`
Value int `json:"value"`
Mode string `json:"mode"`
}
计算用户权限的辅助函数 根据用户角色生成默认的边栏配置
type MemoryStats ¶
type MemoryStats struct {
// 已分配内存(字节)
Alloc uint64 `json:"alloc"`
// 总分配内存(字节)
TotalAlloc uint64 `json:"total_alloc"`
// 系统内存(字节)
Sys uint64 `json:"sys"`
// GC 次数
NumGC uint32 `json:"num_gc"`
// Goroutine 数量
NumGoroutine int `json:"num_goroutine"`
}
MemoryStats 内存统计
type MultiKeyManageRequest ¶
type MultiKeyManageRequest struct {
ChannelId int `json:"channel_id"`
Action string `json:"action"` // "disable_key", "enable_key", "delete_key", "delete_disabled_keys", "get_key_status"
KeyIndex *int `json:"key_index,omitempty"` // for disable_key, enable_key, and delete_key actions
Page int `json:"page,omitempty"` // for get_key_status pagination
PageSize int `json:"page_size,omitempty"` // for get_key_status pagination
Status *int `json:"status,omitempty"` // for get_key_status filtering: 1=enabled, 2=manual_disabled, 3=auto_disabled, nil=all
}
type MultiKeyStatusResponse ¶
type MultiKeyStatusResponse struct {
Keys []KeyStatus `json:"keys"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
TotalPages int `json:"total_pages"`
// Statistics
EnabledCount int `json:"enabled_count"`
ManualDisabledCount int `json:"manual_disabled_count"`
AutoDisabledCount int `json:"auto_disabled_count"`
}
MultiKeyStatusResponse represents the response for key status query
type OAuthRegistrationDisabledError ¶
type OAuthRegistrationDisabledError struct{}
func (*OAuthRegistrationDisabledError) Error ¶
func (e *OAuthRegistrationDisabledError) Error() string
type OAuthUserDeletedError ¶
type OAuthUserDeletedError struct{}
Error types for OAuth
func (*OAuthUserDeletedError) Error ¶
func (e *OAuthUserDeletedError) Error() string
type OpenAICreditGrants ¶
type OpenAIModel ¶
type OpenAIModel struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
OwnedBy string `json:"owned_by"`
Metadata map[string]any `json:"metadata,omitempty"`
Permission []struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
AllowCreateEngine bool `json:"allow_create_engine"`
AllowSampling bool `json:"allow_sampling"`
AllowLogprobs bool `json:"allow_logprobs"`
AllowSearchIndices bool `json:"allow_search_indices"`
AllowView bool `json:"allow_view"`
AllowFineTuning bool `json:"allow_fine_tuning"`
Organization string `json:"organization"`
Group string `json:"group"`
IsBlocking bool `json:"is_blocking"`
} `json:"permission"`
Root string `json:"root"`
Parent string `json:"parent"`
}
type OpenAIModelsResponse ¶
type OpenAIModelsResponse struct {
Data []OpenAIModel `json:"data"`
Success bool `json:"success"`
}
type OpenAISBUsageResponse ¶
type OpenAISubscriptionResponse ¶
type OpenAISubscriptionResponse struct {
Object string `json:"object"`
HasPaymentMethod bool `json:"has_payment_method"`
SoftLimitUSD float64 `json:"soft_limit_usd"`
HardLimitUSD float64 `json:"hard_limit_usd"`
SystemHardLimitUSD float64 `json:"system_hard_limit_usd"`
AccessUntil int64 `json:"access_until"`
}
type OpenAIUsageDailyCost ¶
type OpenAIUsageResponse ¶
type OptionUpdateRequest ¶
type PasswordResetRequest ¶
type PatchChannel ¶
type PaymentComplianceRequest ¶
type PaymentComplianceRequest struct {
Confirmed bool `json:"confirmed"`
}
type PerformanceConfig ¶
type PerformanceConfig struct {
// 是否启用磁盘缓存
DiskCacheEnabled bool `json:"disk_cache_enabled"`
// 磁盘缓存阈值(MB)
DiskCacheThresholdMB int `json:"disk_cache_threshold_mb"`
// 磁盘缓存最大大小(MB)
DiskCacheMaxSizeMB int `json:"disk_cache_max_size_mb"`
// 磁盘缓存路径
DiskCachePath string `json:"disk_cache_path"`
// 是否在容器中运行
IsRunningInContainer bool `json:"is_running_in_container"`
// MonitorEnabled 是否启用性能监控
MonitorEnabled bool `json:"monitor_enabled"`
// MonitorCPUThreshold CPU 使用率阈值(%)
MonitorCPUThreshold int `json:"monitor_cpu_threshold"`
// MonitorMemoryThreshold 内存使用率阈值(%)
MonitorMemoryThreshold int `json:"monitor_memory_threshold"`
// MonitorDiskThreshold 磁盘使用率阈值(%)
MonitorDiskThreshold int `json:"monitor_disk_threshold"`
}
PerformanceConfig 性能配置
type PerformanceStats ¶
type PerformanceStats struct {
// 缓存统计
CacheStats common.DiskCacheStats `json:"cache_stats"`
// 系统内存统计
MemoryStats MemoryStats `json:"memory_stats"`
// 磁盘缓存目录信息
DiskCacheInfo DiskCacheInfo `json:"disk_cache_info"`
// 磁盘空间信息
DiskSpaceInfo common.DiskSpaceInfo `json:"disk_space_info"`
// 配置信息
Config PerformanceConfig `json:"config"`
}
PerformanceStats 性能统计信息
type QueryAlipayOrderRequest ¶
type QueryAlipayOrderRequest struct {
TradeNo string `json:"trade_no"`
}
QueryAlipayOrderRequest 查询订单请求
type QueryWechatOrderRequest ¶
type QueryWechatOrderRequest struct {
TradeNo string `json:"trade_no"`
}
QueryWechatOrderRequest 查询订单请求
type SetupRequest ¶
type SiliconFlowUsageResponse ¶
type SiliconFlowUsageResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Status bool `json:"status"`
Data struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Email string `json:"email"`
IsAdmin bool `json:"isAdmin"`
Balance string `json:"balance"`
Status string `json:"status"`
Introduction string `json:"introduction"`
Role string `json:"role"`
ChargeBalance string `json:"chargeBalance"`
TotalBalance string `json:"totalBalance"`
Category string `json:"category"`
} `json:"data"`
}
type SkillPublishRequest ¶
type SkillPublishRequest struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
Category string `json:"category"`
DownloadUrl string `json:"download_url"`
Sha256 string `json:"sha256"`
SizeBytes int64 `json:"size_bytes"`
Status string `json:"status"`
}
SkillPublishRequest 发布技能的请求体。 服务端绝不接受前端传入的 user_id/tenant_id,本期一律写 0(公开技能)。
type TokenBatch ¶
type TokenBatch struct {
Ids []int `json:"ids"`
}
type TransferAffQuotaRequest ¶
type TransferAffQuotaRequest struct {
Quota int `json:"quota" binding:"required"`
}
setup session & cookies and then return user info
type UiSkinRequest ¶
type UnbindPhoneRequest ¶
type UnbindPhoneRequest struct {
Code string `json:"code" binding:"required,len=6"`
Password string `json:"password" binding:"required,min=8,max=20"`
}
UnbindPhoneRequest 解绑手机号请求
type UnbindWeChatRequest ¶
type UnbindWeChatRequest struct {
Password string `json:"password" binding:"required,min=8,max=20"`
}
UnbindWeChatRequest 解绑微信请求
type UpdateUserSettingRequest ¶
type UpdateUserSettingRequest struct {
QuotaWarningType string `json:"notify_type"`
QuotaWarningThreshold float64 `json:"quota_warning_threshold"`
WebhookUrl string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
NotificationEmail string `json:"notification_email,omitempty"`
BarkUrl string `json:"bark_url,omitempty"`
GotifyUrl string `json:"gotify_url,omitempty"`
GotifyToken string `json:"gotify_token,omitempty"`
GotifyPriority int `json:"gotify_priority,omitempty"`
UpstreamModelUpdateNotifyEnabled *bool `json:"upstream_model_update_notify_enabled,omitempty"`
AcceptUnsetModelRatioModel bool `json:"accept_unset_model_ratio_model"`
RecordIpLog bool `json:"record_ip_log"`
}
type UptimeGroupResult ¶
type WechatAdaptor ¶
type WechatAdaptor struct{}
WechatAdaptor implements the Wechat Pay payment adaptor.
func (*WechatAdaptor) RequestAmount ¶
func (*WechatAdaptor) RequestAmount(c *gin.Context, req *WechatPayRequest)
RequestAmount calculates and returns the payment amount for the given request.
func (*WechatAdaptor) RequestPay ¶
func (*WechatAdaptor) RequestPay(c *gin.Context, req *WechatPayRequest)
RequestPay creates a Wechat Pay Native order and returns the code_url.
type WechatPayRequest ¶
type WechatPayRequest struct {
Amount int64 `json:"amount"`
PaymentMethod string `json:"payment_method"`
ReturnURL *string `json:"return_url,omitempty"`
}
WechatPayRequest 微信支付请求结构
type WechatReconcileItem ¶
type WechatReconcileItem struct {
OutTradeNo string `json:"out_trade_no"`
UserId int `json:"user_id"`
Money string `json:"money"`
WechatStatus string `json:"wechat_status"`
Paid bool `json:"paid"`
Completed bool `json:"completed"`
Note string `json:"note"`
}
WechatReconcileItem 单笔微信对账明细
func ReconcilePendingWechatOrders ¶
func ReconcilePendingWechatOrders() ([]WechatReconcileItem, error)
ReconcilePendingWechatOrders 主动对账:查询所有 pending 的微信订单在微信侧的真实交易状态, 对已付款但未到账的订单调用 model.RechargeWechat 完成入账(含配额、赠送、返利)。 作为异步通知失败时的兜底,确保充值自动到账,无需人工补单。
Source Files
¶
- account_binding.go
- activity.go
- billing.go
- channel-billing.go
- channel-test.go
- channel.go
- channel_affinity_cache.go
- channel_models.go
- channel_multi_keys.go
- channel_ollama.go
- channel_upstream_update.go
- checkin.go
- codex_oauth.go
- codex_usage.go
- config_reload.go
- console_migrate.go
- custom_oauth_provider.go
- deployment.go
- enterprise_controller.go
- enterprise_user.go
- enterprise_wallet_topup.go
- group.go
- group_ratio.go
- i18n_message.go
- image.go
- init_payment.go
- log.go
- marketplace.go
- midjourney.go
- misc.go
- misc_controller.go
- missing_models.go
- model.go
- model_meta.go
- model_sync.go
- oauth.go
- option.go
- passkey.go
- payment_compliance.go
- payment_webhook_availability.go
- perf_metrics.go
- performance.go
- phone_auth.go
- playground.go
- prefill_group.go
- pricing.go
- pricing_db.go
- rankings.go
- ratio_config.go
- ratio_sync.go
- redemption.go
- relay.go
- repo_accessors.go
- return_path.go
- setup.go
- stub_handlers.go
- swag_video.go
- task.go
- task_video.go
- tenant_self.go
- tenant_wallet.go
- token.go
- topup.go
- topup_alipay.go
- topup_wechat.go
- ui_skin.go
- uptime_kuma.go
- usedata.go
- user.go
- user_2fa_stub.go
- user_admin.go
- user_auth.go
- user_self.go
- user_setting.go
- user_topup.go
- user_webhook.go
- vendor_meta.go
- video_proxy.go
- video_proxy_gemini.go
- websocket.go