feat(admin): PR #497 - 合并系统渠道复制

This commit is contained in:
ddCat
2026-09-14 19:47:03 +08:00
9 changed files with 254 additions and 3 deletions

View File

@@ -427,6 +427,19 @@ func RegisterAdminRoutes(r *gin.RouterGroup, svc *service.Service) {
}
ok(c, gin.H{"channel": channel})
})
r.POST("/admin/channels/:id/duplicate", func(c *gin.Context) {
user, err := currentUser(c, svc)
if err != nil {
failService(c, err)
return
}
channel, err := svc.DuplicateSystemChannel(user, c.Param("id"))
if err != nil {
failService(c, err)
return
}
ok(c, gin.H{"channel": channel})
})
r.PATCH("/admin/channels/:id", func(c *gin.Context) {
user, err := currentUser(c, svc)
if err != nil {

View File

@@ -22,6 +22,7 @@ tags:
- name: tasks
- name: assets
- name: agent
- name: admin
paths:
/agent/capabilities:
get:
@@ -222,6 +223,24 @@ paths:
application/yaml:
schema:
type: string
/admin/channels/{id}/duplicate:
post:
tags: [admin]
summary: 复制系统渠道
parameters:
- in: path
name: id
required: true
schema: { type: string }
responses:
"200":
$ref: "#/components/responses/Envelope"
"401":
$ref: "#/components/responses/Error"
"403":
$ref: "#/components/responses/Error"
"404":
$ref: "#/components/responses/Error"
/auth/session:
get:
tags: [auth]