|
|
|
@ -8,7 +8,7 @@ from website import consts
|
|
|
|
|
from website import db_mysql
|
|
|
|
|
from website import errors
|
|
|
|
|
from website import settings
|
|
|
|
|
from website.handler import APIHandler, authenticated, operation_log
|
|
|
|
|
from website.handler import APIHandler, authenticated
|
|
|
|
|
from website.util import md5, shortuuid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -19,7 +19,6 @@ class ClassificationAddHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型列表", consts.op_type_add_str, "添加模型分类", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
name = self.get_escaped_argument("name", "")
|
|
|
|
|
if not name:
|
|
|
|
@ -54,7 +53,6 @@ class ClassificationEditHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型列表", consts.op_type_edit_str, "编辑模型分类", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
classification_id = self.get_int_argument("id")
|
|
|
|
|
name = self.get_escaped_argument("name", "")
|
|
|
|
@ -77,7 +75,6 @@ class ClassificationListHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型列表", consts.op_type_list_str, "查询模型分类", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
with self.app_mysql.connect() as conn:
|
|
|
|
|
cur = conn.execute(text("""select id, name from model_classification"""))
|
|
|
|
@ -92,7 +89,6 @@ class ClassificationDeleteHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型列表", consts.op_type_delete_str, "删除模型分类", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
classification_id = self.get_int_argument("id")
|
|
|
|
|
if not classification_id:
|
|
|
|
@ -114,7 +110,6 @@ class ListHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型列表", consts.op_type_list_str, "查询模型列表", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
pageNo = self.get_int_argument("pageNo", 1)
|
|
|
|
|
pageSize = self.get_int_argument("pageSize", consts.PAGE_SIZE)
|
|
|
|
@ -129,7 +124,7 @@ class ListHandler(APIHandler):
|
|
|
|
|
|
|
|
|
|
param = {}
|
|
|
|
|
|
|
|
|
|
sql_count = "select count(id) from model m where m.del=0 "
|
|
|
|
|
sql_count = "select count(id) from model where del=0 "
|
|
|
|
|
param_count = {}
|
|
|
|
|
|
|
|
|
|
if name:
|
|
|
|
@ -166,7 +161,6 @@ class ListHandler(APIHandler):
|
|
|
|
|
|
|
|
|
|
class ListSimpleHandler(APIHandler):
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型列表", consts.op_type_list_str, "查询模型列表", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
with self.app_mysql.connect() as conn:
|
|
|
|
|
sql = "select id, name from model where del=0"
|
|
|
|
@ -182,7 +176,6 @@ class AddHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "添加模型", consts.op_type_add_str, "添加模型", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
name = self.get_escaped_argument("name", "")
|
|
|
|
|
model_type = self.get_int_argument(
|
|
|
|
@ -225,7 +218,6 @@ class EditHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "编辑模型", consts.op_type_edit_str, "编辑模型", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
mid = self.get_int_argument("id")
|
|
|
|
|
name = self.get_escaped_argument("name", "")
|
|
|
|
@ -266,7 +258,6 @@ class InfoHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型信息", consts.op_type_list_str, "查询模型信息", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
mid = self.get_int_argument("id")
|
|
|
|
|
if not mid:
|
|
|
|
@ -309,7 +300,6 @@ class DeleteHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型列表", consts.op_type_delete_str, "删除模型", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
mid = self.get_int_argument("id")
|
|
|
|
|
if not mid:
|
|
|
|
@ -339,7 +329,6 @@ class VersionAddHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型版本", consts.op_type_add_str, "添加模型版本", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
mid = self.get_int_argument("model_id")
|
|
|
|
|
version = self.get_escaped_argument("version", "")
|
|
|
|
@ -393,7 +382,6 @@ class VersionEditHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型版本", consts.op_type_edit_str, "编辑模型版本", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
version_id = self.get_int_argument("version_id")
|
|
|
|
|
version = self.get_escaped_argument("version", "")
|
|
|
|
@ -457,7 +445,6 @@ class VersionListHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型版本", consts.op_type_list_str, "模型版本列表", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
model_id = self.get_int_argument("model_id")
|
|
|
|
|
pageNo = self.get_int_argument("pageNo", 1)
|
|
|
|
@ -537,7 +524,6 @@ class VersionInfoHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型版本", consts.op_type_list_str, "查询模型版本详情", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
version_id = self.get_int_argument("version_id")
|
|
|
|
|
response = {
|
|
|
|
@ -620,7 +606,6 @@ class VersionSetDefaultHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型版本", consts.op_type_edit_str, "设置模型版本为默认版本", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
version_id = self.get_int_argument("version_id")
|
|
|
|
|
model_id = self.get_int_argument("model_id")
|
|
|
|
@ -659,7 +644,6 @@ class VersionDeleteHandler(APIHandler):
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@authenticated
|
|
|
|
|
@operation_log("模型管理", "模型版本", consts.op_type_delete_str, "删除模型版本", "")
|
|
|
|
|
def post(self):
|
|
|
|
|
version_id = self.get_int_argument("version_id")
|
|
|
|
|
if not version_id:
|
|
|
|
|