diff --git a/build/support-files/migrate_subject_system_group.py b/build/support-files/migrate_subject_system_group.py index 08bbed0e..98ca49ab 100644 --- a/build/support-files/migrate_subject_system_group.py +++ b/build/support-files/migrate_subject_system_group.py @@ -116,6 +116,8 @@ def db_list_subject_pk( sql = "SELECT MAX(pk) FROM subject WHERE type IN %s;" cursor.execute(sql, [tuple(types)]) max_pk = cursor.fetchone()[0] # type: ignore + if not max_pk: + return # 每次查询1000条 sql = "SELECT pk FROM subject WHERE type IN %s AND pk >= %s AND pk < %s;" diff --git a/pkg/api/model/handler/action.go b/pkg/api/model/handler/action.go index 98d0fa3e..a2a3ff85 100644 --- a/pkg/api/model/handler/action.go +++ b/pkg/api/model/handler/action.go @@ -123,7 +123,7 @@ func BatchCreateActions(c *gin.Context) { // @Header 200 {string} X-Request-Id "the request id" // @Security AppCode // @Security AppSecret -// @Router /api/v1/systems/{system_id}/action/{action_id} [put] +// @Router /api/v1/systems/{system_id}/actions/{action_id} [put] func UpdateAction(c *gin.Context) { systemID := c.Param("system_id") @@ -256,7 +256,7 @@ func UpdateAction(c *gin.Context) { // @Header 200 {string} X-Request-Id "the request id" // @Security AppCode // @Security AppSecret -// @Router /api/v1/systems/{system_id}/action/{action_id} [delete] +// @Router /api/v1/systems/{system_id}/actions/{action_id} [delete] func DeleteAction(c *gin.Context) { systemID := c.Param("system_id") actionID := c.Param("action_id")