[重构] 将多个 API 接口的请求方法从 PUT 和 DELETE 更改为 POST,并更新相关路由

This commit is contained in:
ryan
2026-03-17 09:57:38 +08:00
parent 2cdb844010
commit 2c17f3289b
18 changed files with 80 additions and 79 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ func RotateNodeBootstrapToken(c *gin.Context) {
// @Param payload body service.NodeInput true "Node payload"
// @Success 200 {object} map[string]interface{}
// @Failure 400 {object} map[string]interface{}
// @Router /api/nodes/{id} [put]
// @Router /api/nodes/{id}/update [post]
func UpdateNode(c *gin.Context) {
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
if err != nil || id == 0 {
@@ -114,7 +114,7 @@ func UpdateNode(c *gin.Context) {
// @Param id path int true "Node ID"
// @Success 200 {object} map[string]interface{}
// @Failure 400 {object} map[string]interface{}
// @Router /api/nodes/{id} [delete]
// @Router /api/nodes/{id}/delete [post]
func DeleteNode(c *gin.Context) {
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
if err != nil || id == 0 {