包含前端(Vue3 + VueFlow 画布)、后端(Go)、文档体系。 - 工作台画布:节点拖放、连线模式、右键菜单、AI 助手 - 后端:连接器 API、专员种子数据 - 导航:左侧导航、工坊、市场、控制台
20 lines
424 B
Go
20 lines
424 B
Go
package api
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"eaisalestrain/backend/internal/web"
|
|
)
|
|
|
|
// parseID 解析路径中的 uint id,失败返回 false 并已写入错误响应
|
|
func parseID(c *gin.Context, name string) (uint, bool) {
|
|
id, err := strconv.ParseUint(c.Param(name), 10, 64)
|
|
if err != nil || id == 0 {
|
|
web.Fail(c, web.NewBadRequest("无效的 "+name))
|
|
return 0, false
|
|
}
|
|
return uint(id), true
|
|
}
|