Files
new-api/controller/asset.go
T
t0ng7u 285025b3d1 feat(asset): generalize Doubao asset API into a configurable multi-outbound gateway
Turn the fixed Volcengine asset integration into a configurable gateway that
supports multiple outbounds and template-driven custom formats, with per-user
isolation, billing, logging and rate limiting.

- Add multi-outbound resolution (selector header / query + default + failover)
  with volcengine (AK/SK HMAC), newapi (path-action + bearer) and custom formats
- Add a template-driven custom-format engine: templated URL/auth/headers and
  JSON request/response/item field mapping; ship a Volcengine-compatible preset
- Drop the built-in volcengine_token format; it is now a custom-format preset
- Add the {uuid} template placeholder
- Enforce per-user isolation: auto-provision a dedicated per-user asset group
  per outbound and scope all asset reads/writes to it; admin-only group CRUD
- Add per-operation billing with quota checks and consumption logging, plus
  per-user rate limiting
- Rename AssetGroupBinding.Provider to Format
- Frontend: flat settings UI with collapsible outbounds, visual custom-format
  editor with JSON view, placeholder reference dialog and help dialog;
  widen Select dropdowns to avoid truncation
- i18n: add asset-gateway keys across en/zh/fr/ja/ru/vi (all locales aligned)
- dev: proxy /v1, /doubao, /kling and /jimeng to the backend in rsbuild dev
- docs: add end-to-end asset gateway integration test report
- test: update asset settings/secret-redaction tests for the new formats
2026-07-01 05:49:20 +08:00

47 lines
873 B
Go

package controller
import (
"github.com/QuantumNous/new-api/relay/channel/task/doubao"
"github.com/gin-gonic/gin"
)
func RelayListAssets(c *gin.Context) {
doubao.HandleListAssets(c)
}
func RelayGetAsset(c *gin.Context) {
doubao.HandleGetAsset(c)
}
func RelayCreateAsset(c *gin.Context) {
doubao.HandleCreateAsset(c)
}
func RelayUpdateAsset(c *gin.Context) {
doubao.HandleUpdateAsset(c)
}
func RelayDeleteAsset(c *gin.Context) {
doubao.HandleDeleteAsset(c)
}
func RelayCreateAssetGroup(c *gin.Context) {
doubao.HandleCreateAssetGroup(c)
}
func RelayListAssetGroups(c *gin.Context) {
doubao.HandleListAssetGroups(c)
}
func RelayGetAssetGroup(c *gin.Context) {
doubao.HandleGetAssetGroup(c)
}
func RelayUpdateAssetGroup(c *gin.Context) {
doubao.HandleUpdateAssetGroup(c)
}
func RelayDeleteAssetGroup(c *gin.Context) {
doubao.HandleDeleteAssetGroup(c)
}