feat(*): 模型计费与渠道目录 - 支持视频 Token 报价结算和稳定模型展示

This commit is contained in:
ddCat
2026-09-18 23:26:54 +08:00
parent 90add8c466
commit 1a79005d25
57 changed files with 2904 additions and 341 deletions

View File

@@ -11,6 +11,23 @@ import (
// RegisterModelCatalogRoutes 注册统一模型目录路由
func RegisterModelCatalogRoutes(r *gin.RouterGroup, svc *service.Service) {
r.POST("/model-catalog/quote", func(c *gin.Context) {
if _, err := currentUser(c, svc); err != nil {
failService(c, err)
return
}
var req service.ChannelModelQuoteRequest
if err := c.ShouldBindJSON(&req); err != nil {
fail(c, http.StatusBadRequest, errors.New("模型报价请求格式错误"))
return
}
quote, err := svc.QuoteChannelModel(req)
if err != nil {
failService(c, err)
return
}
ok(c, gin.H{"quote": quote})
})
r.GET("/model-catalog", func(c *gin.Context) {
if _, err := currentUser(c, svc); err != nil {
failService(c, err)