fix(api): close session when terminal away & refactor(api): deploy

This commit is contained in:
ttk
2024-09-04 14:56:39 +08:00
parent 171db09600
commit cbaff314b7
25 changed files with 174 additions and 177 deletions

View File

@@ -124,7 +124,11 @@ func doCreate[T model.Model](ctx *gin.Context, needAcl bool, md T, resourceType
return
}
ctx.JSON(http.StatusOK, defaultHttpResponse)
ctx.JSON(http.StatusOK, HttpResponse{
Data: map[string]any{
"id": md.GetId(),
},
})
return
}
@@ -199,7 +203,11 @@ func doDelete[T model.Model](ctx *gin.Context, needAcl bool, md T, dcs ...delete
return
}
ctx.JSON(http.StatusOK, defaultHttpResponse)
ctx.JSON(http.StatusOK, HttpResponse{
Data: map[string]any{
"id": md.GetId(),
},
})
return
}
@@ -285,7 +293,11 @@ func doUpdate[T model.Model](ctx *gin.Context, needAcl bool, md T, preHooks ...p
return
}
ctx.JSON(http.StatusOK, defaultHttpResponse)
ctx.JSON(http.StatusOK, HttpResponse{
Data: map[string]any{
"id": md.GetId(),
},
})
return
}