联调bug修复

main
周平 11 months ago
parent 7a4212140f
commit bd92e72d5f

@ -29,12 +29,12 @@ class ClassificationAddHandler(APIHandler):
with self.app_mysql.connect() as conn:
cur = conn.execute(text("select id from model_classification where name=:name"), {"name": name})
classification_id = cur.fetchone()[0]
if classification_id:
row = db_mysql.to_json(cur)
if row:
raise errors.HTTPAPIError(errors.ERROR_BAD_REQUEST, "分类名称重复")
conn.execute(
text("""insert into model_classification (name, created_at) values (:name, NOW())"""), {"name": name}
text("""insert into model_classification (name, create_time) values (:name, NOW())"""), {"name": name}
)
self.finish()
@ -166,7 +166,7 @@ class AddHandler(APIHandler):
conn.execute(
text(
"""insert into model (name, model_type, classification, comment, created_at)
"""insert into model (name, model_type, classification, comment, create_time)
values (:name, :model_type, :classification, :comment, NOW())"""),
{"name": name, "model_type": model_type, "classification": classification, "comment": comment}
)
@ -296,7 +296,7 @@ class VersionAddHandler(APIHandler):
text(
"""
insert into model_version
(model_id, version, comment,model_file, config_file, config_str, created_at, update_time)
(model_id, version, comment,model_file, config_file, config_str, create_time, update_time)
values (:model_id, :version, :comment, :model_file, :config_file, :config_str, NOW(), NOW())"""
),

@ -16,7 +16,7 @@ handlers = [
("/model/version/edit", handler.VersionEditHandler),
("/model/version/list", handler.VersionListHandler),
("/model/version/info", handler.VersionInfoHandler),
("//model/version/setdefault", handler.VersionSetDefaultHandler),
("/model/version/setdefault", handler.VersionSetDefaultHandler),
("/model/version/delete", handler.VersionDeleteHandler),
]

Loading…
Cancel
Save