refactor: 删除未实现的 call-function API
- 该功能与 dynamic-code/:key/execute 重复 - 保持代码整洁,移除无用代码
This commit is contained in:
@@ -33,7 +33,6 @@ func SetupCloudRoutes(r *gin.RouterGroup) {
|
|||||||
r.POST("/variables/:key/records", handleAppCreateVariableRecord)
|
r.POST("/variables/:key/records", handleAppCreateVariableRecord)
|
||||||
r.GET("/variables/:key/records", handleAppGetVariableRecords)
|
r.GET("/variables/:key/records", handleAppGetVariableRecords)
|
||||||
r.DELETE("/variables/:key/records/:record_id", handleAppDeleteVariableRecord)
|
r.DELETE("/variables/:key/records/:record_id", handleAppDeleteVariableRecord)
|
||||||
r.POST("/call-function", handleAppCallFunction)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleAppGetConstants(c *gin.Context) {
|
func handleAppGetConstants(c *gin.Context) {
|
||||||
@@ -674,34 +673,6 @@ func handleAppUploadVariableBinary(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleAppCallFunction(c *gin.Context) {
|
|
||||||
appKey := c.Param("appKey")
|
|
||||||
var app model.Application
|
|
||||||
if err := database.DB.Where("app_key = ?", appKey).First(&app).Error; err != nil {
|
|
||||||
response.Error(c, 404, "应用不存在")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if service.GetApplicationDisabledStatus(app.ID) {
|
|
||||||
response.Error(c, 403, "该应用已被禁用")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var req struct {
|
|
||||||
UserID uint `json:"user_id"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
Params map[string]interface{} `json:"params"`
|
|
||||||
}
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
|
||||||
response.Error(c, 400, "参数错误")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
response.Success(c, gin.H{
|
|
||||||
"result": nil,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func handleAppCreateVariableRecord(c *gin.Context) {
|
func handleAppCreateVariableRecord(c *gin.Context) {
|
||||||
appKey := c.Param("appKey")
|
appKey := c.Param("appKey")
|
||||||
key := c.Param("key")
|
key := c.Param("key")
|
||||||
|
|||||||
Reference in New Issue
Block a user