feat(admin): 系统渠道 - 增加复制渠道

This commit is contained in:
esncy
2026-09-14 09:31:03 +08:00
parent 4b0e9d8965
commit 73439aac23
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:
@@ -185,6 +186,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]