更新代码,调整逻辑结构
parent
48c14a9651
commit
85daf8c320
@ -1,18 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import logging
|
||||
from website.db_mysql import get_session, to_json
|
||||
from sqlalchemy import text
|
||||
|
||||
class EnterpriseEntityDB(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
|
||||
def get_entity_suid(self, entity_id: int) -> str:
|
||||
with get_session() as session:
|
||||
res = session.execute(text("select suid from enterprise where id=:id"),
|
||||
{"id": entity_id})
|
||||
entity = to_json(res)
|
||||
|
||||
return entity["suid"] if entity else ""
|
@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import logging
|
||||
from website.db_mysql import get_session, to_json
|
||||
from sqlalchemy import text
|
||||
|
||||
"""
|
||||
CREATE TABLE `enterprise` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`suid` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`province` varchar(50) NOT NULL,
|
||||
`city` varchar(50) NOT NULL,
|
||||
`addr` varchar(255) NOT NULL,
|
||||
`industry` int NOT NULL,
|
||||
`contact` varchar(100) NOT NULL,
|
||||
`phone` varchar(50) NOT NULL,
|
||||
`summary` varchar(255) DEFAULT NULL,
|
||||
`logo` text,
|
||||
`account` varchar(20) DEFAULT NULL,
|
||||
`pwd` varchar(100) DEFAULT NULL,
|
||||
`del` int DEFAULT '0',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_suid` (`suid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='企业信息表';
|
||||
"""
|
||||
|
||||
|
||||
class EnterpriseEntityRepository(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
|
||||
def get_entity_suid(self, entity_id: int) -> str:
|
||||
with get_session() as session:
|
||||
res = session.execute(text("select suid from enterprise where id=:id"),
|
||||
{"id": entity_id})
|
||||
entity = to_json(res)
|
||||
|
||||
return entity["suid"] if entity else ""
|
@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from website.handlers.enterprise_busi_model import handler
|
||||
|
||||
|
||||
handlers = [
|
||||
("/enterprise/model/deployment/list", handler.ListHandler),
|
||||
("/enterprise/model/deployment/add", handler.AddHandler),
|
||||
("/enterprise/model/deployment/info", handler.InfoHandler),
|
||||
("/enterprise/model/deployment/edit", handler.EditHandler),
|
||||
|
||||
]
|
||||
page_handlers = [
|
||||
|
||||
]
|
Loading…
Reference in New Issue