fix(handler): 短剧开关 - 关闭短剧时保留角色库、画风与声音接口 (#736)
短剧功能开关原本挂在整个 RegisterProjectRoutes 上,连画布共用的 /characters、 /style-profiles、/voice-profiles 也一起返回 403,导致关闭短剧后画布的角色库、我的画风和声音不可用。 将这三类个人资料库路由拆到 RegisterLibraryRoutes,在开关之外注册;/projects 系列仍受开关控制,登录校验不变。 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7f50b4507a
commit
28f2362e3e
4 files changed
+241
-131
No files matched your search
@@ -10,7 +10,8 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RegisterProjectRoutes(r *gin.RouterGroup, svc *service.Service) {
|
||||
// RegisterLibraryRoutes 注册画布和短剧共用的个人资料库(画风、声音、角色),不受短剧功能开关限制。
|
||||
func RegisterLibraryRoutes(r *gin.RouterGroup, svc *service.Service) {
|
||||
RegisterStyleProfileRoutes(r, svc)
|
||||
r.GET("/voice-profiles", func(c *gin.Context) {
|
||||
user, err := currentUser(c, svc)
|
||||
@@ -25,6 +26,11 @@ func RegisterProjectRoutes(r *gin.RouterGroup, svc *service.Service) {
|
||||
}
|
||||
ok(c, gin.H{"profiles": profiles})
|
||||
})
|
||||
registerCharacterLibraryRoutes(r, svc)
|
||||
}
|
||||
|
||||
// RegisterProjectRoutes 注册短剧项目接口,调用方负责挂短剧功能开关。
|
||||
func RegisterProjectRoutes(r *gin.RouterGroup, svc *service.Service) {
|
||||
registerProjectCoreRoutes(r, svc)
|
||||
registerProjectUnitRoutes(r, svc)
|
||||
registerProjectAssetRoutes(r, svc)
|
||||
|
||||
Reference in new issue
Block a user